-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
ENH: Add from_wkt
and from_wkb
tools
#293
ENH: Add from_wkt
and from_wkb
tools
#293
Conversation
c5fc899
to
f36271d
Compare
@giorgiobasile Thanks for the PR! One question we have to think about is the exact API: do we want to do this at the dataframe level, or at the (geo)series level? Right now you added a function that takes a dataframe and returns a GeoSeries. But if it returns a GeoSeries, we could also let it accept a Series (and the user can do the column selection themselves). Or otherwise let it accept and return a (Geo)DataFrame. |
Thanks @jorisvandenbossche for your remarks!
Yes, the reason I sticked with the gdf = dask_geopandas.from_dask_dataframe(
ddf, geometry=dask_geopandas.from_wkt(ddf, geometry_wkt='wkt', crs="EPSG:4326")
) Just double checking I'm getting what you are suggesting:
So this would change to allow for something like: gdf = dask_geopandas.from_dask_dataframe(
ddf, geometry=dask_geopandas.from_wkt(ddf["wkt"], crs="EPSG:4326")
)
In this case the user would have a unified API, like: gdf = dask_geopandas.from_wkt(ddf, geometry_wkt='wkt', crs="EPSG:4326") Does this all make sense? Also, If we go for any of the latter two cases, should the interface be applied to |
Apologies for the slow follow-up!
Yes, that's a good point.
I think this feels the most natural API to me / most consistent with how it works in geopandas. |
f36271d
to
a629de2
Compare
a629de2
to
6aa054c
Compare
No problem!
Ok sure, I just updated it accordingly. |
from_wkt
and from_wkb
tools from_wkt
and from_wkb
tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update, looks good!
Thanks @giorgiobasile! |
@jorisvandenbossche thank you for your suggestions! |
Implements
dask_geopandas.from_wkt
anddask_geopandas.from_wkb
, taking inspiration fromdask_geopandas.points_from_xy
.Closes #208