I am trying a nearest neighbor spatial join with two point Geodataframes but a warning message is appearing.
My code:
import geopandas as gpd
yield_2013=gpd.read_file('https://github.com/kevinkuranyi/archive/raw/main/Brazil_Maize_yield_2013.shp')
temperature=gpd.read_file('https://github.com/kevinkuranyi/archive/raw/main/Temperature_2013.shp')
print(yield_2013.crs)
print(temperature.crs)
df=yield_2013.sjoin_nearest(temperature)
The following warning message is shown:
UserWarning: Geometry is in a geographic CRS. Results from 'sjoin_nearest' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.
When I print both CRS the result is the same: EPSG:4674
. If I follow the warning message instructions and do:
df=yield_2013.to_crs(epsg=4674).sjoin_nearest(temperature.to_crs(epsg=4674))
The same warning message appears. I manually checked a dozen of points from the resulting file and it seems to be ok, but I have thousands of points and this message (likely incorrect) is making me afraid.
Am I doing the spatial join in the wright way?