hydromt.gis_utils.nearest#

hydromt.gis_utils.nearest(gdf1: GeoDataFrame, gdf2: GeoDataFrame) Tuple[ndarray, ndarray][source]#

Return the index of and distance [m] to the nearest geometry.

For Line geometries in gdf1 the nearest geometry is based line center point and for polygons on its representative point. Mixed geometry types are not yet supported.

Note: Since geopandas v0.10.0 it contains a sjoin_nearest method which is very similar and should.

Parameters:
Returns:

  • index (ndarray) – index of nearest gdf2 geometry

  • dst (ndarray of float) – distance to the nearest gdf2 geometry