MCPcopy Create free account
hub / github.com/Kitware/VTK / proj_init_info

Function proj_init_info

ThirdParty/libproj/vtklibproj/src/4D_api.cpp:1798–1892  ·  view source on GitHub ↗

/

Source from the content-addressed store, hash-verified

1796
1797/*****************************************************************************/
1798PJ_INIT_INFO proj_init_info(const char *initname){
1799/******************************************************************************
1800 Information about a named init file.
1801
1802 Maximum length of initname is 64.
1803
1804 Returns PJ_INIT_INFO struct.
1805
1806 If the init file is not found all members of the return struct are set
1807 to the empty string.
1808
1809 If the init file is found, but the metadata is missing, the value is
1810 set to "Unknown".
1811******************************************************************************/
1812 int file_found;
1813 char param[80], key[74];
1814 paralist *start, *next;
1815 PJ_INIT_INFO ininfo;
1816 PJ_CONTEXT *ctx = pj_get_default_ctx();
1817
1818 memset(&ininfo, 0, sizeof(PJ_INIT_INFO));
1819
1820 file_found = pj_find_file(ctx, initname, ininfo.filename, sizeof(ininfo.filename));
1821 if (!file_found || strlen(initname) > 64) {
1822 if( strcmp(initname, "epsg") == 0 || strcmp(initname, "EPSG") == 0 ) {
1823 const char* val;
1824
1825 proj_context_errno_set( ctx, 0 );
1826
1827 strncpy (ininfo.name, initname, sizeof(ininfo.name) - 1);
1828 strcpy(ininfo.origin, "EPSG");
1829 val = proj_context_get_database_metadata(ctx, "EPSG.VERSION");
1830 if( val ) {
1831 strncpy(ininfo.version, val, sizeof(ininfo.version) - 1);
1832 }
1833 val = proj_context_get_database_metadata(ctx, "EPSG.DATE");
1834 if( val ) {
1835 strncpy(ininfo.lastupdate, val, sizeof(ininfo.lastupdate) - 1);
1836 }
1837 return ininfo;
1838 }
1839
1840 if( strcmp(initname, "IGNF") == 0 ) {
1841 const char* val;
1842
1843 proj_context_errno_set( ctx, 0 );
1844
1845 strncpy (ininfo.name, initname, sizeof(ininfo.name) - 1);
1846 strcpy(ininfo.origin, "IGNF");
1847 val = proj_context_get_database_metadata(ctx, "IGNF.VERSION");
1848 if( val ) {
1849 strncpy(ininfo.version, val, sizeof(ininfo.version) - 1);
1850 }
1851 val = proj_context_get_database_metadata(ctx, "IGNF.DATE");
1852 if( val ) {
1853 strncpy(ininfo.lastupdate, val, sizeof(ininfo.lastupdate) - 1);
1854 }
1855 return ininfo;

Callers

nothing calls this directly

Calls 7

pj_get_default_ctxFunction · 0.85
pj_find_fileFunction · 0.85
proj_context_errno_setFunction · 0.85
pj_mkparamFunction · 0.85
pj_expand_initFunction · 0.85
pj_paramFunction · 0.85

Tested by

no test coverage detected