345 Datum tuple_data[7] = {0, 0, 0, 0, 0, 0, 0};
346 bool tuple_null[7] = {
true,
true,
true,
true,
true,
true,
true};
347 PJ_CONTEXT * ctx = NULL;
348 const char *
const empty_options[2] = {NULL};
349 const char *
const wkt_options[2] = {
"MULTILINE=NO", NULL};
351 const char * proj4text;
353 double w_lon, s_lat, e_lon, n_lat;
356 PJ *obj = proj_create_from_database(ctx,
359 PJ_CATEGORY_CRS, 0, empty_options);
364 srtext = proj_as_wkt(ctx, obj, PJ_WKT1_GDAL, wkt_options);
365 proj4text = proj_as_proj_string(ctx, obj, PJ_PROJ_4, empty_options);
366 srname = proj_get_name(obj);
367 ok = proj_get_area_of_use(ctx, obj, &w_lon, &s_lat, &e_lon, &n_lat, NULL);
370 tuple_data[0] = PointerGetDatum(entry->
auth_name);
371 tuple_null[0] =
false;
375 tuple_data[1] = PointerGetDatum(entry->
auth_code);
376 tuple_null[1] =
false;
380 tuple_data[2] = PointerGetDatum(cstring_to_text(srname));
381 tuple_null[2] =
false;
385 tuple_data[3] = PointerGetDatum(cstring_to_text(srtext));
386 tuple_null[3] =
false;
390 tuple_data[4] = PointerGetDatum(cstring_to_text(proj4text));
391 tuple_null[4] =
false;
399 tuple_data[5] = PointerGetDatum(g_sw);
400 tuple_null[5] =
false;
401 tuple_data[6] = PointerGetDatum(g_ne);
402 tuple_null[6] =
false;
405 tuple = heap_form_tuple(tuple_desc, tuple_data, tuple_null);
408 return HeapTupleGetDatum(tuple);
LWPOINT * lwpoint_make2d(int32_t srid, double x, double y)