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

cdlee cdlee at ms16.url.com.tw
Thu Jun 19 06:24:16 EDT 2003


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;
}




More information about the geos-devel mailing list