jazzband / geojson

Python bindings and utilities for GeoJSON
https://pypi.python.org/pypi/geojson/
BSD 3-Clause "New" or "Revised" License
905 stars 120 forks source link

Additional functional maps for GeoJSON entities #109

Closed jlaxson closed 6 years ago

jlaxson commented 6 years ago

The documentation for map_coords hints that it should be usable for coordinate transforms and the like, but the actual implementation only calls with individual values. So rather than

Point(x, y, z) => func(Point(x, y, z))

You get

Point(x, y, z) => Point(func(x), func(y), func(z))

In my experience, this isn't a very useful transform. This PR adds map_tuples (rather than map_coords to preserve compatibility) for the former use case, and map_geometries for use cases like doing a spatial intersection.

frewsxcv commented 6 years ago

looks good to me, but any chance you could fix the flake8 issues that travis ci found?

notriddle commented 6 years ago

Close this now that #112 is merged, right?