Spatial & Regions#
fetchez.spatial#
Lightweight spatial utilities for parsing region strings and files into standard bounding boxes. Adaptded from CUDEM.
- copyright:
2012 - 2026 CIRES Coastal DEM Team
- license:
MIT, see LICENSE for more details.
- class fetchez.spatial.Region(w=None, e=None, s=None, n=None, srs=None)[source]#
Bases:
objectA geospatial bounding box object.
Behaves like a tuple (xmin, xmax, ymin, ymax) for backward compatibility, but provides methods for manipulation and format conversion.
- property w#
- property e#
- property s#
- property n#
- property width#
- property height#
- fetchez.spatial.region_from_place(query, centered=True)[source]#
Resolve ‘loc:PlaceName’ to a bounding box.
- fetchez.spatial.parse_region(input_r)[source]#
Main function to parse region input into a list of Region objects.
- fetchez.spatial.fix_argparse_region(raw_argv)[source]#
Argument Pre-processing for negative coordinates.
- fetchez.spatial.region_to_shapely(region)[source]#
Convert a fetchez region (xmin, xmax, ymin, ymax) to a shapely box.
fetchez regions are like GMT: (west, east, south, north) while shapely regions are not: (minx, miny, maxx, maxy)
- fetchez.spatial.region_to_wkt(region)[source]#
Convert a fetchez region (xmin, xmax, ymin, ymax) to WKT (via shapely)
- fetchez.spatial.region_from_list(r_list)#
- fetchez.spatial.region_from_string(r_str)#