453 if ( PG_ARGISNULL(0) )
456 geom = PG_GETARG_GSERIALIZED_P(0);
459 if ( PG_NARGS() > 1 && !PG_ARGISNULL(1) )
474 if ( PG_NARGS() > 2 && !PG_ARGISNULL(2) )
476 int option = PG_GETARG_INT32(2);
478 if ( option & 2 || option & 4 )
492 "SRID %i unknown in spatial_ref_sys table",
509 result = cstring_to_text(geojson);
512 PG_FREE_IF_COPY(geom, 0);
513 PG_RETURN_TEXT_P(result);
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
#define SRID_UNKNOWN
Unknown SRID value.
char * lwgeom_to_geojson(const LWGEOM *geo, char *srs, int precision, int has_bbox)
Takes a GEOMETRY and returns a GeoJson representation.
char * getSRSbySRID(FunctionCallInfo fcinfo, int srid, bool short_crs)