simplewkttester.cpp

来自「一个很好的vc底层代码」· C++ 代码 · 共 74 行

CPP
74
字号
/********************************************************************** * $Id: SimpleWKTTester.cpp,v 1.9 2004/07/02 13:28:29 strk Exp $ * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation.  * See the COPYING file for more information. * ********************************************************************** * $Log: SimpleWKTTester.cpp,v $ * Revision 1.9  2004/07/02 13:28:29  strk * Fixed all #include lines to reflect headers layout change. * Added client application build tips in README. * * Revision 1.8  2003/11/07 01:23:43  pramsey * Add standard CVS headers licence notices and copyrights to all cpp and h * files. * * **********************************************************************/// CTS.cpp : Testing class//#include <iostream>#include <fstream>#include <geos/io.h>using namespace std;using namespace geos;int main(int argc, char** argv){    	try {		ofstream out("WKTOut");		ifstream in("WKTIn");		string instr;		string outstr;		WKTReader *r = new WKTReader(new GeometryFactory(new PrecisionModel(),10));		WKTWriter *w=new WKTWriter();		Geometry *g;		cout << "Start Testing:" << endl;		while(!in.eof()) {			&getline(in,instr);			if (instr!="") {				g=r->read(instr);				outstr=w->write(g);				out << "----------" << endl;				out << instr << endl;				out << outstr << endl;				out << "----------" << endl << endl;			}		}		out.flush();		out.close();		cout << "End of Testing" << endl;	} catch (GEOSException *ge) {		cout << ge->toString() << endl;	}	return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?