'AttributeError: module 'geopandas' has no attribute 'sjoin_nearest'
I am trying to run below statement in databricks notebook but I am getting error as " AttributeError: module 'geopandas' has no attribute 'sjoin_nearest'"
Is there anyone who can help me to resolve this?
final_gdf = gpd.sjoin_nearest(gdf1, gdf2, how = 'inner',lsuffix= 'left', rsuffix = 'right')
Solution 1:[1]
sjoin_nearest is a feature available from GeoPandas >= 0.10.
Try to upgrade:
[...]$ pip install -U geopandas
# Or
[...]$ conda update geopandas
Read the Changelog
A new sjoin_nearest() method to join based on proximity, with the ability to set a maximum search radius (#1865). In addition, the sindex attribute gained a new method for a “nearest” spatial index query (#1865, #2053).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Corralien |
