gemgis.raster.extract_contour_lines_from_raster#

gemgis.raster.extract_contour_lines_from_raster(raster: Union[rasterio.io.DatasetReader, numpy.ndarray, str], interval: int, extent: Union[Sequence[float], None, Sequence[int]] = None, target_crs: Union[str, pyproj.crs.crs.CRS, rasterio.crs.CRS] = None) geopandas.geodataframe.GeoDataFrame#

Extracting contour lines from raster with a provided interval.

Parameters
  • raster (Union[rasterio.io.DatasetReader, np.ndarray, str]) – Raster from which contour lines are extracted

  • extent (Optional[Sequence[float, int]]) – If raster given as array: values (minx, maxx, miny, maxy) to define raster extent, e.g. extent =[0, 972, 0, 1069]

  • target_crs (Union[str, pyproj.crs.crs.CRS, rasterio.crs.CRS]) – If raster given as array: name of the CRS is required to project values to coordinates of GeoDataFrame, e.g. target_crs='EPSG:4647'

  • interval (int) – Given interval for the extracted contour lines, e.g. interval=50

Returns

gdf_lines – GeoDataFrame containing the extracted contour lines as LineStrings

Return type

gpd.GeoDataFrame

New in version 1.0.x.