[geos-devel] GEOSGetCoordinates() and performance (postgis bug fix)

strk strk at keybit.net
Fri Oct 24 11:33:32 EDT 2003


Sorry, forget all.
I realized that in order to make up an aligned memory containing
POINT3D structures is is preferrable to optimize postgis_geos_wrapper
instead.

--strk;

strk wrote:
> The function GEOSGetCoordinates() had a comment on top stating
> it would have been called just for linestring, so I casted given
> pointer to a linestring and used getCoordinatesRO() for performance.
> 
> Well. this is not the case. That function is called for all kind
> of geometry since after all from postgis point of view every kind
> of geometry will have a straight list of points. Underlying 
> GEOS getCoordinates() is not documented to return points in the exact
> same manner useful for postgis, but I suppose it does. Since postgis
> wrapper will only need geometry CoordinateList for read and copy
> purposes it is a waste to make one more copy of them.
> 
> I'd like to go back to calling getCoordinatesRO() and having GEOS taking
> care of optimizing memory copy to reduce it at most. This mean that
> getCoordinatesRO() should be made a virtual method of GeometryClass and
> the way it will organize returned coordinates should be documented.
> 
> >From an architectural point of view we'll obtain greater abstraction.
> 
> >From an implementation point of view we'll move to GEOS internal
> every optimization work. What do you think, should getCoordinatesRO()
> be a virtual Geometry method ?
> 
> --strk;
> 
> _______________________________________________
> 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