nldi_xstool packages

nldi_xstool.nldi_xstool module

Main module.

nldi_xstool.nldi_xstool.getxsatendpts(path, numpts, crs='epsg:4326', file=None, res=10)[source]

Get cross-section at user defined endpoints.

Note 1:

Cross-section is interpolated using 3DEP elevation services which does not include bathymetric data.

Note 2:

The parameter res specifices the spatial resolution of the 3DEP data that is interpolated to return elevation values of the cross-section points. It does not specify the native spatial resolution of the 3DEP data. If using this as a package the query_dems function in nldi-xstool.ancillary can be used to discover the available native resolution of the 3DEP data at the bounding box of the cross-section.

Parameters:
  • path (List[Tuple[float, float]]) – List of tuples containing coordinate pairs of the end-points in order from river-left to river-right, for example: [(x1,y1), (x2,y2)]

  • numpts (int) – Number of points to interpolate along path.

  • crs (Optional[str]) – crs of input data. Defaults to EPSG:4326.

  • file (Optional[str]) – path/to/file.json. Path to write json file. Defaults to None and returns a GeoDataFrame.

  • res (float) – Spatial resolution of 3DEP Dem data. Defaults to 10 which is available throughout CONUS.

Returns:

cross-section in a GeoDataFrame.

Return type:

gpd.GeoDataFrame

nldi_xstool.nldi_xstool.getxsatpathpts(path, numpts, crs='epsg:4326', file=None, res=10)[source]

Get elevation cross-section at user-defined path.

Note 1:

Cross-section is interpolated using 3DEP elevation services which does not include bathymetric data.

Note 2:

The parameter res specifices the spatial resolution of the 3DEP data that is interpolated to return elevation values of the cross-section points. It does not specify the native spatial resolution of the 3DEP data. If using this as a package the query_dems function in nldi-xstool.ancillary can be used to discover the available native resolution of the 3DEP data at the bounding box of the cross-section.

Parameters:
  • path (List[Tuple[float, float]]) – List of tuples containing coordinate pairs of the path, for example: [(x1,y1), (x2,y2), (x3, y3)]

  • numpts (int) – Number of points to interpolate along path.

  • crs (Optional[str]) – crs of input data. Defaults to ALT_CRS.

  • file (Optional[str]) – path/to/file.json. Path to write json file. Defaults to None and returns a GeoDataFrame.

  • res (float) – Spatial resolution of 3DEP Dem data. Defaults to 10 which is available throughout CONUS.

Returns:

cross-section in a GeoDataFrame.

Return type:

gpd.GeoDataFrame

nldi_xstool.nldi_xstool.getxsatpoint(point, numpoints, width, file=None, res=10)[source]

Get cross-section at nearest stream-segment and closest intersecton to point.

Function uses the U.S. Geological Survey’s NLDI to find the nearest NHD stream- segment, and generate a cross-section perpendicular to the nearest intersection of the point and stream-segment.

Note 1:

Cross-section is interpolated using 3DEP elevation services which does not include bathymetric data.

Note 2:

The parameter res specifices the spatial resolution of the 3DEP data that is interpolated to return elevation values of the cross-section points. It does not specify the native spatial resolution of the 3DEP data. If using this as a package the query_dems function in nldi-xstool.ancillary can be used to discover the available native resolution of the 3DEP data at the bounding box of the cross-section.

Parameters:
  • point (Tuple[float, float]) – Lon/lat coordinate pair (x, y).

  • numpoints (int) – Number of points in the cross-section.

  • width (float) – Width of the cross-section in meters.

  • file (Optional[str]) – Path to write JSON output. Defaults to None.

  • res (float) – Spatial resolution of 3DEP DEM data. Defaults to 10.

Returns:

Cross-section in a GeoDataFrame.

Return type:

gpd.GeoDataFrame

nldi_xstool.ancillary module

Ancilarry.

nldi_xstool.ancillary.get_ext_bathy_xs(file, dist, lonstr, latstr, estr, acrs)[source]

Extend a measured bathymetric cross-section to above water topography.

Parameters:
  • file (str) – Bathymetric survey file.

  • dist (float) – Distance to extend survey on both ends.

  • lonstr (str) – String heading on longitude in file.

  • latstr (str) – String heading on latitude in file.

  • estr (str) – String heading on elevation in file.

  • acrs (str) – CRS code of measured lon/lat values, for example: epsg:4326.

Returns:

Geopandas dataframe of complete cross-section.

Return type:

gpd.GeoDataFrame

nldi_xstool.ancillary.query_dems_bbox(bbox)[source]

Query 3DEP Elevation Index for available spatial resolution.

Uses esriSpatialRelIntersects - Query Geometry Intersects Target Geometry.

Parameters:

bbox (Tuple[float, float, float, float]) – (minx, miny, maxx, maxy).

Returns:

Boolean values associated with resolution keys.

Return type:

dict

nldi_xstool.ExtADCPBathy module

Tools for extending USGS measured Bathymetry (preliminary).

class nldi_xstool.ExtADCPBathy.ExtADCPBathy(file, dist, lonstr, latstr, estr, acrs)[source]

Bases: object

Class to facilitate extending USGS measured bathymetry cross-sections.

Parameters:
  • file (str)

  • dist (float)

  • lonstr (str)

  • latstr (str)

  • estr (str)

  • acrs (str)

get_xs_complete()[source]

Return extended cross-section.

Returns:

GeoDataFrame with extended cross-section and spatial reference information.

Return type:

GeoDataFrame