vyperdatum.utils.spatial_utils

Attributes

logger

Functions

get_grid_list(vdatum_directory)

Return all gtx files in the vdatum directory.

get_region_polygons(→ dict)

overlapping_regions(→ list[str])

Return the region names that intersect with the provided bound.

overlapping_extents(→ Union[Optional[list], ...)

Return database predefined extents that intersect with an area of interest.

Module Contents

vyperdatum.utils.spatial_utils.logger
vyperdatum.utils.spatial_utils.get_grid_list(vdatum_directory: str)

Return all gtx files in the vdatum directory.

Parameters:

vdatum_directory – absolute folder path to the vdatum directory

Returns:

  • dict – dictionary of {grid name: grid path, …}

  • list – list of vdatum regions

vyperdatum.utils.spatial_utils.get_region_polygons(datums_directory: str, extension: str = 'kml') dict

” Search the datums directory to find all geometry files. All datums are assumed to reside in a subfolder.

Parameters:
  • datums_directory (str) – absolute folder path to the vdatum directory

  • extension (str) – the geometry file extension to search for

Returns:

dictionary of {kml name: kml path, …}

Return type:

dict

vyperdatum.utils.spatial_utils.overlapping_regions(datums_directory: str, lon_min: float, lat_min: float, lon_max: float, lat_max: float) list[str]

Return the region names that intersect with the provided bound. The input coordinate reference system is expected to be NAD83(2011) geographic.

Parameters:
  • lon_min – the minimum longitude of the area of interest

  • lat_min – the minimum latitude of the area of interest

  • lon_max – the maximum longitude of the area of interest

  • lat_max – the maximum latitude of the area of interest

Return type:

list[str]

vyperdatum.utils.spatial_utils.overlapping_extents(lon_min: float, lat_min: float, lon_max: float, lat_max: float) list | None | pandas.DataFrame | None

Return database predefined extents that intersect with an area of interest. The results are sorted by coverage ratios.

Parameters:
  • lon_min – the minimum longitude of the area of interest

  • lat_min – the minimum latitude of the area of interest

  • lon_max – the maximum longitude of the area of interest

  • lat_max – the maximum latitude of the area of interest