zhangfengcdt opened a new pull request, #3222:
URL: https://github.com/apache/parquet-java/pull/3222

   ### Rationale for this change
   
   The current implementation of BoundingBox.updateBounds() incorrectly handles 
wraparound conditions (where geometries cross the antimeridian at ±180° 
longitude). JTS (Java Topology Suite) operates in a 2D Cartesian space and 
doesn't natively support wraparound geometries. This change fixes how bounding 
boxes are updated to properly handle these edge cases, ensuring correct spatial 
calculations when working with geometries that cross the international date 
line.
   
   This is also to make the behavior consistent with the C++ implementation of 
the new parquet geometry type:
   https://github.com/apache/arrow/pull/45459/files
   
   ### What changes are included in this PR?
   
   - Modified the updateBounds() method in BoundingBox.java to properly handle 
coordinates that cross the antimeridian
   - Added logic to correctly calculate bounds when coordinates wrap around the 
globe
   - Added comprehensive JavaDoc comments explaining JTS's limitations and how 
the new implementation addresses them
   - Updated coordinate calculations to maintain proper spatial relationships 
for geometries crossing the ±180° longitude
   
   ### Are these changes tested?
   
   Yes, tests have been added or updated to verify:
   
   - Geometries that cross the antimeridian are properly bounded
   - Existing functionality for non-wraparound cases continues to work as 
expected
   
   ### Are there any user-facing changes?
   
   Yes. Applications working with geospatial data near or crossing the 
antimeridian (±180° longitude) will now have properly calculated bounding 
boxes. This fixes potential issues with spatial queries, contains checks, and 
other geometric operations when working with global datasets that span the 
international date line.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to