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
Bring SRID in from_postgis() #451
Comments
I'd like to second this. In my workflows, I tend to have a
The |
Yeah, I ran into this last November, with the current release. Note that you can be pre-emptive and pass the seas = GeoDataFrame.from_postgis("select * from world_seas", conn,
geom_col='geometry', crs={'init': 'epsg:4326'},
coerce_float=False) But that's also fragile. It would also be nice if geopandas could guess the I may be able to look into this and provide a PR over the next month or so, specially for the crs/SRID part, and specially if I can get some pointers from the developers. So far I see the relevant code ( |
This need was noted as far back as August 2014, in #161; linking here to that issue b/c there are additional details and discussions there that may be helpful when trying to add this capability. |
Closed by #627. |
I have a geometry in postgis and query it with
df = gpd.GeoDataFrame.from_postgis()
. I then want to usedf.to_crs()
, butdf
doesn't seem to have a crs already, so it saysValueError: Cannot transform naive geometries. Please set a crs on the object first.
I can set
df.crs = ...
, but that seems fragile. Is it possible to make geopandas get thesrid
from postgis when it makes the query, and automatically set the crs?The text was updated successfully, but these errors were encountered: