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 coordinates when writing to WKB and reading from WKB #734
base: master
Are you sure you want to change the base?
Conversation
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 <kaiwinter@gmx.de>
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:
|
Signed-off-by: Kai Winter <kaiwinter@gmx.de>
@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. |
The changes I made (adding
ordinateFlags
) are mainly taken over from theWKTReader
/WKTWriter
.