Definition at line 72 of file geometry_inout.c.
References geometry_to_path(), gserialized_get_type(), lwgeom_as_lwpoint(), lwgeom_from_gserialized(), lwgeom_is_empty(), lwpoint_free(), lwpoint_get_x(), lwpoint_get_y(), PG_FUNCTION_INFO_V1(), POINTTYPE, struct_point::x, and struct_point::y.
Referenced by point_to_geometry().
79 POSTGIS_DEBUG(2,
"geometry_to_point called");
81 if ( PG_ARGISNULL(0) )
84 geom = PG_GETARG_GSERIALIZED_P(0);
87 elog(ERROR,
"geometry_to_point only accepts Points");
101 PG_FREE_IF_COPY(geom,0);
103 PG_RETURN_POINT_P(point);
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwpoint_free(LWPOINT *pt)
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
double lwpoint_get_x(const LWPOINT *point)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
double lwpoint_get_y(const LWPOINT *point)
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...