geojson
geojson copied to clipboard
map_coords should return a python-geojson object geometry object instead of dictionary
I agree! Note in ver 2.1.0:
type(geojson.utils.map_coords(some_func, some_geometry)) == <type 'dict'>
should be a geojson.geometry.
Point of clarification: "Geometry" is an abstract class and an abstract concept in the GeoJson spec. It is not an actual Type itself. So, is what we are saying here that whatever Type of object gets mapped, that same Type of object should be returned?
We just did that for the Feature Type (to address #110) so it should be straightforward to extend it to the other Types.
I think the suggestion is to return one of the classes Point
, LineString
, ... so concrete classes. The return type of the function should be Geometry
, if I'm not mistaken. Maybe we should have a separate new function, to_geometry
.
Related to this request, it would be nice to have a standalone function to check if a Mapping containing type
and coordinates
is indeed a valid GeoJSON. For this I think I'll open a new issue.