Implement the __geo_interface__ on Geography objects
See https://gist.github.com/sgillies/2217756
Of course, given this is GeoJSON-like, there might be confusion about the edges not being planar for spherely. But for general interoperability I think it would still be good to implement.
I've been looking into this and opened https://github.com/paleolimbot/s2geography/issues/56 as I think that the easiest way to support __geo_interface__ (as well as coordinate getters like in #23) is via a customizable formatter class in s2geography. We would also get support for tessellation & projection for free.
Of course, given this is GeoJSON-like, there might be confusion about the edges not being planar for spherely.
This is where it will be useful to have options like planar=True, tessellate_tol, etc. exposed globally (or via a context manager) in spherely, since AFAIK __geo_interface__ has no option.
This is where it will be useful to have options like
planar=True,tessellate_tol, etc. exposed globally (or via a context manager) in spherely, since AFAIK__geo_interface__has no option.
I am not entirely sure if I would like to have planar as a global option though .. For the explicit import/export functions, that feels like something that should always be specified at the point of import/export.
Agreed a planar global option might be dangerous. We could still expose a narrow-scoped option like geo_interface_planar=True to work around the impossibility to specify such option as export argument in this case.
bigquery's documentation mentions that for loading GeoJSON it uses something similar to planar=True and tessellate_tolerance=10.0. I haven't seen anything yet about exporting to GeoJSON, but I guess we could use similar (default) settings for the geo interface.