Quotes around otherwise ambiguous (underline containing) name
[geos.git] / tests / xmltester / SimpleWKTTester.cpp
bloba71e3bb0b0708b4d6f08646fc5c1b052a62cb335
1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
14 **********************************************************************/
16 // CTS.cpp : Testing class
19 #include <iostream>
20 #include <fstream>
22 #include <geos/io/WKTWriter.h>
23 #include <geos/io/WKTReader.h>
24 #include <geos/geom/PrecisionModel.h>
25 #include <geos/geom/GeometryFactory.h>
26 #include <geos/geom/Geometry.h>
27 #include <geos/util/GEOSException.h>
29 using namespace std;
30 using namespace geos::io;
31 using namespace geos::geom;
32 using namespace geos::util;
34 int main(int /*argc*/, char** /*argv*/)
37 try {
38 ofstream out("WKTOut");
39 ifstream in("WKTIn");
40 string instr;
41 string outstr;
42 PrecisionModel pm;
43 GeometryFactory::unique_ptr gf = GeometryFactory::create(&pm, 10);
44 WKTReader *r = new WKTReader(gf.get());
45 WKTWriter *w = new WKTWriter();
46 Geometry *g;
48 cout << "Start Testing:" << endl;
49 while(!in.eof()) {
50 getline(in,instr);
51 if (instr!="") {
52 g=r->read(instr);
53 outstr=w->write(g);
54 out << "----------" << endl;
55 out << instr << endl;
56 out << outstr << endl;
57 out << "----------" << endl << endl;
60 out.flush();
61 out.close();
62 cout << "End of Testing" << endl;
64 } catch (const GEOSException& ge) {
65 cout << ge.what() << endl;
68 return 0;