Update Wfs to use unwrap Antimeridian functionality#6956
Open
nickchooleidos wants to merge 1 commit intocodice:masterfrom
Open
Update Wfs to use unwrap Antimeridian functionality#6956nickchooleidos wants to merge 1 commit intocodice:masterfrom
nickchooleidos wants to merge 1 commit intocodice:masterfrom
Conversation
jlcsmith
approved these changes
Feb 2, 2026
| private JAXBElement<? extends SpatialOpsType> createSpatialOpType( | ||
| String operation, String propertyName, String wkt, Double distance) { | ||
| String adjustedWkt = Antimeridian.normalizeWkt(wkt); | ||
| String adjustedWkt = Antimeridian.unwrapAndSplitWkt(wkt); |
Member
There was a problem hiding this comment.
nice find - didn't realize we already had a method to solve this problem
Member
|
note - this fix is needed into the 2.29.x branch as well |
derekwilhelm
approved these changes
Feb 2, 2026
36698d2 to
ce12583
Compare
Author
|
Build now |
JasonCAustin
suggested changes
Feb 3, 2026
| @Test | ||
| public void testAntimeridianCrossingIsSplitWithNegativeCoordinatesa() { | ||
| String originalWkt = | ||
| "POLYGON ((170 10, -170 10, -170 10, 170 -10, 170 10))"; |
Contributor
There was a problem hiding this comment.
I don't think this is a valid test, the areas being compared don't appear to be equivalent. You have effectively drawn a triangle here
Author
There was a problem hiding this comment.
Yeah I realised it there 😆 I've updated to be a polygon now
| String originalWkt = | ||
| "POLYGON ((170 10, -170 10, -170 10, 170 -10, 170 10))"; | ||
| String expectedWkt = | ||
| "MULTIPOLYGON (((180 10, 170 10, 170 -10, 180 -10, 180 10)), ((-180 -10, -170 -10, -170, 10, -180 10, -180 -10)))"; |
Contributor
There was a problem hiding this comment.
this isn't valid WKT, note the -170, -10 in the second polygon
Author
There was a problem hiding this comment.
Yeah I must have added there by accident, I have updated a unit test to fail if it's not a valid WKT
427e0c5 to
46a9187
Compare
JasonCAustin
approved these changes
Feb 5, 2026
Author
|
Build now |
Contributor
|
build now |
46a9187 to
66c4ad2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The cause was that when a polygon crosses the antimeridian (180°/-180° longitude line), the system was treating the coordinates as a continuous range rather than recognizing the wrap-around at the antimeridian. For example, with coordinates [[174°,-4°], [-138°,9°]], the system interpreted this as covering all longitudes from -138° to 174° (spanning 312°), instead of the intended area that wraps around the antimeridian (spanning 48°).
This resulted in queries returning results from the entire middle section between the coordinates, rather than just the intended area that crosses the antimeridian boundary. The solution splits polygons that cross the antimeridian into two separate polygons - one covering -180° to the western longitude, and another from the eastern longitude to 180°, ensuring correct spatial queries across the antimeridian.
There's an existing method that solves this issue but it wasn't invoked anywhere. This PR aims to invoke that method
How should this be tested?
Maven compile this package. Then drop the jar file in a DDF box. Perform location searches and also test in Search Areas. Verify if there are still results returning outside of the drawing
Any background context you want to provide?
What are the relevant tickets?
Screenshots
Checklist:
Notes on Review Process
Please see Notes on Review Process for further guidance on requirements for merging and abbreviated reviews.
Review Comment Legend: