Add GeoJSON and Well-Known Text formats for complex location geometries#63
Draft
schuyler wants to merge 2 commits intolexicon-community:mainfrom
Draft
Add GeoJSON and Well-Known Text formats for complex location geometries#63schuyler wants to merge 2 commits intolexicon-community:mainfrom
schuyler wants to merge 2 commits intolexicon-community:mainfrom
Conversation
Contributor
Author
|
I haven't provided documentation in this PR, as I'm still waiting for the docs I proposed in #62 to be accepted, but once that PR is incorporated, I can add documentation for these schemas as well. |
268288e to
e775b69
Compare
11022a0 to
dfebbd4
Compare
Contributor
Author
|
Converting this to draft while contemplating whether complex geometries should be represented as blobs rather than embedded directly into a location object. |
|
I think this would be good for a companion Discourse thread. Also good that I can point the ActivityPub people at the thread. |
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.
The current set of location schemas only support either point geometries, or grid cells using the H3 system.
This PR hopes to open up the ATGeo lexicon to representing all forms of spatial geometry, including lines, polygons, and geometry collections.
The two most-widely readable formats for flexible geospatial representation are GeoJSON and Well-Known Text, or WKT.
The proposed format for
community.lexicon.geo.geojson.geometryisbytes, and notobject, because GeoJSON data typically contains raw floating point values. The GeoJSON object could be represented as a string in Lexicon, but it might get confusing to developers or tools to have JSON embedded within JSON. That leavesbytesencoding as the obvious alternative, but maybe JSON-in-JSON isn't as bad as it seems?The proposed format for
community.lexicon.geo.wkt.geometryis juststring, because WKT strings are meant, at some level, to be human readable.The advantage of providing potential support for these two formats is that, as standard GIS interchange formats, we are leveraging prior art in representing multidimensional geometries and creating opportunity for interoperability with GIS software.
Finally, this PR includes a proposal for a bounding box geometry, which might be useful in the future for indicating rough geographic extents, or as part of a query schema. I have proposed
north, south, east, westmembers in preference toxmin, ymin, xmax, ymaxbecause longitude is always x and latitude always y. The inversion from conventional "lat/long" is a constant source of confusion to new geospatial developers and should be avoided.All three proposed schemas include an optional
namefield for congruence with existingcommunity.lexicon.locationschemas.