PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwgeom_geos_noop()

LWGEOM* lwgeom_geos_noop ( const LWGEOM geom_in)

Convert an LWGEOM to a GEOS Geometry and convert back – for debug only.

Definition at line 1395 of file liblwgeom/lwgeom_geos.c.

References LWGEOM::flags, FLAGS_GET_Z, GEOS2LWGEOM(), lwerror(), LWGEOM2GEOS(), lwgeom_geos_errmsg, lwgeom_geos_error(), and lwnotice().

Referenced by test_geos_noop().

1396 {
1397  GEOSGeometry *geosgeom;
1398  LWGEOM* geom_out;
1399 
1400  int is3d = FLAGS_GET_Z(geom_in->flags);
1401 
1402  initGEOS(lwnotice, lwgeom_geos_error);
1403  geosgeom = LWGEOM2GEOS(geom_in, 0);
1404  if ( ! geosgeom ) {
1405  lwerror("Geometry could not be converted to GEOS: %s",
1407  return NULL;
1408  }
1409  geom_out = GEOS2LWGEOM(geosgeom, is3d);
1410  GEOSGeom_destroy(geosgeom);
1411  if ( ! geom_out ) {
1412  lwerror("GEOS Geometry could not be converted to LWGEOM: %s",
1414  }
1415  return geom_out;
1416 
1417 }
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:61
uint8_t flags
Definition: liblwgeom.h:381
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
void lwgeom_geos_error(const char *fmt,...)
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, int autofix)
LWGEOM * GEOS2LWGEOM(const GEOSGeometry *geom, char want3d)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
Here is the call graph for this function:
Here is the caller graph for this function: