adonmo / meos

Mobility Engine, Open Source
https://adonmo.github.io/meos/
MIT License
21 stars 3 forks source link

Interop with Shapely #8

Open chaitan94 opened 4 years ago

chaitan94 commented 4 years ago

Right now when we are returning point data, we return a custom Geometry class. But when it comes to Python ecosystem, it would be great if we can return this data as Shapely objects. This would make the library play nicely with lots of other geospatial processing tools. Although I haven't looked into it how this can be achieved yet - but since pybind11 allows access to external python libraries, I think this should be possible.

chaitan94 commented 3 years ago

I have pushed a rudimentary effort of integrating with Shapely in PyMEOS in the shapely branch. Basically by introducing a pybind11 custom type caster to map from GeomPoint to shapely.geometry.point.Point. However, in the current state, it suffers from two major issues:

  1. Shapely's Point objects are not hashable, and hence we can't use it in many classes like InstantSet
  2. Shapely's Point objects do not support attaching SRID information