[geos-devel] I'm lost with LineString

Martin Davis mbdavis at VividSolutions.com
Thu Apr 6 11:46:04 EDT 2006


The paradigm followed in JTS, and hence GEOS, is that Geometries are immutable once constructed.  This gives the implementor more freedom to optimize within a Geometry.  It also prevents aliasing errors (multiple references to the same geometry are very common in JTS usage - I'm not as familiar with how people are using GEOS).

IMO, this pattern should continue to be followed in GEOS.  To accomplish geometry editing, Geometries must be re-written.  This can be assisted by helper classes, of course - GeometryEditor is an example of this.

That said, it might be a useful (but major) enhancement to completely virtualize the Geometry interfaces, and allow multiple implementations of each Geometry type.   With that kind of design, you could provide both immutable and mutable Geometries easily and transparently.  This isn't too hard to do in JTS, but I have no idea about the implications for C++.

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: geos-devel-bounces at geos.refractions.net 
> [mailto:geos-devel-bounces at geos.refractions.net] On Behalf Of 
> Mateusz Loskot
> Sent: April 3, 2006 5:04 PM
> To: GEOS Development List
> Subject: [geos-devel] I'm lost with LineString
> 
> 
> Hi,
> 
> May be it's an extremely trivial problem or it's quite late 
> and I should get to bad, but please help me :-)))
> 
> The question is:
> how to add/remove point from existing instance of LineString class?
> 
> I created LineString assigning to it object of type of 
> CoordinateArraySequence with some points. Now, I'd like to 
> add/remove points from this sequence assigned to linestring.
> 
> How can I achive this simple functionality?
> 
> I'm sure it's very simple, but I can not find it.
> 
> Cheers
> -- 
> Mateusz Łoskot
> http://mateusz.loskot.net 
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net 
> http://geos.refractions.net/mailman/listinfo/geos-devel
> 



More information about the geos-devel mailing list