-
Notifications
You must be signed in to change notification settings - Fork 449
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
Switch to compact-SRID WKB format #664
Conversation
@@ -202,7 +202,6 @@ else if(isStrict) | |||
|
|||
// determine if SRIDs are present | |||
hasSRID = (typeInt & 0x20000000) != 0; | |||
int SRID = 0; |
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.
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.
Yes, definitely problematic. This is a bug in the GEOS implementation IMO.
This should just use the SRID of the top-most geometry (or 0 if not set). JTS does not support mixed SRIDs in collections.
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.
Shouldn't we throw a ParseException
in that case instead of using the SRID of top-most geometry?
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.
It's nice to allow reading as many WKB inputs as possible. Even if they are invalid, they can only be fixed if they are able to be read.
To preserve the most information, the SRIDs should always be read, and then applied to any missing SRIDs in child geometries. This will require passing the most recent SRID down the call stack as a parameter.
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.
Added a commit, PTAL.
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.
Looks good.
Signed-off-by: Halil İbrahim Şener <[email protected]>
86095d7
to
f1261ac
Compare
Signed-off-by: Halil İbrahim Şener <[email protected]>
e22f1af
to
b542462
Compare
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.
This looks good to me.
Can we include this change in the next release, and is there a planned date for it? |
Yes, I will commit this. There should be a new release by the middle of 2021, I think. Is that soon enough for you? |
Is it going to be part of the next major release? I was hoping for a minor in the next couple of weeks. 🙈 |
We might be able to get out a minor release this quarter. A minor release takes just as much work as a major release. |
Ack! This quarter would be nice. Thanks! 🙏 |
Fixes #663.
I have ported GEOS WKBWriter and changed
WKBReader
to use the parent's SRID in sub geometries.Added tests to verify that
WKBWriter
writes compact WKB formatWKBReader
can read from both format types