PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ POSTGIS2SFCGALPreparedGeometry()

sfcgal_prepared_geometry_t* POSTGIS2SFCGALPreparedGeometry ( GSERIALIZED pglwgeom)

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

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

99 {
100  sfcgal_geometry_t* g;
101  LWGEOM *lwgeom = lwgeom_from_gserialized(pglwgeom);
102 
103  if (!lwgeom)
104  {
105  lwpgerror("POSTGIS2SFCGALPreparedGeometry: Unable to deserialize input");
106  }
107  g = LWGEOM2SFCGAL(lwgeom);
108 
109  lwgeom_free(lwgeom);
110 
111  return sfcgal_prepared_geometry_create_from_geometry(g, gserialized_get_srid(pglwgeom));
112 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
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:100
Here is the call graph for this function: