Coder Social home page Coder Social logo

Comments (3)

martinfleis avatar martinfleis commented on June 20, 2024

Hi, I think that dask-geopandas may help you with it.

load the entire shapefile

File IO still needs to be implemented. There's proof of a concept in #11. You can either try to write a custom code to do that in your case or try to implement fiona-based IO in dask-geopandas (following @jorisvandenbossche's example). LAtter is of course preferable :).

project to a plane area
get the centroids for each polygon
reprojet to a geodic projection

both to_crs and centroid are implemented and should work as you know them from geopandas.

keep polygons with the nearest centroids (maybe 12-16 of them)

This may be tricky. How do you do that for smaller data? Ideally, this would require spatial index on top of dask.GeoDataFrame which is not yet implemented (a bit of a discussion is in #8). Also, you will need spatially partitioned data to make this operation efficient enough (again #8).

Just out of curiosity - since you are working with a grid, wouldn't be actually easier to convert it to a raster and use something like xarray-spatial?

from dask-geopandas.

gansanay avatar gansanay commented on June 20, 2024

Thank you, I will look into these issues.

Right now I am filtering nearest centroids using
sklearn.neighbors.BallTree with geopy.distance.geodesic as a metric, which is horribly long considering I am just looking for points closer than a certain radius to my target point.

Concerning your last question... you probably know much more than I do and it's a great learning opportunity for me!

from dask-geopandas.

Zeroto521 avatar Zeroto521 commented on June 20, 2024

I'm also finding some ways to improve geopandas io performance.

Geopandas may cost too much time when reading or writing the million-level data.

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.