The bug got introduced because in older versions of JTS the assumption was that M-coordinates, if present, would be the fourth coordinate (or, to put it differently, that we have XY, XYZ or XYZM geometries, but never XYM geometries).
I believe that in later version (1.7+ probably) the API got refined to also work correctly with XYM geometries with the introduction of the getMeasures() method. See the various default methods that are present in the
CoordinateSequence interface.
See this question on StackOverflow.
The bug got introduced because in older versions of JTS the assumption was that M-coordinates, if present, would be the fourth coordinate (or, to put it differently, that we have XY, XYZ or XYZM geometries, but never XYM geometries).
I believe that in later version (1.7+ probably) the API got refined to also work correctly with XYM geometries with the introduction of the
getMeasures()
method. See the various default methods that are present in theCoordinateSequence
interface.