Preserve M coordinates, where possible, in `GEOSMakeValid_r`.
Would it be possible to preserve M where coordinates are reused and set M to NaN where new coordinates are created?
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.
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?
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.