Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map_coords should return a python-geojson object geometry object instead of dictionary #42

Open
frewsxcv opened this issue Sep 30, 2014 · 3 comments

Comments

@frewsxcv
Copy link
Collaborator

No description provided.

@dharasty
Copy link

dharasty commented Apr 23, 2018

I agree! Note in ver 2.1.0:

type(geojson.utils.map_coords(some_func, some_geometry)) == <type 'dict'>

should be a geojson.geometry.

@rayrrr
Copy link
Member

rayrrr commented Jul 14, 2019

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.

@stefano-xy
Copy link

stefano-xy commented Sep 17, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants