From: Jody G. <jga...@re...> - 2004-02-06 18:10:58
|
Andrea Aime wrote: >I see better having our own CoordinateSequence objects, based on double or float arrays >(both of them please), and recognize them when performing visualization without resorting >to the Coordinate objects. This way not much code has to be changed. For performance >reasons, we may will to cache the Coordinate arrays when JTS requests them. >Finally, having our own CoordinateSequenceFactory would mean that objects generated >by JTS as results of the analysis would already be expressed in our own Coordinate sequence > > I mentioned this one a while back, I have extended the CooridientSequence and CoordinateSequenceFactory interfaces last time I was in this situation (I called the classes CoordinateAccess and CoordinateAccessFactory). Can we take a similar approach - make our own CoordinateSequence objects, mark them with an interface in order to "recognize them". My impression was that a lot of the internal JTS code was being migrated to use CoordinateSequence (rather than a Coordinate array). If this is the direction that Vivid is heading we could proceed with a bit more confidence. I have attached the CoordinateAccess class, to isolate other code from knowledge of my own "custom" interfaces I also made a Coordinates utility class which performed the same operation on both normal CoordinateSequences (or made use of optimizations for instances of CoordinateAccess). >class (not sure about that, but it seems to me that there's a way to specify the default >coordinate sequence factory). It seems to be the best of both world, the compactness of >primitive arrays and the convienience of JTS topology methods directly available for use... > > I agree, what you suggest is what I came up with last time (I was forced to build geometries backed by flat arrays of numbers). Cheers, Jody |