Open 1jiangxd opened 7 months ago
@1jiangxd apologies for the slow reply, but looking at your code, the following lines
# Add attributes from 'bianjie' to 'outwen'
joined = joined.drop(columns='index_right') # Remove redundant index column
result = target_gdfnew.merge(joined, how='left', on=target_gdfnew.columns.to_list())
are typically not needed. The result of the spatial join, joined
, already has the columns of the original target_gdf
, so this additional merge is not doing anything, except for getting back the original rows of target_gdf
that didn't have a match in the spatial join. To achieve the same, you do a left join (specifying how='left' in the
sjoin` call).
Also, I assume that the gpd.sjoin
in your code above should be dask_geopandas.sjoin
?
Can someone answer why the number and x columns of '201105. shp' in the output of this code also become 0?
(Two shp files have been uploaded to my GitHub repository) https://github.com/1jiangxd/daskgeopandasproblems
The code I used is as follows, but when checking proceed '201105. shp', only the first 2 million lines were processed, and the remaining other original content changed into 0 May I ask where the problem lies with this code? If anyone can answer, I would greatly appreciate your help