[geos-devel]createEmptyGeometry()

strk at refractions.net strk at refractions.net
Sun Apr 2 01:26:27 EST 2006


On Sun, Apr 02, 2006 at 05:01:08AM +0200, Mateusz Å?oskot wrote:
> strk at refractions.net wrote:
> > On Fri, Mar 31, 2006 at 12:35:12PM +0200, strk at refractions.net wrote:
> >
> >> Note that the same happens with JTS. Example:
> >>
> >>   public Coordinate[] getCoordinates() {
> >>     return points.toCoordinateArray();
> >>  }
> >>
> >> 'points' is not checked for being NULL.
> >> In other places it is.
> > 
> > ...
> > 
> > Sorry, I had a closer look, at it seems that
> > LineString refuses to be contructed with a NULL
> > CoordinateSequence. It creates an *empty*
> > CoordinateSequence when passed NULL as arg.
> > 
> > Yet another useless waste of memory, similar
> > to the NULL Envelope and NULL Coordinate representations...
> 
> Hmm, what is the plan to fix/handle those cases?

Not considering it a bug as far as JTS does the same.
Priority is on correctness. Performance and scalability
comes next, and I think should start from inside (less
closer to API). Good places to look at for memory usage
reduction is in geomgraph namespace, classes like Edge
and SegmentString, for example, currently keeping own
copies of the polymorphic CoordinateSequence, in turn
keeping own copies of Coordinates, could use pointers
to existing Coordinates instead.

Let's have the Unit tests first, I'd go on with finishing
port of JTS-1.7 (Simplify package).
When we're happy with correctness and completeness we
can talk about performance tuning.

--strk;



More information about the geos-devel mailing list