PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ lwgeom_geos_noop()

LWGEOM* lwgeom_geos_noop ( const LWGEOM geom)

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

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

References LWGEOM::flags, FLAGS_GET_Z, geos_clean(), geos_clean_and_fail(), get_result_srid(), input_lwgeom_to_geos(), lwgeom_geos_error(), lwnotice(), output_geos_as_lwgeom(), and SRID_INVALID.

Referenced by test_geos_noop().

1248 {
1249  LWGEOM* result;
1250  int32_t srid = get_result_srid(geom, NULL, __func__);
1251  uint8_t is3d = FLAGS_GET_Z(geom->flags);
1252  GEOSGeometry* g;
1253 
1254  if (srid == SRID_INVALID) return NULL;
1255 
1256  initGEOS(lwnotice, lwgeom_geos_error);
1257 
1258  if (!input_lwgeom_to_geos(&g, geom, __func__)) return NULL;
1259 
1260  if (!g) return geos_clean_and_fail(g, NULL, NULL, __func__);
1261 
1262  if (!output_geos_as_lwgeom(&g, &result, srid, is3d, __func__))
1263  return geos_clean_and_fail(g, NULL, NULL, __func__);
1264 
1265  geos_clean(g, NULL, NULL);
1266 
1267  return result;
1268 }
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:177
uint8_t flags
Definition: liblwgeom.h:399
static LWGEOM * geos_clean_and_fail(GEOSGeometry *g1, GEOSGeometry *g2, GEOSGeometry *g3, const char *funcname)
static uint8_t output_geos_as_lwgeom(GEOSGeometry **g, LWGEOM **geom, const int32_t srid, const uint8_t is3d, const char *funcname)
void lwgeom_geos_error(const char *fmt,...)
static void geos_clean(GEOSGeometry *g1, GEOSGeometry *g2, GEOSGeometry *g3)
#define SRID_INVALID
Definition: liblwgeom.h:191
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:139
static uint8_t input_lwgeom_to_geos(GEOSGeometry **g, const LWGEOM *geom, const char *funcname)
static int32_t get_result_srid(const LWGEOM *geom1, const LWGEOM *geom2, const char *funcname)
unsigned char uint8_t
Definition: uthash.h:79
Here is the call graph for this function:
Here is the caller graph for this function: