[geos-devel]createEmptyGeometry()

Mateusz Łoskot mateusz at loskot.net
Sun Apr 2 20:45:56 EDT 2006


strk at refractions.net wrote:
> 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,


Agreed. I revealed it as a quite big piece of code to be written, so
I've not finished yet. I'm doing my best. I estimate Wednesday as a
deadline.

> 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.

Agreed.

Cheers
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the geos-devel mailing list