geopandas.sjoin

geopandas.sjoin(left_df, right_df, how='inner', op='intersects', lsuffix='left', rsuffix='right')

Spatial join of two GeoDataFrames.

Parameters
left_df, right_dfGeoDataFrames
howstring, default ‘inner’

The type of join:

  • ‘left’: use keys from left_df; retain only left_df geometry column

  • ‘right’: use keys from right_df; retain only right_df geometry column

  • ‘inner’: use intersection of keys from both dfs; retain only left_df geometry column

opstring, default ‘intersects’

Binary predicate, one of {‘intersects’, ‘contains’, ‘within’}. See http://shapely.readthedocs.io/en/latest/manual.html#binary-predicates.

lsuffixstring, default ‘left’

Suffix to apply to overlapping column names (left GeoDataFrame).

rsuffixstring, default ‘right’

Suffix to apply to overlapping column names (right GeoDataFrame).