PostGIS  2.1.10dev-r@@SVN_REVISION@@
sfcgal_prepared_geometry_t* POSTGIS2SFCGALPreparedGeometry ( GSERIALIZED pglwgeom)

Definition at line 80 of file postgis/lwgeom_sfcgal.c.

References gserialized_get_srid(), lwerror(), LWGEOM2SFCGAL(), lwgeom_free(), and lwgeom_from_gserialized().

81 {
82  sfcgal_geometry_t* g;
83  LWGEOM *lwgeom = lwgeom_from_gserialized(pglwgeom);
84 
85  if (!lwgeom)
86  {
87  lwerror("POSTGIS2SFCGALPreparedGeometry: Unable to deserialize input");
88  }
89  g = LWGEOM2SFCGAL(lwgeom);
90 
91  lwgeom_free(lwgeom);
92 
93  return sfcgal_prepared_geometry_create_from_geometry(g, gserialized_get_srid(pglwgeom));
94 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
sfcgal_geometry_t * LWGEOM2SFCGAL(const LWGEOM *geom)
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
Definition: g_serialized.c:70

Here is the call graph for this function: