intersects

Contents

intersects#

intersects(input: GeoDataFrame, other: GeoDataFrame) GeoDataFrame[source]#

Select the polygons of the input GeoDataFrame that intersects the other one and return them.

gpd.intersects algorithm applied to whole GeoDataFrames.

Parameters:
  • input (gpd.GeoDataFrame) – Input GeoDataFrame from which the polygons will be selected

  • other (gpd.GeoDataFrame) – Other GeoDataFrame from that will intersect the first one

Returns:

Polygons of the input that intersects the other GeoDataFrame

Return type:

gpd.GeoDataFrame

Example

>>> water = vectors.read("water.geojson")
>>> lakes = vectors.read("lakes.geojson")
>>> intersects(water, lakes)
                                            geometry
2  POLYGON ((490733.035 5616749.035, 490936.972 5...
3  POLYGON ((491254.800 5616242.894, 491175.035 5...