GeoLatte / geolatte-geom

A geometry model that conforms to the OGC Simple Features for SQL specification.
Other
132 stars 63 forks source link

Box intersects of C2DM should not check M values #166

Open bauwelp-awv opened 7 months ago

bauwelp-awv commented 7 months ago

https://github.com/GeoLatte/geolatte-geom/blob/b3760323db5fef510b5ef8125904a78ce413f573/geom/src/main/java/org/geolatte/geom/Box.java#L223

The Box.intersects (and other) method uses getCoordinateDimension() to compare all coordinates.

For a C2DM this dimension is 3. This means that also M values are used in the comparison, which in my opinion is wrong.

Regards,

Philip Van Bauwel

maesenka commented 7 months ago

It's not per se wrong. It makes sense to treat the M-coordinate just like any other coordinate.

It's just that in many use cases we want the intersects() (or other operation) in 2D.

I propose we add this as a separate class (comparable to ProjectedGeometryOperations). So we can have something like Box2DOps.intersects(b1, b2).