-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Change input from deprecated data.to_crs(epsg=4326) to data.to_crs('E… #1251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change input from deprecated data.to_crs(epsg=4326) to data.to_crs('E… #1251
Conversation
Thanks for your PR, your description and change look good. I’ll test it out next time I’m working on folium and merge if nothing comes up, which I suspect not. |
ok, thanks :) |
Your change is fine, but unfortunately we still get a futurewarning because of other libraries. Do you have an idea how we could deal with that? I was thinking of maybe surpressing it at that location. A futurewarning should be read by end-users, and since there is nothing here to do for them I don't like to give them false warnings. |
Could you please elaborate on the warnings you have, what other libraries trigger them, in particular? My FutureWarning was raised by the |
Changing the syntax is indeed a good idea, but I still get the warning:
It seems because the current crs of the df still uses the old syntax. In the Stackoverflow post you linked to they suggest setting the current crs by hand. We could do that programmatically:
What do you think, good idea? Is this robust? |
Yeah, this looks robust to me. Old syntax pops out, when you read from GeoJSON file, so checking it programmatically is a good idea. Just to be clear, there are two cases, in which the FutureWarning is triggered. The first one is when you set |
You’re right, there are indeed two warnings. Do you want to update your PR to address both? |
I've also noticed, that guys from |
This reverts commit 7dff5aa.
Hi Artem, good to hear the Geopandas people fixed it upstream. I checked and indeed no warnings are raised anymore. But I agree it would be good to use the I reverted your second commit, since Geopandas no longer uses the After the tests passed I'll merge this PR. Thanks for your help in investigating and resolving this! |
Notebooks test failures are unrelated and will be addressed separately. |
Wow, great! glad to help! |
The
process_data
method of thefolium.GeoJson
class is using a now deprecated input syntax for re-projecting indata.to_crs(epsg=4326)
. This triggers aFutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method.
in thepyproj/crs.py
module. The actual reformatting to '+init=...' syntax is done by thegeopandas/geoseries.py
module, because the old syntax doesn't provide crs as input, only epsg. Warning can be silenced by changing the syntax todata.to_crs("EPSG=4326")
. Discussion of this problem on stackoverflow is here.