osmcode / pyosmium

Python bindings for libosmium
https://osmcode.org/pyosmium
BSD 2-Clause "Simplified" License
314 stars 64 forks source link

Python __geo_interface__ support #11

Closed MennoTammens closed 3 weeks ago

MennoTammens commented 8 years ago

__geo_interface__ is a protocol for Python libraries to exchange geospatial data (A Python Protocol for Geospatial Data). The data is put in standard Python objects (dict,list,tuple,float) in a GeoJSON-like fashion. It would be nice if pyosmium woud support this interface.

Geo Interface is already supported by a lot of other Python modules: Shapely, Fiona, ArcPy, descartes, geojson, PySAL, pyshp

Implementing this interface means adding a function __geo_interface__() to a number of classes in osmium.osm: Node, Way and Area, maybe also to Location, Box, NodeRef or NodeRefList. Probabily something like GeoJSONFactory, but with boost::python::dict, boost::python::list, etc. instead of std::string

joto commented 8 years ago

This sounds like a useful addition. Maybe somebody who needs this themselves wants to give it a try?

lonvia commented 3 weeks ago

Implemented in #262.