[geos-devel] It is slowly to read in the geometry from WKT

Vincent Schut schut at sarvision.com
Thu Jun 19 06:18:17 EDT 2003


I am experiencing the same while playing around with geos and am very curious 
about a solution... Anybody knows?

Cheers,
Vincent.

On Thursday 19 June 2003 12:11, cdlee wrote:
> Hi all,
>   i have a WKT file with 4M in size, it took GEOS 10 minutes to read the
> geometries in, by the other way, it took JTS less than 20 seconds, the
> following is my program, what is wrong?
>
>
>
> #include<fstream>
> #include<io.h>
> #inlcude<geom.h>
>
> using namespace std;
>
> const int MAX WKT SIZE = 5000000;
>
> int main(int argc, char** argv)
> {
>   char cWKT[MAX WKT SIZE];
>
>   ifstream inFile("test.txt");
>   WKTReader WKTRdr;
>
>   while(inFile.getline(cWKT, MAX WKT SIZE) != NULL)
>   {
>     string sWKT(cWKT);
>     Polygon* p = (Polygon*) WKTRdr.read(sWKT);
>     cout << p->getArea() << endl;
>     delete p;
>   }
>
>   return 0;
> }

-- 
______________________________________
Vincent Schut
Sarvision B.V.
Wageningen, The Netherlands
www.sarvision.com



More information about the geos-devel mailing list