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:
Reproject the AOI to EPSG:4326.
Extract the first geometry from the exploded AOI (to match the geometry type used in search.search).
Convert the geometry to a polygon string using a private helper.
Query the TNM API via the moved function in coincident.search.wesm.
Filter the API items using a private helper.
Load and optionally coarsen each GeoTIFF tile.
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