-
Notifications
You must be signed in to change notification settings - Fork 10
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
Update spec to document storing all GeoJSON properties as WKB #51
Conversation
I think this makes sense to me (since this is geo-parquet, we already know the reader can parse WKB), but let's give @cholmes a week or so to comment. The main difficulty this imposes on readers / writers is knowing which fields ought to be encoded as WKB. At some point it might be helpful to collect the list of known extensions writing geometry into a document (maybe here). |
I agree. I don't know STAC well enough... are there any other extensions that store a geometry? |
Whether there are any other common extensions now that have a geometry, I think we need to assume that any field could include geometry whether in an official extension I think this goes back to having two options:
|
sorry! Missed this before - too many github notifications. Looks good to me. I don't think there are other STAC extensions that store geometries, indeed it took me a moment to remember that the 'proj' one did, and I think that one is sorta special - it's an alternate representation of the same core geometry. STAC is mostly not about the geometry, it's about the language for the other properties. I think it may even be reasonable to assume that no other fields would include a geometry - I certainly don't see the value of adding a geometry in most extensions. If someone has an extra geometry and really wants it recognized then they can make the case for it. |
I want to highlight that this in particular is more involved than just knowing the physical schema, because it requires first knowing which keys in the JSON to convert to WKB. We can't directly and reliably parse any GeoJSON geometry as-is if there is any chance of having multiple levels of
huh, so we literally would just scan all the nested keys of every json input looking for something that has Maybe in practice for now, we should assume that |
I think we can ignore all the worries I raised earlier. Initially, I thought that we might have a coordination problem between different readers and writers all having to agree on which fields are WKB encoded. But fortunately, we've solved that with geoparquet's We can certainly still recommend that writers encoded geometries (and maybe so maybe the "should" in the PR is the right word to use). |
That's a good thing to bring up. We don't currently check for this when writing GeoParquet. Another question is: should this |
With #56 we mark a |
Some extensions also store GeoJSON geometries. I'm primarily thinking of
proj:geometry
, but maybe there are others?This updates the spec to recommend all GeoJSON geometries be stored as WKB. It's not uncommon for a STAC Collection that mostly holds Polygon geometries to occasionally have some MultiPolygon geometries, for example over the international date line. It's much easier to handle these edge cases when all geometries are stored as WKB.