-
Notifications
You must be signed in to change notification settings - Fork 442
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
Keep M measures when writing to WKB and reading from WKB #734
Conversation
modules/core/src/main/java/org/locationtech/jts/io/WKBWriter.java
Outdated
Show resolved
Hide resolved
Are there still open issues or may this PR be merged? |
Any status on this? |
I had to fix this in WKBWriter, to make it work with XYZM
Test for XYZM is missing here |
@oers Does the |
@kaiwinter yes, the textwriter works correctly. I tested both with XYZM Coordinates (reading and writing) |
The wrong method in WKB Writer never wrote the 4th dimension. My Method fixes this (the new one below. It still had a bug)
My Test is like this:
|
@oers I added your changes to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I integrated the changes made here in a project that uses postgis 14. Itworks really well.
@kaiwinter @dr-jts Thanks for the great work. Is there a reason why this PR hasn't been merged after a year? Is there anything others could help? WKB format is often used for geometry serialization. Silently missing the M value will lead to incorrect results. We at Sedona uses WKB to serialize XYZM data for our Snowflake support. |
Can you rebase and resolve conflicts please? |
@jodygarnett I am not the author of this PR. @kaiwinter could you help us rebase and resolve conflicts? I will wait for @kaiwinter 2-3 days. If he is busy, I will be happy to take over the codebase and create a new PR. This issue might affect multiple Java-based DB engines if Parquet's Geometry type gets merged. We would really appreciate your help to accelerate the review of this PR when the new PR / rebase is ready.. |
M coordinate is read as Z coordinate after writing/reading.
Referring to WKTReader/WKTWriter I added the EnumSet<Ordinate> ordinateFlags. The WKBWriter uses these ordinateFlags to set the correct flags on the byte stream. Signed-off-by: Kai Winter <[email protected]>
Signed-off-by: Kai Winter <[email protected]> # Conflicts: # modules/core/src/main/java/org/locationtech/jts/io/WKBWriter.java
I did a rebase. Would be great if the PR finally gets merged. |
I kicked off CI just now; let's see if it builds a-ok! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading through this I only had minor feedback.
I expect that this may break the GeoTools subclass of WKBReader / WKBWriter that handles curves. With that in mind I am going to check with the GeoTools community to see if some of these methods need to be changed to protected (but this can be done in a separate PR).
We have two things of feedback that can be done as distinct PRs to avoid holding this fix up:
- The use of EnumSet is a nit more complicated then just covering XY, XYM, XYZ, XYZM cases. If desired such a change should happen in several sections of code.
- WKBWriter / WKBReader have several private methods that GeoTools subclass duplicate since they cannot override.
Is that about it?
I am now testing a local build of this PR for any regression in GeoTools stack. |
@jodygarnett cool. Can you make any of your branches public? It'd be awesome to see if @elahrvivaz can test GeoMesa with those branches. Also, @jiayuasu is there any testing that the Sedona / GeoParquet communities can be doing here? Generally, I'd like to point out that we have plenty of time to line all this up! Jody started the paperwork with Eclipse which needs to be done before we release. That'll take a few weeks, so we can take our time, etc. |
I am taking notes here geotools/geotools#4884 The branch for that PR is https://github.com/jodygarnett/geotools/tree/jts_1.20.0_update |
Oh I kind of screwed up, this PR should have included a change to the release notes. Something to consider for next time. |
The changes I made (adding
ordinateFlags
) are mainly taken over from theWKTReader
/WKTWriter
.