Added srid keyword to wkb.dumps. Closes #592.#593
Merged
sgillies merged 2 commits intoshapely:masterfrom May 28, 2018
Merged
Conversation
sgillies
reviewed
May 28, 2018
| geom = lgeos.GEOSGeom_clone(ob._geom) | ||
| lgeos.GEOSSetSRID(geom, srid) | ||
| ob = geom_factory(geom) | ||
| kw["include_srid"] = True |
sgillies
requested changes
May 28, 2018
Contributor
sgillies
left a comment
There was a problem hiding this comment.
@snorfalorpagus can you add an entry to the change log? This is a feature that interested users shouldn't overlook.
sgillies
approved these changes
May 28, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added the
sridkeyword argument towkb.dumpsto include an SRID in WKB data, as suggested in #592.I've added some tests for WKB in
test_wkb.py(to matchtest_wkt.py). There are already some intest_persist.pywhich I've left alone. Perhaps this could be expanded in the future, but it's not essential.An observation is that
pickleuseswkb.dumpsto store data. This defaults to not exporting the SRID (even if one is present in the geometry after loading withloads. This means that the round-trip for a geometry with an SRID isn't perfect. However I think this is acceptable as generally we're ignoring the SRID in Shapely.