geos icon indicating copy to clipboard operation
geos copied to clipboard

Preserve M coordinates, where possible, in `GEOSMakeValid_r`.

Open scottrhoyt opened this issue 1 month ago • 3 comments

Would it be possible to preserve M where coordinates are reused and set M to NaN where new coordinates are created?

scottrhoyt avatar Nov 03 '25 22:11 scottrhoyt

I think it would be fairly involved. I see that GeometryFixer::fixRing delegates to BufferOp::bufferByZero under the hood. The buffering code is fairly complex and does not work with M values.

dbaston avatar Nov 06 '25 18:11 dbaston

Understood. Thanks for looking into it. I'm curious, as I audit more of the dimension handling behavior for build GEOSwift's Z/M coordinate support, I'm uncovering more discrepancies in how Z/M are handled. I'm wondering:

  • Is it useful for me to keep opening issues for these things?
  • Is there any target that GEOS is shooting for with how Z/M are handled?
  • Is it possible to have any documentation of what to expect for Z/M handling for various GEOS functions?

scottrhoyt avatar Nov 06 '25 19:11 scottrhoyt

Is it useful for me to keep opening issues for these things?

It doesn't hurt. Maintainers might add Z/M handling in cases where it's not very involved (#1317, #1319), but I wouldn't expect a ticket like this one would get resolved without a compelling use case, external contribution, and/or funding.

Is there any target that GEOS is shooting for with how Z/M are handled?

Not that I'm aware of.

Is it possible to have any documentation of what to expect for Z/M handling for various GEOS functions?

Ideally, each function would describe how it handles Z/M values. If this is something you've been testing, a documentation PR is easily reviewed and always welcome.

dbaston avatar Nov 06 '25 20:11 dbaston