PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ POSTGIS2SFCGALPreparedGeometry()

sfcgal_prepared_geometry_t* POSTGIS2SFCGALPreparedGeometry ( GSERIALIZED pglwgeom)

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

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

88 {
89  sfcgal_geometry_t* g;
90  LWGEOM *lwgeom = lwgeom_from_gserialized(pglwgeom);
91 
92  if (!lwgeom)
93  {
94  lwpgerror("POSTGIS2SFCGALPreparedGeometry: Unable to deserialize input");
95  }
96  g = LWGEOM2SFCGAL(lwgeom);
97 
98  lwgeom_free(lwgeom);
99 
100  return sfcgal_prepared_geometry_create_from_geometry(g, gserialized_get_srid(pglwgeom));
101 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
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:69
Here is the call graph for this function: