PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ srs_state_codes()

static void srs_state_codes ( const char *  auth_name,
struct srs_data state 
)
static

Definition at line 433 of file postgis/lwgeom_transform.c.

434{
435 /*
436 * Only a subset of supported proj types actually
437 * show up in spatial_ref_sys
438 */
439 #define ntypes 3
440 PJ_TYPE types[ntypes] = {PJ_TYPE_PROJECTED_CRS, PJ_TYPE_GEOGRAPHIC_CRS, PJ_TYPE_COMPOUND_CRS};
441 uint32_t j;
442
443 for (j = 0; j < ntypes; j++)
444 {
445 PJ_CONTEXT *ctx = NULL;
446 int allow_deprecated = 0;
447 PJ_TYPE type = types[j];
448 PROJ_STRING_LIST codes_ptr = proj_get_codes_from_database(ctx, auth_name, type, allow_deprecated);
449 PROJ_STRING_LIST codes = codes_ptr;
450 const char *code;
451 while(codes && *codes)
452 {
453 /* Read current code and move forward one entry */
454 code = *codes++;
455 /* Ensure there is space in the entry list */
456 srs_state_memcheck(state);
457
458 /* Write the entry into the entry list and increment */
459 state->entries[state->num_entries].auth_name = cstring_to_text(auth_name);
460 state->entries[state->num_entries].auth_code = cstring_to_text(code);
461 state->num_entries++;
462 }
463 /* Clean up system allocated memory */
464 proj_string_list_destroy(codes_ptr);
465 }
466}
static void srs_state_memcheck(struct srs_data *state)
#define ntypes
struct srs_entry * entries
text * auth_name
text * auth_code

References srs_entry::auth_code, srs_entry::auth_name, srs_data::entries, ntypes, srs_data::num_entries, and srs_state_memcheck().

Referenced by postgis_srs_codes(), and postgis_srs_entry_all().

Here is the call graph for this function:
Here is the caller graph for this function: