cryoswath.gis module#

Geospatial helper functions used throughout CryoSwath workflows.

cryoswath.gis.buffer_4326_shp(shp, radius, simplify=True)[source]#

Buffer lon/lat geometries by radius meters.

The geometry is temporarily projected to a locally suitable planar CRS, buffered there, and transformed back to EPSG:4326.

Parameters:
  • shp (Geometry)

  • radius (float)

  • simplify (bool)

Return type:

MultiPolygon

cryoswath.gis.ensure_pyproj_crs(crs)[source]#

Return a pyproj.crs.CRS instance for crs.

Parameters:

crs (CRS)

Return type:

CRS

cryoswath.gis.esri_to_feather(file_path=None)[source]#

Convert a vector file readable by GeoPandas to Feather format.

Parameters:

file_path (str)

Return type:

None

cryoswath.gis.find_planar_crs(*, shp=None, lat=None, lon=None, region_id=None)[source]#

Choose a planar CRS for a geometry or coordinate set.

Parameters:
  • shp (Geometry)

  • lat (float)

  • lon (float)

  • region_id (str)

cryoswath.gis.get_4326_to_dem_Transformer(crs)[source]#

Build a transformer from EPSG:4326 to the provided CRS.

Parameters:

crs (int | CRS)

Return type:

Transformer

cryoswath.gis.get_lon_origin(crs)[source]#

Return longitude of origin for a projected CRS.

cryoswath.gis.points_on_glacier(points)[source]#

Return index positions of points located on buffered glacier area.

Parameters:

points (GeoSeries)

Return type:

Index

cryoswath.gis.simplify_4326_shp(shp, tolerance=None)[source]#

Simplify a lon/lat geometry using a locally projected CRS.

Parameters:
  • shp (Geometry)

  • tolerance (float)

Return type:

Geometry

cryoswath.gis.subdivide_region(basin_gdf, lat_bin_width_degree=1, lon_bin_width_degree=1)[source]#

Devides GeoDataFrame of basins into smaller GeoDataFrame based on their central lat/lon coords.

Parameters:
  • basin_gdf (gpd.GeoDataFrame, optional) – Basins to subdivide.

  • lat_bin_width_degree (float, optional) – Requested sub-region latitude range in degrees. Defaults to 1.

  • lon_bin_width_degree (float, optional) – Requested sub-region longitude range in degrees.. Defaults to 1.

Returns:

List of region parts.

Return type:

list[gpd.GeoDataFrame]