get boundary lon/lat from area

8 views
Skip to first unread message

R Alb

unread,
Apr 23, 2023, 4:26:20 AM4/23/23
to pyt...@googlegroups.com
Hi,
How can I get boundary lon/lat's from an area as defined in areas.yaml? So at least 2 pairs (lon,lat). Given plate carree or mercator projection.
Regards,
Rob.

David Hoese

unread,
Apr 23, 2023, 4:01:54 PM4/23/23
to pyt...@googlegroups.com, R Alb
Hi Rob,

Check out the `get_bbox_lonlats` method of the AreaDefinition:

https://pyresample.readthedocs.io/en/latest/api/pyresample.html#pyresample.geometry.BaseDefinition.get_bbox_lonlats

Let me know if that wasn't what you expected.

Dave
> --
> You received this message because you are subscribed to the Google Groups "pytroll" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/CAEEXRXZzwdmLS9c54_-_TrUK%2BftJKYP-SpTbx-ASnhWvBxz6Aw%40mail.gmail.com <https://groups.google.com/d/msgid/pytroll/CAEEXRXZzwdmLS9c54_-_TrUK%2BftJKYP-SpTbx-ASnhWvBxz6Aw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

David Hoese

unread,
Apr 25, 2023, 8:03:31 AM4/25/23
to R Alb, pyt...@googlegroups.com
Sorry for missing this reply of yours. There are other methods on AreaDefinitions specifically that allow you to get bounding coordinates in either lon/lat space or x/y space. You still have to create the AreaDefinition object from the YAML, but this isn't taking up much memory if that's a concern of yours as the AreaDefinition only has a few parameters, none of which are arrays of data.

https://pyresample.readthedocs.io/en/latest/api/pyresample.html#pyresample.geometry.BaseDefinition.boundary
https://pyresample.readthedocs.io/en/latest/api/pyresample.html#pyresample.geometry.BaseDefinition.get_boundary_lonlats

So these would describe the polygon around the area, not just the "box" containing it.

Dave

On 4/24/23 02:25, R Alb wrote:
> Hi, David.
> I don't think this is what I mean. I would like to get the boundary coordinates without having any data loaded. So pure from what is defined in the areas.yaml files. That is maybe not always exact-to-the-pixel, depending on the projection used, but that is not so important. Goal is to project the chosen area on a simple earth map (from area names it is not always clear what is covered).
> Regards,
> Rob
>
>
> Op zo 23 apr 2023 om 22:01 schreef David Hoese <dho...@gmail.com <mailto:dho...@gmail.com>>:
>
> Hi Rob,
>
> Check out the `get_bbox_lonlats` method of the AreaDefinition:
>
> https://pyresample.readthedocs.io/en/latest/api/pyresample.html#pyresample.geometry.BaseDefinition.get_bbox_lonlats <https://pyresample.readthedocs.io/en/latest/api/pyresample.html#pyresample.geometry.BaseDefinition.get_bbox_lonlats>
>
> Let me know if that wasn't what you expected.
>
> Dave
>
> On 4/23/23 03:26, R Alb wrote:
> > Hi,
> > How can I get boundary lon/lat's from an area as defined in areas.yaml? So at least 2 pairs (lon,lat). Given plate carree or mercator projection.
> > Regards,
> > Rob.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "pytroll" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com <mailto:pytroll%2Bunsu...@googlegroups.com> <mailto:pytroll+u...@googlegroups.com <mailto:pytroll%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/CAEEXRXZzwdmLS9c54_-_TrUK%2BftJKYP-SpTbx-ASnhWvBxz6Aw%40mail.gmail.com <https://groups.google.com/d/msgid/pytroll/CAEEXRXZzwdmLS9c54_-_TrUK%2BftJKYP-SpTbx-ASnhWvBxz6Aw%40mail.gmail.com> <https://groups.google.com/d/msgid/pytroll/CAEEXRXZzwdmLS9c54_-_TrUK%2BftJKYP-SpTbx-ASnhWvBxz6Aw%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/pytroll/CAEEXRXZzwdmLS9c54_-_TrUK%2BftJKYP-SpTbx-ASnhWvBxz6Aw%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
Reply all
Reply to author
Forward
0 new messages