PostGIS  3.4.0dev-r@@SVN_REVISION@@
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages

◆ srs_state_codes()

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

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

421 {
422  /*
423  * Only a subset of supported proj types actually
424  * show up in spatial_ref_sys
425  */
426  #define ntypes 3
427  PJ_TYPE types[ntypes] = {PJ_TYPE_PROJECTED_CRS, PJ_TYPE_GEOGRAPHIC_CRS, PJ_TYPE_COMPOUND_CRS};
428  uint32_t j;
429 
430  for (j = 0; j < ntypes; j++)
431  {
432  PJ_CONTEXT *ctx = NULL;
433  int allow_deprecated = 0;
434  PJ_TYPE type = types[j];
435  PROJ_STRING_LIST codes_ptr = proj_get_codes_from_database(ctx, auth_name, type, allow_deprecated);
436  PROJ_STRING_LIST codes = codes_ptr;
437  const char *code;
438  while(codes && *codes)
439  {
440  /* Read current code and move forward one entry */
441  code = *codes++;
442  /* Ensure there is space in the entry list */
443  srs_state_memcheck(state);
444 
445  /* Write the entry into the entry list and increment */
446  state->entries[state->num_entries].auth_name = cstring_to_text(auth_name);
447  state->entries[state->num_entries].auth_code = cstring_to_text(code);
448  state->num_entries++;
449  }
450  /* Clean up system allocated memory */
451  proj_string_list_destroy(codes_ptr);
452  }
453 }
type
Definition: ovdump.py:42
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, srs_state_memcheck(), and ovdump::type.

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: