coincident.io.download.build_usgs_ept_pipeline#

coincident.io.download.build_usgs_ept_pipeline(aoi, workunit=None, output_dir=None)#

Finds the relevant USGS 3DEP EPT dataset for an AOI and returns a dictionary structured as a PDAL pipeline JSON to subset the data based on the AOI, without downloading point data.

The returned pipeline includes an ‘readers.ept’ stage and a ‘filters.crop’ stage configured with the EPT URL, the AOI’s bounds, and polygon WKT, all in the EPT’s spatial reference system (SRS). Users can add their custom parameters (like writers and additional filters) to this pipeline before executing it with PDAL.

Parameters:
  • aoi (gpd.GeoDataFrame) – Area of interest (can be in any CRS).

  • workunit (Optional[str]) – The specific 3DEP workunit name from coincident.search.search(dataset=”3dep”) (e.g., ‘CO_CentralEasternPlains_1_2020’). If None, the function will attempt to find a workunit intersecting the AOI using the USGS resources GeoJSON.

  • output_dir (Optional[str]) – Directory to write out the generated PDAL pipeline JSON file. If None, no file is written.

Returns:

A dictionary representing the base PDAL pipeline JSON for subsetting.

Return type:

dict

Raises:
  • ValueError – If the AOI geometry is not a Polygon/MultiPolygon, or if no matching 3DEP workunit is found for the given AOI.

  • requests.exceptions.RequestException – If there’s an issue fetching the EPT metadata.

  • RuntimeError – If essential data like SRS WKT is missing/cannot be parsed, or if the resources GeoJSON cannot be read.