[geos-devel] performance of WKTReader

strk at refractions.net strk at refractions.net
Fri Nov 5 06:46:06 EST 2004


On Thu, Nov 04, 2004 at 06:38:50PM +0200, Øåáåêî Åâãåíèé wrote:
>  Hi. I just compiled geos 2.1.0 using VC7 2003 compiler.
> 
>  1. Looks like that WKTReader is too slow, isn't it?

Yes it is!

> 
>  I convert 29583 strings to multipolygons object;
>  Total point count was 854744, avarage point count is 28
> 
>  Convertion time was about ~ 40 seconds.
> 
>   For comparation deep copy of all converted objects was about 1200
>  milliseconds.
>  This is good enough, if keep in mind complex structure of
>  multipolygon.
>  Deep copy of vector<string> that contain source for conversion was about 100 milliseconds
> 
>  2. Is any alternative to parse WKT?

Use GeometryFactory to construct geoms.

>  3. Is exist any solution to parse WKB?

Nope. You can WKB-construct postgis geoms and then feed them to 
GEOS... might be faster then WKT-constructing GEOS geoms.

>  4. Just not exacly clear from documentation.
>     Copy constructor and operator= make deep copy, isn't it?

Copy constructors do, operator= doesn't (not defined).
Try sticking with documented features, as GEOS interface is
pretty unstable. From the documentation you should use
the clone() method for deep-copy.

> Thanks for pay attantion.

Thank you for sharing your experience.

--strk;



More information about the geos-devel mailing list