PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ ST_Points()

Datum ST_Points ( PG_FUNCTION_ARGS  )

Definition at line 2865 of file lwgeom_functions_basic.c.

References dumpnode::geom, geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), lwmpoint_as_lwgeom(), lwmpoint_free(), and lwmpoint_from_lwgeom().

Referenced by ST_Scale().

2866 {
2867  if (PG_ARGISNULL(0))
2868  {
2869  PG_RETURN_NULL();
2870  }
2871  else
2872  {
2873  GSERIALIZED* geom = PG_GETARG_GSERIALIZED_P(0);
2874  GSERIALIZED* ret;
2875  LWGEOM* lwgeom = lwgeom_from_gserialized(geom);
2876  LWMPOINT* result = lwmpoint_from_lwgeom(lwgeom);
2877 
2878  lwgeom_free(lwgeom);
2879 
2880  ret = geometry_serialize(lwmpoint_as_lwgeom(result));
2881  lwmpoint_free(result);
2882  PG_RETURN_POINTER(ret);
2883  }
2884 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1063
LWMPOINT * lwmpoint_from_lwgeom(const LWGEOM *g)
Definition: lwmpoint.c:124
void lwmpoint_free(LWMPOINT *mpt)
Definition: lwmpoint.c:72
LWGEOM * geom
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
LWGEOM * lwmpoint_as_lwgeom(const LWMPOINT *obj)
Definition: lwgeom.c:227
Here is the call graph for this function:
Here is the caller graph for this function: