geopandas / dask-geopandas

Parallel GeoPandas with Dask
https://dask-geopandas.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
486 stars 45 forks source link

Remove dask anti-pattern example on README and docs #263

Open codeananda opened 7 months ago

codeananda commented 7 months ago

The first example people see when reading about dask-geopandas is actually an anti-pattern that dask encourage us not to use.

Anti-pattern (loading outside of dask then transferring to dask)

import geopandas
import dask_geopandas

df = geopandas.read_file('...')
ddf = dask_geopandas.from_geopandas(df, npartitions=4)

It would be better to include an example that loads a file using dask-geopandas e.g.

import dask_geopandas
ddf = dask_geopandas.read_file("file.gpkg", npartitions=4)

Also, users are likely to come to dask-geopandas because they cannot load data using geopandas (it is too large). So, this also makes the first (and only) example on the README unhelpful.

martinfleis commented 7 months ago

This comes from era when read_file was not implemented and nearly only way of getting dask_geopandas object was from a geopandas object.

PR is welcome!