Skip to content
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

Initial attempt to get dask-geopandas working. #14

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

alxmrs
Copy link
Owner

@alxmrs alxmrs commented Jun 24, 2024

No description provided.

@giswqs
Copy link
Contributor

giswqs commented Jun 24, 2024

Found a relevant issue: geopandas/dask-geopandas#197
Still investigating.

@giswqs
Copy link
Contributor

giswqs commented Jun 24, 2024

Here is a snippet for convert a dask dataframe to dask geodataframe. We need to more generic way for converting other geometry types besides points.

import dask.dataframe as dd
import dask_geopandas as dgpd


# load some data
ddf = dd.read_csv(
    "https://github.com/opengeos/datasets/releases/download/world/world_cities.csv",
)

# subset for faster iteration
ddf = ddf.partitions[0:5]

# convert to dask geodataframe
# Assign the geometry column using vanilla Dask
ddf = ddf.assign(geometry=dgpd.points_from_xy(ddf, "longitude", "latitude"))
# Refer to the geometry column by name
dgdf = dgpd.from_dask_dataframe(ddf, geometry="geometry")
dgdf.crs = "EPSG:4326"
dgdf.head()
dgdf.compute().explore()

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants