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

Add support for vector (gdal) geometries #3208

Closed
geohardtke opened this issue Apr 22, 2022 · 6 comments
Closed

Add support for vector (gdal) geometries #3208

geohardtke opened this issue Apr 22, 2022 · 6 comments

Comments

@geohardtke
Copy link

geohardtke commented Apr 22, 2022

Hi there,
Would be nice to have the ability to create Series of Geometry types, and then build functionality similar to geopandas (which I miss in rust) like opening a geopackage or shape file as a DataFrame.

For example:

use gdal::{vector};
use polars::series::Series;
use polars::prelude::NamedFrom;


fn main() {
    let mut geoms: Vec<vector::Geometry> = Vec::new();
    let mut geoms = vector::Geometry::empty(vector::OGRwkbGeometryType::wkbPoint).unwrap();
    geoms.add_point((0., 0., 0.));
    geoms.add_point((0., 1.,1.));
    let s = Series::new("geometry", geoms);
}

which of course returns:

 --> src/main.rs:10:17
  |
10 |         let s = Series::new("geometry", geoms);
  |                 ^^^^^^^^^^^ the trait `NamedFrom<Geometry, _>` is not implemented for `Series`
  |

If there is some interest in having this functionality added, I'm willing to (with a bit of help) try to implement it.

Cheers

@program--
Copy link

program-- commented Apr 28, 2022

To add to this, it should be easier to add support for this once the GeoArrow format specification is stable (and similarly, OGC's GeoParquet specification. Both will inherently add GDAL support). This would be great to have!

@nmandery
Copy link
Contributor

There also has been some related previous discussion in #1830

@kylebarron
Copy link
Contributor

Should we close this to keep discussion in #1830?

@zundertj
Copy link
Collaborator

Closing; the discussion can continue in #1830.

@phayes
Copy link

phayes commented Jan 12, 2023

@geohardtke , I've implemented a GDAL <-> Polars connector cate: https://github.com/phayes/polars_gdal

@geohardtke
Copy link
Author

brilliant work! I'll check it out @phayes

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

No branches or pull requests

6 participants