Use JTS instead of ESRI for geometries, Parts 1 and 2#13604
Use JTS instead of ESRI for geometries, Parts 1 and 2#13604arhimondr merged 4 commits intoprestodb:masterfrom
Conversation
|
cc @arhimondr |
There was a problem hiding this comment.
Make Polygon WKTs valid in test cases
Although it is by the standard - it is a breaking change. Do we care that if somebody had existing WKT stored in the database that were compatible with ESRI it will stop working?
If we are fine with that, should we have a better release note?
There was a problem hiding this comment.
Are this objects (CoordinateSequenceFactory, GeometryFactory) thread safe?
There was a problem hiding this comment.
upd: those are threadsafe, but mutable. Let's make them private
There was a problem hiding this comment.
Why are we removing this test case?
There was a problem hiding this comment.
Previously, certain types of invalid geometries could be created, but would have to be checked for explicitly in functions such as these. Now, those geometries fail on construction (I've updated the release notes to mention this).
There was a problem hiding this comment.
This seems to belong to the previous commit
There was a problem hiding this comment.
Why are we removing these two?
There was a problem hiding this comment.
Why do we need this? Why the standard toString from the enum is not good enough? If this is something that we use for actual serialization / deserialization, should we have a separate method and not reuse the toString interface?
There was a problem hiding this comment.
This isn't used for serde: it is used for a user-facing error message. It's a bit nicer and conforms to the previous error message. However, I have no strong feelings and I'm happy for users to read MULTI_LINE_STRING.
There was a problem hiding this comment.
I've removed it: it's probably better to change the test error message than add a new method that must be maintained.
There was a problem hiding this comment.
The GeometrySerde.serialize and GeometrySerde.deserialize are confusing. Should we rename GeometrySerde to EsriGeometrySerde?
2e9e7d6 to
05bebdf
Compare
arhimondr
left a comment
There was a problem hiding this comment.
The change looks good to me.
The only concern i have - is that we are braking backward compatibility by disallowing "invalid" polygons that don't have the last point. But as we discussed - that should be fine. As such polygons are "invalid".
@mbasmanova Would you like to have a look before we merge this?
There was a problem hiding this comment.
You are not using them outside anymore, could you please make them private?
There was a problem hiding this comment.
Oh, i see, you are making them private in the next commit. Could you please move it to the commit before?
dc3f559 to
f6149ab
Compare
d0b4060 to
820ea91
Compare
|
Running the verifier suite, I found only two discrepancies:
|
eb2793f to
8d1df35
Compare
As a first step to converting to JTS, convert the WKT serde functions to JTS. While the code change here is small, JTS uses the standard order for polygon rings (counter-clockwise), while Esri uses the reverse order (clockwise). This means many of the test cases need to have their coordinates reversed. Also, a couple tests which tested invalid geometries will actually be caught in WKT parsing; so they were removed from the other function tests.
Converting most unary properties and operators to JTS. Binary relations and operators were not touched, as well as unary operators that would require significant logic changes.
|
fixes #14031 |

I am in the process of refactoring the geospatial functions to use JTS instead of Esri. Why?
Since geometries are always converted to/from slices, it's fine for some functions to use Esri and some to use JTS (this is the case already). This PR converts most of the "easy" functions (those that don't involve much in the way of logical or numerical changes). However, JTS uses the standard order for polygon rings (counter-clockwise) instead of Esri's clockwise. This means that many of the tests need to have the order of the vertices reversed. I've isolated all of those changes into the commit that uses JTS for conversion from/to WKT.