Giter VIP home page Giter VIP logo

Comments (5)

martinfleis avatar martinfleis commented on September 20, 2024

Two questions here:

  1. what happens with bounds? Does it also read all columns?
  2. what happens with unary_union? That uses a very similar implementation based on reduction.

from dask-geopandas.

jorisvandenbossche avatar jorisvandenbossche commented on September 20, 2024

bounds and unary_union both correctly read only the geometry column (if doing gdf.geometry.bounds/unary_union of course). So not really sure what's special about total_bounds.
One difference is that it returns an array instead of series/dataframe.

from dask-geopandas.

jorisvandenbossche avatar jorisvandenbossche commented on September 20, 2024

See dask/dask#7885 for an analysis of the issue. The way to solve it (with current dask at least) is to return a Series/DataFrame object instead of an array.

I was first thinking that might be a too big of a change for total_bounds if we want to keep it consistent with the geopandas version. But, actually a Series of 4 elements might be compatible enough for most use cases. For example the typical unpacking (xmin, ymin, xmax, ymax = gdf.total_bounds) or plain indexing (gdf.total_bounds[0]) should both still work with a Series as well.

from dask-geopandas.

martinfleis avatar martinfleis commented on September 20, 2024

Can we keep this open for some time to see how dask/dask#7885 evolves?

A Series would be okay but to have it compatible in the way you mention gdf.total_bounds[0] it needs to have a range index while it would make more sense to have an index as ['minx', 'miny', 'maxx', 'maxy'].

So I propose to wait a bit and make a decision on this before the actual 0.1. release.

from dask-geopandas.

jorisvandenbossche avatar jorisvandenbossche commented on September 20, 2024

A Series would be okay but to have it compatible in the way you mention gdf.total_bounds[0] it needs to have a range index while it would make more sense to have an index as ['minx', 'miny', 'maxx', 'maxy'].

A Series with index values ['minx', 'miny', 'maxx', 'maxy'] would actually work for this, because in case of a non-numeric index, indexing with integers like that falls back to positional indexing.

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.