coincident.io.xarray.load_usgs_dem#

coincident.io.xarray.load_usgs_dem(aoi, project, tnmdataset='Digital Elevation Model (DEM) 1 meter', res=1, clip=True)#

Load and merge USGS 1-meter DEM tiles based on an AOI by querying the TNM API.

Steps:
  1. Reproject the AOI to EPSG:4326.

  2. Extract the first geometry from the exploded AOI (to match the geometry type used in search.search).

  3. Convert the geometry to a polygon string using a private helper.

  4. Query the TNM API via the moved function in coincident.search.wesm.

  5. Filter the API items using a private helper.

  6. Load and optionally coarsen each GeoTIFF tile.

  7. Merge the DEM tiles and optionally clip the mosaic to the AOI.

Parameters:
  • aoi (gpd.GeoDataFrame) – Area of interest geometry to query against

  • project (str) – Project identifier to filter results

  • tnmdataset (str) – TNM dataset identifier (default “Digital Elevation Model (DEM) 1 meter”)

  • res (int) – Resolution factor to coarsen DEM by (default 1)

  • clip (bool) – Whether to clip final mosaic to AOI (default True)

Returns:

The merged (and optionally clipped) DEM mosaic.

Return type:

xr.DataArray