[geos-commits] r2284 - trunk/capi
svn_geos at osgeo.org
svn_geos at osgeo.org
Fri Mar 20 21:08:55 EDT 2009
Author: mloskot
Date: 2009-03-20 21:08:55 -0400 (Fri, 20 Mar 2009)
New Revision: 2284
Modified:
trunk/capi/geos_ts_c.cpp
Log:
capi/geos_ts_c.cpp: Use of spaces instead of tabs applied.
Modified: trunk/capi/geos_ts_c.cpp
===================================================================
--- trunk/capi/geos_ts_c.cpp 2009-03-21 01:05:56 UTC (rev 2283)
+++ trunk/capi/geos_ts_c.cpp 2009-03-21 01:08:55 UTC (rev 2284)
@@ -166,21 +166,21 @@
return 2;
}
- try
+ try
{
- bool result = g1->disjoint(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ bool result = g1->disjoint(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
char
@@ -198,21 +198,21 @@
return 2;
}
- try
+ try
{
- bool result = g1->touches(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ bool result = g1->touches(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
+
+ return 2;
}
char
@@ -230,21 +230,21 @@
return 2;
}
- try
+ try
{
- bool result = g1->intersects(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ bool result = g1->intersects(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
+
+ return 2;
}
char
@@ -262,21 +262,21 @@
return 2;
}
- try
+ try
{
- bool result = g1->crosses(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ bool result = g1->crosses(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
+
+ return 2;
}
char
@@ -294,21 +294,21 @@
return 2;
}
- try
+ try
{
- bool result = g1->within(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ bool result = g1->within(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
// call g1->contains(g2)
@@ -330,21 +330,21 @@
return 2;
}
- try
+ try
{
- bool result = g1->contains(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ bool result = g1->contains(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
char
@@ -362,21 +362,21 @@
return 2;
}
- try
+ try
{
- bool result = g1->overlaps(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ bool result = g1->overlaps(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
@@ -399,22 +399,22 @@
return 2;
}
- try
+ try
{
- std::string s(pat);
- bool result = g1->relate(g2, s);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ std::string s(pat);
+ bool result = g1->relate(g2, s);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
char *
@@ -432,30 +432,30 @@
return NULL;
}
- try
+ try
{
using geos::geom::IntersectionMatrix;
- IntersectionMatrix *im = g1->relate(g2);
- if (im == NULL)
- return NULL;
-
+ IntersectionMatrix *im = g1->relate(g2);
+ if (im == NULL)
+ return NULL;
+
std::string s(im->toString());
- char *result = NULL;
- result = (char*) std::malloc( s.length() + 1);
- std::strcpy(result, s.c_str() );
- delete im;
+ char *result = NULL;
+ result = (char*) std::malloc( s.length() + 1);
+ std::strcpy(result, s.c_str() );
+ delete im;
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return NULL;
}
@@ -482,34 +482,34 @@
return 2;
}
- using geos::operation::valid::IsValidOp;
- using geos::operation::valid::TopologyValidationError;
- IsValidOp ivo(g1);
- bool result;
- try {
- result = ivo.isValid();
- if ( result == 0 )
- {
- TopologyValidationError *err = ivo.getValidationError();
- if ( err ) {
- std::string errmsg = err->toString();
- handle->NOTICE_MESSAGE("%s", errmsg.c_str());
- }
- }
- return result;
- }
+ using geos::operation::valid::IsValidOp;
+ using geos::operation::valid::TopologyValidationError;
+ IsValidOp ivo(g1);
+ bool result;
+ try {
+ result = ivo.isValid();
+ if ( result == 0 )
+ {
+ TopologyValidationError *err = ivo.getValidationError();
+ if ( err ) {
+ std::string errmsg = err->toString();
+ handle->NOTICE_MESSAGE("%s", errmsg.c_str());
+ }
+ }
+ return result;
+ }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
@@ -534,8 +534,8 @@
using geos::operation::valid::TopologyValidationError;
char* result = 0;
- char const* const validstr = "Valid Geometry";
- const std::size_t validstrlen = std::strlen(validstr) + 1;
+ char const* const validstr = "Valid Geometry";
+ const std::size_t validstrlen = std::strlen(validstr) + 1;
IsValidOp ivo(g1);
bool isvalid = ivo.isValid();
@@ -555,8 +555,8 @@
}
else
{
- result = static_cast<char*>(std::malloc(validstrlen));
- std::memcpy(result, validstr, validstrlen);
+ result = static_cast<char*>(std::malloc(validstrlen));
+ std::memcpy(result, validstr, validstrlen);
}
return result;
@@ -592,23 +592,23 @@
return 2;
}
- try {
- bool result;
- result = g1->equals(g2);
- return result;
- }
+ try {
+ bool result;
+ result = g1->equals(g2);
+ return result;
+ }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
char
@@ -626,23 +626,23 @@
return 2;
}
- try {
- bool result;
- result = g1->equalsExact(g2, tolerance);
- return result;
- }
+ try {
+ bool result;
+ result = g1->equalsExact(g2, tolerance);
+ return result;
+ }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
int
@@ -660,22 +660,22 @@
return 0;
}
- try {
- *dist = g1->distance(g2);
- return 1;
- }
+ try {
+ *dist = g1->distance(g2);
+ return 1;
+ }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 0;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 0;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 0;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 0;
+ }
}
int
@@ -693,22 +693,22 @@
return 0;
}
- try {
- *area = g->getArea();
- return 1;
- }
+ try {
+ *area = g->getArea();
+ return 1;
+ }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 0;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 0;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 0;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 0;
+ }
}
int
@@ -726,22 +726,22 @@
return 0;
}
- try {
- *length = g->getLength();
- return 1;
- }
+ try {
+ *length = g->getLength();
+ return 1;
+ }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 0;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 0;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 0;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 0;
+ }
}
Geometry *
@@ -760,24 +760,24 @@
}
CLocalizer clocale;
- try
- {
- WKTReader r((GeometryFactory*)handle->geomFactory);
- const std::string wktstring = std::string(wkt);
- Geometry *g = r.read(wktstring);
- return g;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ WKTReader r((GeometryFactory*)handle->geomFactory);
+ const std::string wktstring = std::string(wkt);
+ Geometry *g = r.read(wktstring);
+ return g;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
char *
@@ -796,25 +796,25 @@
}
CLocalizer clocale;
- try
- {
- std::string s = g1->toString();
- char *result;
- result = (char*) std::malloc( s.length() + 1);
- std::strcpy(result, s.c_str() );
+ try
+ {
+ std::string s = g1->toString();
+ char *result;
+ result = (char*) std::malloc( s.length() + 1);
+ std::strcpy(result, s.c_str() );
return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
// Remember to free the result!
@@ -833,33 +833,33 @@
return NULL;
}
- using geos::io::WKBWriter;
- try
- {
- int byteOrder = (int) handle->WKBByteOrder;
- WKBWriter w(handle->WKBOutputDims, byteOrder);
- std::ostringstream s(std::ios_base::binary);
- w.write(*g, s);
- std::string wkbstring = s.str();
- size_t len = wkbstring.length();
+ using geos::io::WKBWriter;
+ try
+ {
+ int byteOrder = (int) handle->WKBByteOrder;
+ WKBWriter w(handle->WKBOutputDims, byteOrder);
+ std::ostringstream s(std::ios_base::binary);
+ w.write(*g, s);
+ std::string wkbstring = s.str();
+ size_t len = wkbstring.length();
- unsigned char *result;
- result = (unsigned char*) std::malloc(len);
+ unsigned char *result;
+ result = (unsigned char*) std::malloc(len);
std::memcpy(result, wkbstring.c_str(), len);
- *size = len;
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ *size = len;
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -877,29 +877,29 @@
return NULL;
}
- using geos::io::WKBReader;
- try
- {
- std::string wkbstring = std::string((const char*)wkb, size); // make it binary !
- WKBReader r(*(GeometryFactory*)handle->geomFactory);
- std::istringstream s(std::ios_base::binary);
- s.str(wkbstring);
+ using geos::io::WKBReader;
+ try
+ {
+ std::string wkbstring = std::string((const char*)wkb, size); // make it binary !
+ WKBReader r(*(GeometryFactory*)handle->geomFactory);
+ std::istringstream s(std::ios_base::binary);
+ s.str(wkbstring);
- s.seekg(0, std::ios::beg); // rewind reader pointer
- Geometry *g = r.read(s);
- return g;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ s.seekg(0, std::ios::beg); // rewind reader pointer
+ Geometry *g = r.read(s);
+ return g;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
/* Read/write wkb hex values. Returned geometries are
@@ -919,33 +919,33 @@
return NULL;
}
- using geos::io::WKBWriter;
- try
- {
+ using geos::io::WKBWriter;
+ try
+ {
int byteOrder = (int) handle->WKBByteOrder;
- WKBWriter w(handle->WKBOutputDims, byteOrder);
- std::ostringstream s(std::ios_base::binary);
- w.writeHEX(*g, s);
- std::string hexstring = s.str();
- size_t len = hexstring.length();
+ WKBWriter w(handle->WKBOutputDims, byteOrder);
+ std::ostringstream s(std::ios_base::binary);
+ w.writeHEX(*g, s);
+ std::string hexstring = s.str();
+ size_t len = hexstring.length();
- char *result;
- result = (char*) std::malloc(len);
+ char *result;
+ result = (char*) std::malloc(len);
std::memcpy(result, hexstring.c_str(), len);
- *size = len;
- return (unsigned char*) result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ *size = len;
+ return (unsigned char*) result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -963,29 +963,29 @@
return NULL;
}
- using geos::io::WKBReader;
- try
- {
- std::string hexstring = std::string((const char*)hex, size);
- WKBReader r(*(GeometryFactory*)handle->geomFactory);
- std::istringstream s(std::ios_base::binary);
- s.str(hexstring);
+ using geos::io::WKBReader;
+ try
+ {
+ std::string hexstring = std::string((const char*)hex, size);
+ WKBReader r(*(GeometryFactory*)handle->geomFactory);
+ std::istringstream s(std::ios_base::binary);
+ s.str(hexstring);
- s.seekg(0, std::ios::beg); // rewind reader pointer
- Geometry *g = r.readHEX(s);
- return g;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ s.seekg(0, std::ios::beg); // rewind reader pointer
+ Geometry *g = r.readHEX(s);
+ return g;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
char
@@ -1003,21 +1003,21 @@
return 2;
}
- try
- {
- return g1->isEmpty();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
+ try
+ {
+ return g1->isEmpty();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
char
@@ -1035,21 +1035,21 @@
return 2;
}
- try
- {
- return g1->isSimple();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
+ try
+ {
+ return g1->isSimple();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
char
@@ -1067,26 +1067,26 @@
return 2;
}
- try
- {
- const LineString *ls = dynamic_cast<const LineString *>(g);
- if ( ls ) {
- return (ls->isRing());
- } else {
- return 0;
- }
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
+ try
+ {
+ const LineString *ls = dynamic_cast<const LineString *>(g);
+ if ( ls ) {
+ return (ls->isRing());
+ } else {
+ return 0;
+ }
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
@@ -1107,26 +1107,26 @@
return NULL;
}
- try
- {
- std::string s = g1->getGeometryType();
+ try
+ {
+ std::string s = g1->getGeometryType();
- char *result;
- result = (char*) std::malloc( s.length() + 1);
- std::strcpy(result, s.c_str() );
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ char *result;
+ result = (char*) std::malloc( s.length() + 1);
+ std::strcpy(result, s.c_str() );
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
// Return postgis geometry type index
@@ -1145,21 +1145,21 @@
return -1;
}
- try
- {
- return g1->getGeometryTypeId();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return -1;
- }
+ try
+ {
+ return g1->getGeometryTypeId();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return -1;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return -1;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return -1;
+ }
}
@@ -1184,22 +1184,22 @@
return NULL;
}
- try
- {
- Geometry *g3 = g1->getEnvelope();
- return g3;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ Geometry *g3 = g1->getEnvelope();
+ return g3;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1217,24 +1217,24 @@
return NULL;
}
- try
- {
- GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opINTERSECTION));
- return g3.release();
- //Geometry *g3 = g1->intersection(g2);
- //return g3;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opINTERSECTION));
+ return g3.release();
+ //Geometry *g3 = g1->intersection(g2);
+ //return g3;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1252,22 +1252,22 @@
return NULL;
}
- try
- {
- Geometry *g3 = g1->buffer(width, quadrantsegments);
- return g3;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ Geometry *g3 = g1->buffer(width, quadrantsegments);
+ return g3;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1285,22 +1285,22 @@
return NULL;
}
- try
- {
- Geometry *g3 = g1->convexHull();
- return g3;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ Geometry *g3 = g1->convexHull();
+ return g3;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1318,24 +1318,24 @@
return NULL;
}
- try
- {
- GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opDIFFERENCE));
- return g3.release();
- //Geometry *g3 = g1->difference(g2);
- //return g3;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opDIFFERENCE));
+ return g3.release();
+ //Geometry *g3 = g1->difference(g2);
+ //return g3;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1353,22 +1353,22 @@
return NULL;
}
- try
- {
- Geometry *g3 = g1->getBoundary();
- return g3;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ Geometry *g3 = g1->getBoundary();
+ return g3;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1386,24 +1386,24 @@
return NULL;
}
- try
- {
- GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opSYMDIFFERENCE));
- return g3.release();
- //Geometry *g3 = g1->symDifference(g2);
- //return g3;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opSYMDIFFERENCE));
+ return g3.release();
+ //Geometry *g3 = g1->symDifference(g2);
+ //return g3;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1421,31 +1421,31 @@
return NULL;
}
- try
- {
- GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opUNION));
- return g3.release();
- //Geometry *g3 = g1->Union(g2);
- //return g3;
- }
- catch (const std::exception &e)
- {
+ try
+ {
+ GeomAutoPtr g3 = BinaryOp(g1, g2, overlayOp(OverlayOp::opUNION));
+ return g3.release();
+ //Geometry *g3 = g1->Union(g2);
+ //return g3;
+ }
+ catch (const std::exception &e)
+ {
#if VERBOSE_EXCEPTIONS
- std::ostringstream s;
- s << "Exception on GEOSUnion with following inputs:" << std::endl;
- s << "A: "<<g1->toString() << std::endl;
- s << "B: "<<g2->toString() << std::endl;
- handle->NOTICE_MESSAGE("%s", s.str().c_str());
+ std::ostringstream s;
+ s << "Exception on GEOSUnion with following inputs:" << std::endl;
+ s << "A: "<<g1->toString() << std::endl;
+ s << "B: "<<g2->toString() << std::endl;
+ handle->NOTICE_MESSAGE("%s", s.str().c_str());
#endif // VERBOSE_EXCEPTIONS
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1463,27 +1463,27 @@
return NULL;
}
- try
+ try
{
- const geos::geom::MultiPolygon *p = dynamic_cast<const geos::geom::MultiPolygon *>(g1);
- if ( ! p )
- {
- handle->ERROR_MESSAGE("Invalid argument (must be a MultiPolygon)");
- return NULL;
- }
+ const geos::geom::MultiPolygon *p = dynamic_cast<const geos::geom::MultiPolygon *>(g1);
+ if ( ! p )
+ {
+ handle->ERROR_MESSAGE("Invalid argument (must be a MultiPolygon)");
+ return NULL;
+ }
using geos::operation::geounion::CascadedPolygonUnion;
- return CascadedPolygonUnion::Union(p);
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ return CascadedPolygonUnion::Union(p);
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1501,29 +1501,29 @@
return NULL;
}
- try
- {
- Geometry *ret = g1->getInteriorPoint();
- if ( ! ret )
+ try
+ {
+ Geometry *ret = g1->getInteriorPoint();
+ if ( ! ret )
{
const GeometryFactory *gf;
gf=handle->geomFactory;
- // return an empty collection
+ // return an empty collection
return gf->createGeometryCollection();
}
- return ret;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ return ret;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
//-------------------------------------------------------------------
@@ -1535,12 +1535,12 @@
{
GEOSContextHandleInternal_t *handle = 0;
- try
+ try
{
- delete a;
- }
- catch (const std::exception &e)
- {
+ delete a;
+ }
+ catch (const std::exception &e)
+ {
if ( 0 == extHandle )
{
return;
@@ -1552,10 +1552,10 @@
return;
}
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
if ( 0 == extHandle )
{
return;
@@ -1567,8 +1567,8 @@
return;
}
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
void
@@ -1597,20 +1597,20 @@
return -1;
}
- try
+ try
{
- return static_cast<int>(g1->getNumPoints());
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return -1;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return -1;
- }
+ return static_cast<int>(g1->getNumPoints());
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return -1;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return -1;
+ }
}
/*
@@ -1632,20 +1632,20 @@
return -1;
}
- try{
- g1->normalize();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return -1;
- }
+ try{
+ g1->normalize();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return -1;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return -1;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return -1;
+ }
return 0;
}
@@ -1664,26 +1664,26 @@
return -1;
}
- try{
- const Polygon *p = dynamic_cast<const Polygon *>(g1);
+ try{
+ const Polygon *p = dynamic_cast<const Polygon *>(g1);
if ( ! p )
{
handle->ERROR_MESSAGE("Argument is not a Polygon");
return -1;
}
- return static_cast<int>(p->getNumInteriorRing());
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return -1;
- }
+ return static_cast<int>(p->getNumInteriorRing());
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return -1;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return -1;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return -1;
+ }
}
@@ -1703,20 +1703,20 @@
return -1;
}
- try
+ try
{
- return static_cast<int>(g1->getNumGeometries());
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return -1;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return -1;
- }
+ return static_cast<int>(g1->getNumGeometries());
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return -1;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return -1;
+ }
}
@@ -1739,27 +1739,27 @@
return NULL;
}
- using geos::geom::GeometryCollection;
- try
+ using geos::geom::GeometryCollection;
+ try
{
- const GeometryCollection *gc = dynamic_cast<const GeometryCollection *>(g1);
- if ( ! gc )
- {
- handle->ERROR_MESSAGE("Argument is not a GeometryCollection");
- return NULL;
- }
- return gc->getGeometryN(n);
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ const GeometryCollection *gc = dynamic_cast<const GeometryCollection *>(g1);
+ if ( ! gc )
+ {
+ handle->ERROR_MESSAGE("Argument is not a GeometryCollection");
+ return NULL;
+ }
+ return gc->getGeometryN(n);
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
@@ -1782,26 +1782,26 @@
return NULL;
}
- try
+ try
{
- const Polygon *p = dynamic_cast<const Polygon *>(g1);
- if ( ! p )
- {
- handle->ERROR_MESSAGE("Invalid argument (must be a Polygon)");
- return NULL;
- }
- return p->getExteriorRing();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ const Polygon *p = dynamic_cast<const Polygon *>(g1);
+ if ( ! p )
+ {
+ handle->ERROR_MESSAGE("Invalid argument (must be a Polygon)");
+ return NULL;
+ }
+ return p->getExteriorRing();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
/*
@@ -1823,26 +1823,26 @@
return NULL;
}
- try
+ try
{
- const Polygon *p = dynamic_cast<const Polygon *>(g1);
- if ( ! p )
- {
- handle->ERROR_MESSAGE("Invalid argument (must be a Polygon)");
- return NULL;
- }
- return p->getInteriorRingN(n);
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ const Polygon *p = dynamic_cast<const Polygon *>(g1);
+ if ( ! p )
+ {
+ handle->ERROR_MESSAGE("Invalid argument (must be a Polygon)");
+ return NULL;
+ }
+ return p->getInteriorRingN(n);
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
@@ -1862,7 +1862,7 @@
return NULL;
}
- try
+ try
{
Geometry *ret = g->getCentroid();
if (0 != ret)
@@ -1870,18 +1870,18 @@
const GeometryFactory *gf = handle->geomFactory;
return gf->createGeometryCollection();
}
- return ret;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ return ret;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1900,52 +1900,52 @@
}
#ifdef GEOS_DEBUG
- char buf[256];
- sprintf(buf, "PostGIS2GEOS_collection: requested type %d, ngeoms: %d",
- type, ngeoms);
- handle->NOTICE_MESSAGE("%s", buf);// TODO: Can handle->NOTICE_MESSAGE format that directly?
+ char buf[256];
+ sprintf(buf, "PostGIS2GEOS_collection: requested type %d, ngeoms: %d",
+ type, ngeoms);
+ handle->NOTICE_MESSAGE("%s", buf);// TODO: Can handle->NOTICE_MESSAGE format that directly?
#endif
- try
- {
- Geometry *g;
+ try
+ {
+ Geometry *g;
const GeometryFactory *gf;
gf=handle->geomFactory;
- std::vector<Geometry *> *vgeoms = new std::vector<Geometry *>(geoms, geoms+ngeoms);
+ std::vector<Geometry *> *vgeoms = new std::vector<Geometry *>(geoms, geoms+ngeoms);
- switch (type)
- {
- case GEOS_GEOMETRYCOLLECTION:
- g = gf->createGeometryCollection(vgeoms);
- break;
- case GEOS_MULTIPOINT:
- g = gf->createMultiPoint(vgeoms);
- break;
- case GEOS_MULTILINESTRING:
- g = gf->createMultiLineString(vgeoms);
- break;
- case GEOS_MULTIPOLYGON:
- g = gf->createMultiPolygon(vgeoms);
- break;
- default:
- handle->ERROR_MESSAGE("Unsupported type request for PostGIS2GEOS_collection");
- g = NULL;
-
- }
- if (g==NULL) return NULL;
- return g;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ switch (type)
+ {
+ case GEOS_GEOMETRYCOLLECTION:
+ g = gf->createGeometryCollection(vgeoms);
+ break;
+ case GEOS_MULTIPOINT:
+ g = gf->createMultiPoint(vgeoms);
+ break;
+ case GEOS_MULTILINESTRING:
+ g = gf->createMultiLineString(vgeoms);
+ break;
+ case GEOS_MULTIPOLYGON:
+ g = gf->createMultiPolygon(vgeoms);
+ break;
+ default:
+ handle->ERROR_MESSAGE("Unsupported type request for PostGIS2GEOS_collection");
+ g = NULL;
+
+ }
+ if (g==NULL) return NULL;
+ return g;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -1963,53 +1963,53 @@
return NULL;
}
- using geos::operation::polygonize::Polygonizer;
- unsigned int i;
- Geometry *out = NULL;
+ using geos::operation::polygonize::Polygonizer;
+ unsigned int i;
+ Geometry *out = NULL;
- try{
- // Polygonize
- Polygonizer plgnzr;
- for (i=0; i<ngeoms; i++) plgnzr.add(g[i]);
+ try{
+ // Polygonize
+ Polygonizer plgnzr;
+ for (i=0; i<ngeoms; i++) plgnzr.add(g[i]);
#if GEOS_DEBUG
- handle->NOTICE_MESSAGE("geometry vector added to polygonizer");
+ handle->NOTICE_MESSAGE("geometry vector added to polygonizer");
#endif
- std::vector<Polygon *>*polys = plgnzr.getPolygons();
+ std::vector<Polygon *>*polys = plgnzr.getPolygons();
#if GEOS_DEBUG
- handle->NOTICE_MESSAGE("output polygons got");
+ handle->NOTICE_MESSAGE("output polygons got");
#endif
- // We need a vector of Geometry pointers, not
- // Polygon pointers.
- // STL vector doesn't allow transparent upcast of this
- // nature, so we explicitly convert.
- // (it's just a waste of processor and memory, btw)
+ // We need a vector of Geometry pointers, not
+ // Polygon pointers.
+ // STL vector doesn't allow transparent upcast of this
+ // nature, so we explicitly convert.
+ // (it's just a waste of processor and memory, btw)
std::vector<Geometry*> *polyvec =
- new std::vector<Geometry *>(polys->size());
- for (i=0; i<polys->size(); i++) (*polyvec)[i] = (*polys)[i];
- delete polys;
+ new std::vector<Geometry *>(polys->size());
+ for (i=0; i<polys->size(); i++) (*polyvec)[i] = (*polys)[i];
+ delete polys;
const GeometryFactory *gf;
gf=handle->geomFactory;
- out = gf->createGeometryCollection(polyvec);
- // the above method takes ownership of the passed
- // vector, so we must *not* delete it
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ out = gf->createGeometryCollection(polyvec);
+ // the above method takes ownership of the passed
+ // vector, so we must *not* delete it
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
- return out;
+ return out;
}
Geometry *
@@ -2027,52 +2027,52 @@
return NULL;
}
- using geos::operation::polygonize::Polygonizer;
- unsigned int i;
- Geometry *out = NULL;
+ using geos::operation::polygonize::Polygonizer;
+ unsigned int i;
+ Geometry *out = NULL;
- try{
- // Polygonize
- Polygonizer plgnzr;
- for (i=0; i<ngeoms; i++) plgnzr.add(g[i]);
+ try{
+ // Polygonize
+ Polygonizer plgnzr;
+ for (i=0; i<ngeoms; i++) plgnzr.add(g[i]);
#if GEOS_DEBUG
- handle->NOTICE_MESSAGE("geometry vector added to polygonizer");
+ handle->NOTICE_MESSAGE("geometry vector added to polygonizer");
#endif
- std::vector<const LineString *>*lines = plgnzr.getCutEdges();
+ std::vector<const LineString *>*lines = plgnzr.getCutEdges();
#if GEOS_DEBUG
- handle->NOTICE_MESSAGE("output polygons got");
+ handle->NOTICE_MESSAGE("output polygons got");
#endif
- // We need a vector of Geometry pointers, not
- // Polygon pointers.
- // STL vector doesn't allow transparent upcast of this
- // nature, so we explicitly convert.
- // (it's just a waste of processor and memory, btw)
+ // We need a vector of Geometry pointers, not
+ // Polygon pointers.
+ // STL vector doesn't allow transparent upcast of this
+ // nature, so we explicitly convert.
+ // (it's just a waste of processor and memory, btw)
std::vector<Geometry*> *linevec =
- new std::vector<Geometry *>(lines->size());
- for (i=0; i<lines->size(); i++) (*linevec)[i] = (*lines)[i]->clone();
+ new std::vector<Geometry *>(lines->size());
+ for (i=0; i<lines->size(); i++) (*linevec)[i] = (*lines)[i]->clone();
const GeometryFactory *gf;
gf=handle->geomFactory;
- out = gf->createGeometryCollection(linevec);
- // the above method takes ownership of the passed
- // vector, so we must *not* delete it
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ out = gf->createGeometryCollection(linevec);
+ // the above method takes ownership of the passed
+ // vector, so we must *not* delete it
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
- return out;
+ return out;
}
Geometry *
@@ -2090,7 +2090,7 @@
return NULL;
}
- using geos::operation::linemerge::LineMerger;
+ using geos::operation::linemerge::LineMerger;
unsigned int i;
Geometry *out = NULL;
@@ -2115,17 +2115,17 @@
out = gf->buildGeometry(geoms);
//out = gf->createGeometryCollection(geoms);
}
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
return out;
}
@@ -2145,30 +2145,30 @@
return 0;
}
- try
+ try
{
- return g1->getSRID();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 0;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 0;
- }
+ return g1->getSRID();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 0;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 0;
+ }
}
const char* GEOSversion()
{
- return GEOS_CAPI_VERSION;
+ return GEOS_CAPI_VERSION;
}
const char* GEOSjtsport()
{
- return GEOS_JTS_PORT;
+ return GEOS_JTS_PORT;
}
@@ -2187,10 +2187,10 @@
return -1;
}
- if ( g->isEmpty() ) return false;
- double az = g->getCoordinate()->z;
- //handle->ERROR_MESSAGE("ZCoord: %g", az);
- return static_cast<char>(FINITE(az));
+ if ( g->isEmpty() ) return false;
+ double az = g->getCoordinate()->z;
+ //handle->ERROR_MESSAGE("ZCoord: %g", az);
+ return static_cast<char>(FINITE(az));
}
int
@@ -2226,11 +2226,11 @@
return -1;
}
- if ( newdims < 2 || newdims > 3 )
- handle->ERROR_MESSAGE("WKB output dimensions out of range 2..3");
- int olddims = handle->WKBOutputDims;
- handle->WKBOutputDims = newdims;
- return olddims;
+ if ( newdims < 2 || newdims > 3 )
+ handle->ERROR_MESSAGE("WKB output dimensions out of range 2..3");
+ int olddims = handle->WKBOutputDims;
+ handle->WKBOutputDims = newdims;
+ return olddims;
}
int
@@ -2248,7 +2248,7 @@
return -1;
}
- return handle->WKBByteOrder;
+ return handle->WKBByteOrder;
}
int
@@ -2266,9 +2266,9 @@
return -1;
}
- int oldByteOrder = handle->WKBByteOrder;
- handle->WKBByteOrder = byteOrder;
- return oldByteOrder;
+ int oldByteOrder = handle->WKBByteOrder;
+ handle->WKBByteOrder = byteOrder;
+ return oldByteOrder;
}
@@ -2287,21 +2287,21 @@
return NULL;
}
- try
+ try
{
const GeometryFactory *gf = handle->geomFactory;
- return gf->getCoordinateSequenceFactory()->create(size, dims);
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ return gf->getCoordinateSequenceFactory()->create(size, dims);
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
int
@@ -2319,39 +2319,39 @@
return 0;
}
- try
+ try
{
- s->setOrdinate(static_cast<int>(idx), static_cast<int>(dim), val);
- return 1;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 0;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 0;
- }
+ s->setOrdinate(static_cast<int>(idx), static_cast<int>(dim), val);
+ return 1;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 0;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 0;
+ }
}
int
GEOSCoordSeq_setX_r(GEOSContextHandle_t extHandle, CoordinateSequence *s, unsigned int idx, double val)
{
- return GEOSCoordSeq_setOrdinate_r(extHandle, s, idx, 0, val);
+ return GEOSCoordSeq_setOrdinate_r(extHandle, s, idx, 0, val);
}
int
GEOSCoordSeq_setY_r(GEOSContextHandle_t extHandle, CoordinateSequence *s, unsigned int idx, double val)
{
- return GEOSCoordSeq_setOrdinate_r(extHandle, s, idx, 1, val);
+ return GEOSCoordSeq_setOrdinate_r(extHandle, s, idx, 1, val);
}
int
GEOSCoordSeq_setZ_r(GEOSContextHandle_t extHandle, CoordinateSequence *s, unsigned int idx, double val)
{
- return GEOSCoordSeq_setOrdinate_r(extHandle, s, idx, 2, val);
+ return GEOSCoordSeq_setOrdinate_r(extHandle, s, idx, 2, val);
}
CoordinateSequence *
@@ -2369,20 +2369,20 @@
return NULL;
}
- try
+ try
{
return s->clone();
}
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
int
@@ -2400,41 +2400,41 @@
return 0;
}
- try
+ try
{
- double d = s->getOrdinate(static_cast<int>(idx),
- static_cast<int>(dim));
- *val = d;
- return 1;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 0;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 0;
- }
+ double d = s->getOrdinate(static_cast<int>(idx),
+ static_cast<int>(dim));
+ *val = d;
+ return 1;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 0;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 0;
+ }
}
int
GEOSCoordSeq_getX_r(GEOSContextHandle_t extHandle, const CoordinateSequence *s, unsigned int idx, double *val)
{
- return GEOSCoordSeq_getOrdinate_r(extHandle, s, idx, 0, val);
+ return GEOSCoordSeq_getOrdinate_r(extHandle, s, idx, 0, val);
}
int
GEOSCoordSeq_getY_r(GEOSContextHandle_t extHandle, const CoordinateSequence *s, unsigned int idx, double *val)
{
- return GEOSCoordSeq_getOrdinate_r(extHandle, s, idx, 1, val);
+ return GEOSCoordSeq_getOrdinate_r(extHandle, s, idx, 1, val);
}
int
GEOSCoordSeq_getZ_r(GEOSContextHandle_t extHandle, const CoordinateSequence *s, unsigned int idx, double *val)
{
- return GEOSCoordSeq_getOrdinate_r(extHandle, s, idx, 2, val);
+ return GEOSCoordSeq_getOrdinate_r(extHandle, s, idx, 2, val);
}
int
@@ -2452,22 +2452,22 @@
return 0;
}
- try
+ try
{
std::size_t sz = s->getSize();
- *size = static_cast<unsigned int>(sz);
- return 1;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 0;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 0;
- }
+ *size = static_cast<unsigned int>(sz);
+ return 1;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 0;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 0;
+ }
}
int
@@ -2485,22 +2485,22 @@
return 0;
}
- try {
+ try {
std::size_t dim = s->getDimension();
- *dims = static_cast<unsigned int>(dim);
- return 1;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 0;
- }
+ *dims = static_cast<unsigned int>(dim);
+ return 1;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 0;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 0;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 0;
+ }
}
void
@@ -2508,12 +2508,12 @@
{
GEOSContextHandleInternal_t *handle = 0;
- try
+ try
{
- delete s;
- }
- catch (const std::exception &e)
- {
+ delete s;
+ }
+ catch (const std::exception &e)
+ {
if ( 0 == extHandle )
{
return;
@@ -2525,10 +2525,10 @@
return;
}
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
if ( 0 == extHandle )
{
return;
@@ -2540,8 +2540,8 @@
return;
}
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
const CoordinateSequence *
@@ -2560,31 +2560,31 @@
}
using geos::geom::Point;
- try
- {
- const LineString *ls = dynamic_cast<const LineString *>(g);
- if ( ls )
- {
- return ls->getCoordinatesRO();
- }
- const Point *p = dynamic_cast<const Point *>(g);
- if ( p )
- {
- return p->getCoordinatesRO();
- }
- handle->ERROR_MESSAGE("Geometry must be a Point or LineString");
- return NULL;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ try
+ {
+ const LineString *ls = dynamic_cast<const LineString *>(g);
+ if ( ls )
+ {
+ return ls->getCoordinatesRO();
+ }
+ const Point *p = dynamic_cast<const Point *>(g);
+ if ( p )
+ {
+ return p->getCoordinatesRO();
+ }
+ handle->ERROR_MESSAGE("Geometry must be a Point or LineString");
+ return NULL;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -2602,22 +2602,22 @@
return NULL;
}
- try {
+ try {
const GeometryFactory *gf;
gf=handle->geomFactory;
return gf->createPoint(cs);
}
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -2635,23 +2635,23 @@
return NULL;
}
- try {
+ try {
const GeometryFactory *gf;
gf=handle->geomFactory;
return gf->createLinearRing(cs);
}
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -2669,23 +2669,23 @@
return NULL;
}
- try
+ try
{
const GeometryFactory *gf;
gf=handle->geomFactory;
return gf->createLineString(cs);
}
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -2704,32 +2704,32 @@
}
using geos::geom::LinearRing;
- try
- {
+ try
+ {
std::vector<Geometry *> *vholes =
new std::vector<Geometry *>(holes, holes+nholes);
- LinearRing *nshell = dynamic_cast<LinearRing *>(shell);
- if ( ! nshell )
- {
- handle->ERROR_MESSAGE("Shell is not a LinearRing");
- return NULL;
- }
+ LinearRing *nshell = dynamic_cast<LinearRing *>(shell);
+ if ( ! nshell )
+ {
+ handle->ERROR_MESSAGE("Shell is not a LinearRing");
+ return NULL;
+ }
const GeometryFactory *gf;
gf=handle->geomFactory;
- return gf->createPolygon(nshell, vholes);
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ return gf->createPolygon(nshell, vholes);
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -2747,20 +2747,20 @@
return NULL;
}
- try
+ try
{
return g->clone();
}
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
int
@@ -2782,50 +2782,50 @@
using geos::geom::Point;
std::size_t dim = 0;
- try {
- const LineString *ls = dynamic_cast<const LineString *>(g);
- if ( ls )
- {
+ try {
+ const LineString *ls = dynamic_cast<const LineString *>(g);
+ if ( ls )
+ {
dim = ls->getCoordinatesRO()->getDimension();
- return static_cast<int>(dim);
- }
+ return static_cast<int>(dim);
+ }
- const Point *p = dynamic_cast<const Point *>(g);
- if ( p )
- {
+ const Point *p = dynamic_cast<const Point *>(g);
+ if ( p )
+ {
dim = p->getCoordinatesRO()->getDimension();
- return static_cast<int>(dim);
- }
+ return static_cast<int>(dim);
+ }
- const Polygon *poly = dynamic_cast<const Polygon *>(g);
- if ( poly )
- {
- return GEOSGeom_getDimensions_r(extHandle, poly->getExteriorRing());
- }
+ const Polygon *poly = dynamic_cast<const Polygon *>(g);
+ if ( poly )
+ {
+ return GEOSGeom_getDimensions_r(extHandle, poly->getExteriorRing());
+ }
- const GeometryCollection *coll =
- dynamic_cast<const GeometryCollection *>(g);
- if ( coll )
- {
- if ( coll->isEmpty() ) return 0;
- return GEOSGeom_getDimensions_r(extHandle, coll->getGeometryN(0));
- }
+ const GeometryCollection *coll =
+ dynamic_cast<const GeometryCollection *>(g);
+ if ( coll )
+ {
+ if ( coll->isEmpty() ) return 0;
+ return GEOSGeom_getDimensions_r(extHandle, coll->getGeometryN(0));
+ }
- handle->ERROR_MESSAGE("Unknown geometry type");
- return 0;
- }
+ handle->ERROR_MESSAGE("Unknown geometry type");
+ return 0;
+ }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 0;
- }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 0;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 0;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 0;
+ }
}
Geometry *
@@ -2843,25 +2843,25 @@
return NULL;
}
- using namespace geos::simplify;
+ using namespace geos::simplify;
- try
- {
- Geometry::AutoPtr g(DouglasPeuckerSimplifier::simplify(
- g1, tolerance));
- return g.release();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ Geometry::AutoPtr g(DouglasPeuckerSimplifier::simplify(
+ g1, tolerance));
+ return g.release();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
Geometry *
@@ -2879,25 +2879,25 @@
return NULL;
}
- using namespace geos::simplify;
+ using namespace geos::simplify;
- try
- {
- Geometry::AutoPtr g(TopologyPreservingSimplifier::simplify(
- g1, tolerance));
- return g.release();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
+ try
+ {
+ Geometry::AutoPtr g(TopologyPreservingSimplifier::simplify(
+ g1, tolerance));
+ return g.release();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
@@ -2917,21 +2917,21 @@
return NULL;
}
- using geos::io::WKTReader;
- try
- {
- return new WKTReader((GeometryFactory*)handle->geomFactory);
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ using geos::io::WKTReader;
+ try
+ {
+ return new WKTReader((GeometryFactory*)handle->geomFactory);
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
void
@@ -2939,12 +2939,12 @@
{
GEOSContextHandleInternal_t *handle = 0;
- try
- {
- delete reader;
- }
- catch (const std::exception &e)
- {
+ try
+ {
+ delete reader;
+ }
+ catch (const std::exception &e)
+ {
if ( 0 == extHandle )
{
return;
@@ -2956,10 +2956,10 @@
return;
}
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
if ( 0 == extHandle )
{
return;
@@ -2971,8 +2971,8 @@
return;
}
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
@@ -2992,22 +2992,22 @@
}
CLocalizer clocale;
- try
- {
- const std::string wktstring = std::string(wkt);
- Geometry *g = reader->read(wktstring);
- return g;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ try
+ {
+ const std::string wktstring = std::string(wkt);
+ Geometry *g = reader->read(wktstring);
+ return g;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
/* WKT Writer */
@@ -3026,21 +3026,21 @@
return NULL;
}
- try
- {
- using geos::io::WKTWriter;
- return new WKTWriter();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return NULL;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return NULL;
- }
+ try
+ {
+ using geos::io::WKTWriter;
+ return new WKTWriter();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return NULL;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return NULL;
+ }
}
void
@@ -3049,12 +3049,12 @@
GEOSContextHandleInternal_t *handle = 0;
- try
- {
- delete Writer;
- }
- catch (const std::exception &e)
- {
+ try
+ {
+ delete Writer;
+ }
+ catch (const std::exception &e)
+ {
if ( 0 == extHandle )
{
return;
@@ -3066,10 +3066,10 @@
return;
}
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
if ( 0 == extHandle )
{
return;
@@ -3081,8 +3081,8 @@
return;
}
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
@@ -3102,22 +3102,22 @@
}
CLocalizer clocale;
- try
- {
- std::string s = writer->write(geom);
- char *result = NULL;
- result = (char*) std::malloc( s.length() + 1);
- std::strcpy(result, s.c_str() );
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ try
+ {
+ std::string s = writer->write(geom);
+ char *result = NULL;
+ result = (char*) std::malloc( s.length() + 1);
+ std::strcpy(result, s.c_str() );
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return NULL;
}
@@ -3138,19 +3138,19 @@
return NULL;
}
- using geos::io::WKBReader;
- try
- {
- return new WKBReader(*(GeometryFactory*)handle->geomFactory);
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ using geos::io::WKBReader;
+ try
+ {
+ return new WKBReader(*(GeometryFactory*)handle->geomFactory);
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return NULL;
}
@@ -3160,12 +3160,12 @@
{
GEOSContextHandleInternal_t *handle = 0;
- try
- {
- delete reader;
- }
- catch (const std::exception &e)
- {
+ try
+ {
+ delete reader;
+ }
+ catch (const std::exception &e)
+ {
if ( 0 == extHandle )
{
return;
@@ -3177,10 +3177,10 @@
return;
}
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
if ( 0 == extHandle )
{
return;
@@ -3192,8 +3192,8 @@
return;
}
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
@@ -3212,24 +3212,24 @@
return NULL;
}
- try
- {
- std::string wkbstring = std::string((const char*)wkb, size); // make it binary !
- std::istringstream s(std::ios_base::binary);
- s.str(wkbstring);
+ try
+ {
+ std::string wkbstring = std::string((const char*)wkb, size); // make it binary !
+ std::istringstream s(std::ios_base::binary);
+ s.str(wkbstring);
- s.seekg(0, std::ios::beg); // rewind reader pointer
- Geometry *g = reader->read(s);
- return g;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ s.seekg(0, std::ios::beg); // rewind reader pointer
+ Geometry *g = reader->read(s);
+ return g;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return NULL;
}
@@ -3249,24 +3249,24 @@
return NULL;
}
- try
- {
- std::string hexstring = std::string((const char*)hex, size);
- std::istringstream s(std::ios_base::binary);
- s.str(hexstring);
+ try
+ {
+ std::string hexstring = std::string((const char*)hex, size);
+ std::istringstream s(std::ios_base::binary);
+ s.str(hexstring);
- s.seekg(0, std::ios::beg); // rewind reader pointer
- Geometry *g = reader->readHEX(s);
- return g;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ s.seekg(0, std::ios::beg); // rewind reader pointer
+ Geometry *g = reader->readHEX(s);
+ return g;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return NULL;
}
@@ -3287,19 +3287,19 @@
return NULL;
}
- using geos::io::WKBWriter;
- try
- {
- return new WKBWriter();
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ using geos::io::WKBWriter;
+ try
+ {
+ return new WKBWriter();
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return NULL;
}
@@ -3309,12 +3309,12 @@
{
GEOSContextHandleInternal_t *handle = 0;
- try
- {
- delete Writer;
- }
- catch (const std::exception &e)
- {
+ try
+ {
+ delete Writer;
+ }
+ catch (const std::exception &e)
+ {
if ( 0 == extHandle )
{
return;
@@ -3326,10 +3326,10 @@
return;
}
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
if ( 0 == extHandle )
{
return;
@@ -3341,8 +3341,8 @@
return;
}
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
@@ -3362,27 +3362,27 @@
return NULL;
}
- try
- {
- std::ostringstream s(std::ios_base::binary);
- writer->write(*geom, s);
- std::string wkbstring = s.str();
- size_t len = wkbstring.length();
+ try
+ {
+ std::ostringstream s(std::ios_base::binary);
+ writer->write(*geom, s);
+ std::string wkbstring = s.str();
+ size_t len = wkbstring.length();
- unsigned char *result = NULL;
- result = (unsigned char*) std::malloc(len);
+ unsigned char *result = NULL;
+ result = (unsigned char*) std::malloc(len);
std::memcpy(result, wkbstring.c_str(), len);
- *size = len;
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ *size = len;
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return NULL;
}
@@ -3402,28 +3402,28 @@
return NULL;
}
- try
- {
- std::ostringstream s(std::ios_base::binary);
- writer->writeHEX(*geom, s);
- std::string wkbstring = s.str();
- const size_t len = wkbstring.length();
+ try
+ {
+ std::ostringstream s(std::ios_base::binary);
+ writer->writeHEX(*geom, s);
+ std::string wkbstring = s.str();
+ const size_t len = wkbstring.length();
- unsigned char *result = NULL;
- result = (unsigned char*) std::malloc(len);
+ unsigned char *result = NULL;
+ result = (unsigned char*) std::malloc(len);
std::memcpy(result, wkbstring.c_str(), len);
- *size = len;
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- }
+ *size = len;
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return NULL;
}
@@ -3442,15 +3442,15 @@
return 0;
}
- try
- {
- return writer->getOutputDimension();
- }
+ try
+ {
+ return writer->getOutputDimension();
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return 0;
}
@@ -3469,15 +3469,15 @@
return;
}
- try
- {
- return writer->setOutputDimension(newDimension);
- }
+ try
+ {
+ return writer->setOutputDimension(newDimension);
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
int
@@ -3495,15 +3495,15 @@
return 0;
}
- try
- {
- return writer->getByteOrder();
- }
+ try
+ {
+ return writer->getByteOrder();
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
return 0;
}
@@ -3522,14 +3522,14 @@
return;
}
- try
- {
- return writer->setByteOrder(newByteOrder);
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ try
+ {
+ return writer->setByteOrder(newByteOrder);
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
char
@@ -3547,17 +3547,17 @@
return -1;
}
- try
- {
- int srid = writer->getIncludeSRID();
+ try
+ {
+ int srid = writer->getIncludeSRID();
return static_cast<char>(srid);
- }
+ }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return -1;
- }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return -1;
+ }
}
void
@@ -3575,14 +3575,14 @@
return;
}
- try
- {
- writer->setIncludeSRID(newIncludeSRID);
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ try
+ {
+ writer->setIncludeSRID(newIncludeSRID);
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
@@ -3607,18 +3607,18 @@
const geos::geom::prep::PreparedGeometry* prep = NULL;
try
- {
- prep = geos::geom::prep::PreparedGeometryFactory::prepare(g);
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
-
+ {
+ prep = geos::geom::prep::PreparedGeometryFactory::prepare(g);
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
+
return prep;
}
@@ -3627,12 +3627,12 @@
{
GEOSContextHandleInternal_t *handle = 0;
- try
- {
- delete a;
- }
- catch (const std::exception &e)
- {
+ try
+ {
+ delete a;
+ }
+ catch (const std::exception &e)
+ {
if ( 0 == extHandle )
{
return;
@@ -3644,10 +3644,10 @@
return;
}
- handle->ERROR_MESSAGE("%s", e.what());
- }
- catch (...)
- {
+ handle->ERROR_MESSAGE("%s", e.what());
+ }
+ catch (...)
+ {
if ( 0 == extHandle )
{
return;
@@ -3659,8 +3659,8 @@
return;
}
- handle->ERROR_MESSAGE("Unknown exception thrown");
- }
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ }
}
char
@@ -3678,22 +3678,22 @@
return 2;
}
- try
- {
- bool result;
- result = pg1->contains(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ try
+ {
+ bool result;
+ result = pg1->contains(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
char
@@ -3711,22 +3711,22 @@
return 2;
}
- try
- {
- bool result;
- result = pg1->containsProperly(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ try
+ {
+ bool result;
+ result = pg1->containsProperly(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
char
@@ -3744,22 +3744,22 @@
return 2;
}
- try
- {
- bool result;
- result = pg1->covers(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ try
+ {
+ bool result;
+ result = pg1->covers(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
char
@@ -3777,22 +3777,22 @@
return 2;
}
- try
- {
- bool result;
- result = pg1->intersects(g2);
- return result;
- }
- catch (const std::exception &e)
- {
- handle->ERROR_MESSAGE("%s", e.what());
- return 2;
- }
- catch (...)
- {
- handle->ERROR_MESSAGE("Unknown exception thrown");
- return 2;
- }
+ try
+ {
+ bool result;
+ result = pg1->intersects(g2);
+ return result;
+ }
+ catch (const std::exception &e)
+ {
+ handle->ERROR_MESSAGE("%s", e.what());
+ return 2;
+ }
+ catch (...)
+ {
+ handle->ERROR_MESSAGE("Unknown exception thrown");
+ return 2;
+ }
}
} /* extern "C" */
More information about the geos-commits
mailing list