73{
78
79 POSTGIS_DEBUG(2, "geometry_to_point called");
80
81 if ( PG_ARGISNULL(0) )
82 PG_RETURN_NULL();
83
84 geom = PG_GETARG_GSERIALIZED_P(0);
85
87 elog(ERROR, "geometry_to_point only accepts Points");
88
90
92 PG_RETURN_NULL();
93
95
99
101 PG_FREE_IF_COPY(geom,0);
102
103 PG_RETURN_POINT_P(point);
104}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
void lwpoint_free(LWPOINT *pt)
double lwpoint_get_x(const LWPOINT *point)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
double lwpoint_get_y(const LWPOINT *point)
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)