Giter Club home page Giter Club logo

py_geo_interface's Introduction

py_geo_interface

Latest Version Documentation ci dependency status

Exchange vector geometries between Rust and Python using pyo3 and Pythons __geo_interface__ protocol.

The __geo_interface__ protocol is implemented by most popular geospatial python modules like shapely, geojson, geopandas, ... . While this protocol also defines Features and FeatureCollections, this library so far only focuses on the Geometry type, as this one can be directly mapped to the types of the geo-types crate.

For usage examples see the documentation.

Changelog

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

py_geo_interface's People

Contributors

nmandery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

metasim

py_geo_interface's Issues

How to use with GeoPandas?

I've tried passing a GeoPandas DataFrame several different ways, but each way throws the same exception. This is basically what I'm doing.

// Rust
...
fn my_func(geo: GeoInterface) -> PyResult<()> {
  ...
  Ok(())
}
# Python
gdf: GeoDataFrame = ...

# All of these throw the same exception:
my_func(gdf)
my_func(gdf.geometry)
my_func(gdf['geometry'])
my_func(gdf.__geo_interface__)

Exception:

ValueError: Unsupported geometry type "FeatureCollection"

Any ideas on what I'm doing wrong?

Support more efficient python -> rust geometry conversion methods

When converting python geometries to geotypes it may be more efficient to check for specific methods of the object first.

For example shapely geometries could be converted to geotypes by using the wkb method when it is available. This would save the overhead of creating the nested python dicts of the geo-interface.

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.