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

Support 3D coordinates #18

Closed
cholmes opened this issue Mar 1, 2022 · 6 comments · Fixed by #45
Closed

Support 3D coordinates #18

cholmes opened this issue Mar 1, 2022 · 6 comments · Fixed by #45
Milestone

Comments

@cholmes
Copy link
Member

cholmes commented Mar 1, 2022

For this we'll need to decide on EWKB or
ISO WKB

From what everyone could tell the core WKB is the same with both, so we're starting with that. But we should have experts sound in on what we should use.

Initial research shows ISO WKB is more of a 'standard', as EWKB has not been formalized in a document (though it has extensive support). With our CRS field we don't actually need the SRID part of EWKB.

@cholmes cholmes added this to the 0.2 milestone Mar 1, 2022
@pomadchin
Copy link
Collaborator

pomadchin commented Mar 2, 2022

To add more context here.

I found a decent description of EWKB / WKB in the JTS source code.

And also a related response in the JTS repo: locationtech/jts#710 (comment)

Links to Post GIS docs: https://postgis.net/docs/ST_AsEWKB.html, https://postgis.net/docs/ST_AsBinary.html

TLDR; from what I see, it looks like the world is slowly switching to the ISO WKB; we may want to be sure that some of the libs we use fully support it though, but sounds like a correct move.

@cholmes
Copy link
Member Author

cholmes commented Mar 2, 2022

Thanks for digging. Would definitely be good to get a detailed assessment of where various libraries are at and what tools we might leave behind if we went that route. But agree it probably makes sense to help move things along in that direction, and if there's key libraries that don't yet support it we could perhaps try to fund them to upgrade.

@rouault
Copy link
Contributor

rouault commented Mar 15, 2022

I would suggest to use ISO WKB. EWKB is an historical divergent fork, that has added the SRID and used the 25D flag (0x80000000 / most-significant-bit set) for the code of Z geometries, whereas ISO WKB uses a {code_of_2D_geom}+1000 code.
GDAL supports ISO WKB. GeoPackage uses it.
One annoyance with ISO WKB is that there's no official gratis spec for it, but https://github.com/postgis/postgis/blob/master/doc/bnf-wkb.txt can be used by implementors to get the important information.

@jorisvandenbossche
Copy link
Collaborator

Specifying to use ISO WKB sounds good to me.

Related to #41, we will have to decide if we, for now, only want to officially allow the 3D coordinates part of ISO WKB (which means we would only allow a subset of ISO WKB, and then will need to specify this subset somewhere), or allow any valid ISO WKB value (which also includes M or ZM values, and several Curve and Surface types).

(personally I would go for just 3D for now)

@cholmes
Copy link
Member Author

cholmes commented Mar 16, 2022

Looks like Flatgeobuf does support 'circular interpolations as defined by SQL-MM Part 3', while GeoPackage has it in the Non-linear geometry types extension.

I think people will likely ask for it, but I'm good with the geopackage approach - define a smaller more easily implementable core and then also define standard extensions. So agree we should just say we support a subset of ISO WKB.

@jorisvandenbossche
Copy link
Collaborator

I opened #45 to add this to the spec.

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 a pull request may close this issue.

4 participants