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

Should GeoVector have a method to convert to/from a GeoJSON string? #113

Open
astrojuanlu opened this issue Aug 9, 2018 · 1 comment
Open

Comments

@astrojuanlu
Copy link
Contributor

It's very tempting to do

from shapely.geometry import mapping

str(mapping(gv))  # Wrong!

but this won't work because of https://gist.github.com/sgillies/2217756#gistcomment-1397048. Instead, the correct code is

import geojson

geojson.dumps(gv)  # Correct!

It's a very simple function call, but we still could add it as a method.

@guydou
Copy link
Contributor

guydou commented Aug 13, 2018

I think that we don't need to add a method, otherwise we will need to add method to serialize gv to many formats, no?

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

2 participants