PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_Points()

Datum ST_Points ( PG_FUNCTION_ARGS  )

Definition at line 2848 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().

2849 {
2850  if (PG_ARGISNULL(0))
2851  {
2852  PG_RETURN_NULL();
2853  }
2854  else
2855  {
2856  GSERIALIZED* geom = PG_GETARG_GSERIALIZED_P(0);
2857  GSERIALIZED* ret;
2858  LWGEOM* lwgeom = lwgeom_from_gserialized(geom);
2859  LWMPOINT* result = lwmpoint_from_lwgeom(lwgeom);
2860 
2861  lwgeom_free(lwgeom);
2862 
2863  ret = geometry_serialize(lwmpoint_as_lwgeom(result));
2864  lwmpoint_free(result);
2865  PG_RETURN_POINTER(ret);
2866  }
2867 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWMPOINT * lwmpoint_from_lwgeom(const LWGEOM *g)
Definition: lwmpoint.c:127
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:263
Here is the call graph for this function:
Here is the caller graph for this function: