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

Fixed readme documentation #5

Closed
wants to merge 3 commits into from
Closed

Conversation

alexlouden
Copy link

Updated from text description to markdown

@sgillies
Copy link
Collaborator

sgillies commented Apr 2, 2013

First, the geojson package is no longer in development. Second, I'm -1 on Markdown because PyPI prefers RestructuredText. This pull request also breaks setup.py.

Are you using geojson in production anywhere? Does it do anything for you that Python's json doesn't?

@alexlouden
Copy link
Author

Hi Sean,

I was under the impression that geojson was the recommended method of JSON serialising Shapely geometries. (From your blog - http://sgillies.net/blog/478/shapely-geometries-for-python/)

I've used it in a prototype, but not in production yet. I'm happy to fix setup.py (oops, sorry!), and use .rst instead. I could also set up Travis CI for unit testing to ensure future pull requests don't break anything else.

Thanks for your response and for Shapely, deacartes and geojson - these packages have saved me a great deal of time!

@sgillies
Copy link
Collaborator

sgillies commented Apr 3, 2013

Today, I think the best way to serialize Shapely geometries is this:

>>> import json
>>> from shapely.geometry import Point, shape, mapping
>>> pt1 = Point(-105, 40)
>>> pt2 = shape(json.loads(json.dumps(mapping(pt))))
>>> pt1.equals(pt2)
True

mapping() makes a mapping from a geometry and shape() makes a geometry from a mapping. Sort of like dumps and loads.

The geojson package was originally designed to be a reference implementation of the GeoJSON format. It took on a life of its own for a while, but is mostly obsolete now.

@alexlouden
Copy link
Author

Ah okay, I'll use mapping() instead. If it's obsolete may I suggest that a note is added to the documentation?

Cheers!

@alexlouden
Copy link
Author

I ended up creating a custom JSONEncoder and Decoder, so that I could use Shapely geometries in a larger data structure - see https://gist.github.com/alexlouden/5385305#file-shapely_json-py

@frewsxcv
Copy link
Collaborator

Is there any reason why this library should cease to exist even if Shapely exists? I like the simplicity of this library and can offer to contribute in improving the documentation

@sgillies
Copy link
Collaborator

sgillies commented Jul 3, 2013

@frewsxcv I'm going to close this particular issue, but please do send another for documentation fixes and then we should talk about making you a maintainer, because this package will need a new one if it's to live on.

@sgillies sgillies closed this Jul 3, 2013
@frewsxcv frewsxcv mentioned this pull request Jul 10, 2013
@frewsxcv
Copy link
Collaborator

@sgillies Any change I could get involved in keeping this project alive / becoming a maintainer?

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

Successfully merging this pull request may close these issues.

None yet

3 participants