James and I are looking at helping downstream projects upgrade to JTS 1.15, one thing we are finding in our travels is projects that use "test"
(implementing XYZM).
The most recent code sprint found downstream projects collecting all kind of great party-trick coordinate sequences:
- An implementation that extracted a range of coordinates (kind of like List.subList method)
- An implementation that appended several coordinate sequences together
The theme of these being the ability to manipulate coordinate sequence structure without duplicating storage.
Felix Obermaier has a really interesting "copy on write" coordinate sequence here -
https://github.com/locationtech/jts/pull/271 which I think is cool. It delegates to another coordinate sequence factory, calling the methods as needed when the coordinate sequence needs to grow.
- introduces a bit mask for Flag,YFlag,ZFlag,MFlag allowing constructions of masks like XYZMFlag.
I am not quite comfortable with the approach, preferring instead a interface such as GeoTools
CoordinateSequence.java with an explicit getNumAttributes() method. Even if we choose to do a bit mask Java offers a BitSet+Enum solution thread stores as an int.