** Prototypes end
*/
-#define BUFSIZE 256
-static char loggederror[BUFSIZE];
+char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE];
-static void
-errorlogger(const char *fmt, ...)
+extern void
+lwgeom_geos_error(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
/* Call the supplied function */
- if ( BUFSIZE-1 < vsnprintf(loggederror, BUFSIZE-1, fmt, ap) )
+ if ( LWGEOM_GEOS_ERRMSG_MAXSIZE-1 < vsnprintf(lwgeom_geos_errmsg, LWGEOM_GEOS_ERRMSG_MAXSIZE-1, fmt, ap) )
{
- loggederror[BUFSIZE-1] = '\0';
+ lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE-1] = '\0';
}
va_end(ap);
geom1 = (PG_LWGEOM *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
geom2 = (PG_LWGEOM *) PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
g2 = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g2 ) /* exception thrown */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
geom2 = (PG_LWGEOM *) PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
densifyFrac = PG_GETARG_FLOAT8(2);
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
g2 = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
}
/* Ok, we really need geos now ;) */
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
/*
** First, see if all our elements are POLYGON/MULTIPOLYGON
{
/* TODO: release GEOS allocated memory ! */
lwerror("One of the geometries in the set "
- "could not be converted to GEOS: %s", loggederror);
+ "could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
geoms[curgeom] = g;
if ( 0 == g ) /* exception thrown at construction */
{
/* TODO: cleanup all GEOS memory */
- lwerror("Geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
geoms[curgeom] = g;
geos_result = (GEOSGeometry *)POSTGIS2GEOS(geom);
if ( 0 == geos_result ) /* exception thrown at construction */
{
- lwerror("geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
SRID = pglwgeom_getSRID(geom);
{
/* TODO: release GEOS allocated memory ! */
lwerror("First argument geometry could not be converted to GEOS: %s",
- loggederror);
+ lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
SRID = pglwgeom_getSRID(geom1);
errorIfSRIDMismatch(SRID, pglwgeom_getSRID(geom2));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
SRID = pglwgeom_getSRID(geom1);
errorIfSRIDMismatch(SRID, pglwgeom_getSRID(geom2));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
SRID = pglwgeom_getSRID(geom1);
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1 );
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
if (g3 == NULL)
{
- elog(NOTICE,"GEOSBoundary(): %s", loggederror);
+ elog(NOTICE,"GEOSBoundary(): %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL(); /* never get here */
}
geom1 = (PG_LWGEOM *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
SRID = pglwgeom_getSRID(geom1);
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
geom1 = (PG_LWGEOM *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
tolerance = PG_GETARG_FLOAT8(1);
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
nargs = PG_NARGS();
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
SRID = pglwgeom_getSRID(geom1);
errorIfSRIDMismatch(SRID, pglwgeom_getSRID(geom2));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
POSTGIS_DEBUG(3, "intersection() START");
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
SRID = pglwgeom_getSRID(geom1);
errorIfSRIDMismatch(SRID, pglwgeom_getSRID(geom2));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
geom1 = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- elog(WARNING, "GEOSPointOnSurface(): %s", loggederror);
+ elog(WARNING, "GEOSPointOnSurface(): %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
if (g3 == NULL)
{
- elog(WARNING, "GEOSPointOnSurface(): %s", loggederror);
+ elog(WARNING, "GEOSPointOnSurface(): %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL(); /* never get here */
}
geom = (PG_LWGEOM *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
geosgeom = (GEOSGeometry *)POSTGIS2GEOS(geom);
PROFSTOP(PROF_P2G1);
if ( 0 == geosgeom ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
geom1 = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
/* should we drop the following
* notice now that we have ST_isValidReason ?
*/
- lwnotice("%s", loggederror);
+ lwnotice("%s", lwgeom_geos_errmsg);
lwgeom_release(lwgeom);
PG_RETURN_BOOL(FALSE);
}
geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom);
if ( g1 )
else
{
/* we don't use pstrdup here as we free later */
- reason_str = strdup(loggederror);
+ reason_str = strdup(lwgeom_geos_errmsg);
}
geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom);
}
else
{
- /* TODO: check loggederror for validity error */
- reason = pstrdup(loggederror);
+ /* TODO: check lwgeom_geos_errmsg for validity error */
+ reason = pstrdup(lwgeom_geos_errmsg);
}
/* the boolean validity */
if ( box2.ymin > box2.ymax ) PG_RETURN_BOOL(FALSE);
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
POSTGIS_DEBUGF(3, "Contains: type1: %d, type2: %d", type1, type2);
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
#ifdef PREPARED_GEOM
prep_cache = GetPrepGeomCache( fcinfo, geom1, 0 );
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("Geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
POSTGIS_DEBUG(4, "containsPrepared: cache is live, running preparedcontains");
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
g2 = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
PG_RETURN_BOOL(FALSE);
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
#ifdef PREPARED_GEOM
prep_cache = GetPrepGeomCache( fcinfo, geom1, 0 );
GEOSGeometry *g = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
result = GEOSPreparedContainsProperly( prep_cache->prepared_geom, g);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
g2 = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
POSTGIS_DEBUGF(3, "Covers: type1: %d, type2: %d", type1, type2);
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
#ifdef PREPARED_GEOM
prep_cache = GetPrepGeomCache( fcinfo, geom1, 0 );
GEOSGeometry *g1 = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
result = GEOSPreparedCovers( prep_cache->prepared_geom, g1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
g2 = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
}
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
}
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
}
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
}
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
#ifdef PREPARED_GEOM
prep_cache = GetPrepGeomCache( fcinfo, geom1, geom2 );
GEOSGeometry *g = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g ) /* exception thrown at construction */
{
- lwerror("Geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
result = GEOSPreparedIntersects( prep_cache->prepared_geom, g);
GEOSGeometry *g = (GEOSGeometry *)POSTGIS2GEOS(geom1);
if ( 0 == g ) /* exception thrown at construction */
{
- lwerror("Geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
result = GEOSPreparedIntersects( prep_cache->prepared_geom, g);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
g2 = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
}
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1 );
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
}
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
errorIfGeometryCollection(geom1,geom2);
errorIfSRIDMismatch(pglwgeom_getSRID(geom1), pglwgeom_getSRID(geom2));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
g2 = (GEOSGeometry *)POSTGIS2GEOS(geom2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
errorIfGeometryCollection(geom1,geom2);
errorIfSRIDMismatch(pglwgeom_getSRID(geom1), pglwgeom_getSRID(geom2));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1 );
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
g2 = (GEOSGeometry *)POSTGIS2GEOS(geom2 );
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
if ( box2.ymin != box2.ymin ) PG_RETURN_BOOL(FALSE);
}
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
PROFSTOP(PROF_P2G2);
if ( 0 == g2 ) /* exception thrown at construction */
{
- lwerror("Second argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Second argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
GEOSGeom_destroy(g1);
PG_RETURN_NULL();
}
if (lwgeom_getnumgeometries(SERIALIZED_FORM(geom)) == 0)
PG_RETURN_BOOL(true);
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
result = GEOSisSimple(g1);
if (lwgeom_getnumgeometries(SERIALIZED_FORM(geom)) == 0)
PG_RETURN_BOOL(false);
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom );
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
result = GEOSisRing(g1);
LWGEOM_UNPARSER_RESULT lwg_unparser_result;
#endif
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
if ( nelems == 0 ) PG_RETURN_NULL();
/* Ok, we really need geos now ;) */
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
vgeoms = palloc(sizeof(GEOSGeometry *)*nelems);
offset = 0;
g = (GEOSGeometry *)POSTGIS2GEOS(geom);
if ( 0 == g ) /* exception thrown at construction */
{
- lwerror("Geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("Geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
vgeoms[i] = g;
geom1 = (PG_LWGEOM *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
PROFSTART(PROF_P2G1);
g1 = (GEOSGeometry *)POSTGIS2GEOS(geom1);
PROFSTOP(PROF_P2G1);
if ( 0 == g1 ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
POSTGIS_DEBUGF(3, "LWGEOM_buildarea got geom @ %p", geom);
- initGEOS(lwnotice, errorlogger);
+ initGEOS(lwnotice, lwgeom_geos_error);
geos_in = POSTGIS2GEOS(geom);
if ( 0 == geos_in ) /* exception thrown at construction */
{
- lwerror("First argument geometry could not be converted to GEOS: %s", loggederror);
+ lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
PG_RETURN_NULL();
}
geos_out = LWGEOM_GEOS_buildArea(geos_in);