208 int output_guess_short_srid =
LW_FALSE;
209 const char *srs = NULL;
216 geom = PG_GETARG_GSERIALIZED_P(0);
220 if ( PG_NARGS() > 1 && !PG_ARGISNULL(1) )
232 if (PG_NARGS() > 2 && !PG_ARGISNULL(2))
234 int option = PG_GETARG_INT32(2);
241 output_guess_short_srid =
LW_TRUE;
246 if (srid !=
SRID_UNKNOWN && (output_short_crs || output_long_crs))
248 srs = GetSRSCacheBySRID(fcinfo, srid, !output_long_crs);
252 elog(ERROR,
"SRID %i unknown in spatial_ref_sys table", srid);
int32_t gserialized_get_srid(const GSERIALIZED *g)
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.
lwvarlena_t * lwgeom_to_geojson(const LWGEOM *geo, const char *srs, int precision, int has_bbox)
Takes a GEOMETRY and returns a GeoJson representation.
#define LW_TRUE
Return types for functions with status returns.
#define SRID_UNKNOWN
Unknown SRID value.
#define OUT_DEFAULT_DECIMAL_DIGITS