PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ pointonsurface()

Datum pointonsurface ( PG_FUNCTION_ARGS  )

Definition at line 1251 of file postgis/lwgeom_geos.c.

References centroid(), dumpnode::geom, geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_pointonsurface(), and PG_FUNCTION_INFO_V1().

Referenced by geos_difference().

1252 {
1253  GSERIALIZED *geom, *result;
1254  LWGEOM *lwgeom, *lwresult;
1255 
1256  geom = PG_GETARG_GSERIALIZED_P(0);
1257 
1258  lwgeom = lwgeom_from_gserialized(geom);
1259  lwresult = lwgeom_pointonsurface(lwgeom);
1260  lwgeom_free(lwgeom);
1261  PG_FREE_IF_COPY(geom, 0);
1262 
1263  if (!lwresult) PG_RETURN_NULL();
1264 
1265  result = geometry_serialize(lwresult);
1266  lwgeom_free(lwresult);
1267  PG_RETURN_POINTER(result);
1268 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
LWGEOM * lwgeom_pointonsurface(const LWGEOM *geom)
LWGEOM * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
Here is the call graph for this function:
Here is the caller graph for this function: