I get the benefits of having a GeometryFactory as well as a 
CoordinateSequenceFactory with various CoordinateSequence implementations — 
makes sense.   But in the case of Point, the different CoordinateSequence 
abstractions don't offer a benefit because we're talking about exactly one 
coordinate, not potentially many.

To make matters worse, all existing CoordianteSequence implementations are not 
lightweight for the single Coordinate case (there is no 
SingleCoordinateSequence specialization).  The existing ones either have an 
array backing (even more memory) or a new Coordinate object must be created on 
the fly per retrieval.

~ David

From: Martin Davis <[email protected]<mailto:[email protected]>>
Date: Tuesday, November 5, 2013 12:11 PM
Cc: 
"[email protected]<mailto:[email protected]>"
 
<[email protected]<mailto:[email protected]>>
Subject: Re: [Jts-topo-suite-user] Why does Point wrap a CoordinateSequence?

It's following the same pattern as the rest of the Geometry classes.  The 
reason for using a CoordinateSequence is to allow the client to supply 
alternate representations for the coordinate storage (e.g. by backing the CS 
with some other external structure, such as some other geometry API, or perhaps 
a blob of compressed storage of some kind).

Agreed that this make Point quite heavy, however.  This is an issue of Java vs 
say C++ (in which language implementation details like this can be "compiled 
away").

A goal of the next rev of the JTS API is to make the Geometry types interfaces. 
 That should allow much lightweight implementations.


On Tue, Nov 5, 2013 at 8:55 AM, Smiley, David W. 
<[email protected]<mailto:[email protected]>> wrote:
The Point class seems unnecessarily heavyweight. It holds a reference to a 
CoordinateSequence which in turn has the Coordinate.  Why doesn't Point simply 
wrap Coordinate directly?

~ David

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user

Reply via email to