Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jts-dev] CoordinateSequence implementation shopping list

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" ExtendedCoordinateSequence.java (implementing XYZM).

The most recent code sprint found downstream projects collecting all kind of great party-trick coordinate sequences:

- Reverse coordinate sequence
- 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.

Felix Obermaier is also proposing quite an elaborate change to CoordinateSequence as part of https://github.com/locationtech/jts/pull/291:
- 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.
--
Jody Garnett

Back to the top