58 text *format_text_input = PG_GETARG_TEXT_P(1);
59 const char *format = text_to_cstring(format_text_input);
65 PG_FREE_IF_COPY(gs, 0);
66 lwpgerror(
"ST_AsMARC21: Input geometry has unknown (%d) SRID", srid);
71 if (lwproj_lookup(srid, srid, &lwproj) ==
LW_FAILURE) {
73 PG_FREE_IF_COPY(gs, 0);
74 lwpgerror(
"ST_AsMARC21: Failure reading projections from spatial_ref_sys.");
95 if (!lwproj_is_latlong(lwproj)) {
97 PG_FREE_IF_COPY(gs, 0);
98 lwpgerror(
"ST_AsMARC21: Unsupported SRID (%d). Only lon/lat coordinate systems are supported in MARC21/XML Documents.", srid);
106 if (marc21) PG_RETURN_TEXT_P(marc21);
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.
#define SRID_UNKNOWN
Unknown SRID value.
lwvarlena_t * lwgeom_to_marc21(const LWGEOM *geom, const char *format)