Git Product home page Git Product logo

Comments (4)

jorisvandenbossche avatar jorisvandenbossche commented on September 26, 2024

Do you have a reproducible example? Or can you show the stacktrace if you turn the warning into an error?

I don't see anything with this simple example (using master of all):

import geopandas
import dask.dataframe as dd

df = geopandas.read_file(geopandas.datasets.get_path("naturalearth_lowres")).to_crs("EPSG:3857")
ddf = dask_geopandas.from_geopandas(df, npartitions=4)

ddf['area'] = ddf.geometry.area

from dask-geopandas.

martinfleis avatar martinfleis commented on September 26, 2024

I missed one important line, sorry. It happens with renamed geometry column.

import geopandas
import dask_geopandas

df = geopandas.read_file(geopandas.datasets.get_path("naturalearth_lowres")).to_crs("EPSG:3857")
df = df.rename_geometry('geom')
ddf = dask_geopandas.from_geopandas(df, npartitions=4)

ddf['area'] = ddf.geometry.area

Thinking about it now, we may have to fix that in GeoPandas, because you can reproduce it without dask as

df = geopandas.read_file(geopandas.datasets.get_path("naturalearth_lowres"))
df = df.rename_geometry('geom')
geopandas.GeoDataFrame(df, crs=4326)

With geometry column geometry this is either silent if you pass the same CRS or warns about CRS mismatch if you pass different one. With a different name, it does not see existing geometry in the first place. Even geopandas.GeoDataFrame(df).geometry breaks if you rename the column before.

from dask-geopandas.

jorisvandenbossche avatar jorisvandenbossche commented on September 26, 2024

Ah, yes, that seems indeed something to solve in geopandas (or at least the pure geopandas snippet should also not warn I think?)

from dask-geopandas.

martinfleis avatar martinfleis commented on September 26, 2024

Yeah, in the creation of GeoDataFrame from another GeoDataFrame we should capture that and pass metadata (geometry column, maybe crs for now) to a new one. I'll move this issue to geopandas repo.

from dask-geopandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.