544 GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P_COPY(0);
550 if ( (
int)lwgeom->
srid <= 0 )
556 srid_check_latlong(fcinfo, lwgeom->
srid);
563 errmsg_internal(
"Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY" ))
572 g_ser = geography_serialize(lwgeom);
577 PG_FREE_IF_COPY(geom, 0);
578 PG_RETURN_POINTER(g_ser);
void geography_valid_type(uint8_t type)
The geography type only support POINT, LINESTRING, POLYGON, MULTI* variants of same,...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_set_geodetic(LWGEOM *geom, int value)
Set the FLAGS geodetic bit on geometry an all sub-geometries and pointlists.
void lwgeom_free(LWGEOM *geom)
void lwgeom_drop_bbox(LWGEOM *lwgeom)
Call this function to drop BBOX and SRID from LWGEOM.
int lwgeom_force_geodetic(LWGEOM *geom)
Force coordinates of LWGEOM into geodetic range (-180, -90, 180, 90)
int lwgeom_nudge_geodetic(LWGEOM *geom)
Gently move coordinates of LWGEOM if they are close enough into geodetic range.
#define LW_TRUE
Return types for functions with status returns.
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.