Search for projections given extent and (optional) auth_name returns TABLE(auth_name, auth_srid, srtext, proj4text, point_sw, point_ne)
704 #if POSTGIS_PROJ_VERSION < 60
705 elog(ERROR,
"%s is not supported with Proj < 6.0", __func__);
707 FuncCallContext *funcctx;
708 MemoryContext oldcontext;
718 if (SRF_IS_FIRSTCALL())
722 text *auth_name = PG_GETARG_TEXT_P(1);
724 funcctx = SRF_FIRSTCALL_INIT();
725 oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
742 if (get_call_result_type(fcinfo, 0, &funcctx->tuple_desc) != TYPEFUNC_COMPOSITE)
744 ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
745 errmsg(
"%s called with incompatible return type", __func__)));
748 BlessTupleDesc(funcctx->tuple_desc);
749 funcctx->user_fctx = state;
750 MemoryContextSwitchTo(oldcontext);
754 funcctx = SRF_PERCALL_SETUP();
755 state = funcctx->user_fctx;
761 SRF_RETURN_DONE(funcctx);
767 funcctx->tuple_desc);
770 SRF_RETURN_NEXT(funcctx,
result);
773 SRF_RETURN_DONE(funcctx);
char result[OUT_DOUBLE_BUFFER_SIZE]
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
static struct srs_data * srs_state_init()
static Datum srs_tuple_from_entry(const struct srs_entry *entry, TupleDesc tuple_desc)
static void srs_find_planar(const char *auth_name, const LWGEOM *bounds, struct srs_data *state)
struct srs_entry * entries