id summary reporter owner description type status priority milestone component version severity resolution keywords cc 6543 Find GDAL_DATA using INST_DATA without execution GDALAllRegister Bishop warmerdam "Some programs use GDAL functions without register any driver. For example '''crssync''' from QGIS (https://github.com/qgis/QGIS/blob/master/src/crssync/main.cpp). This program search SpatialReference definitions from various sources, include GDAL_DATA folder (gcs.csv, pcs.csv, vertcs.csv, compdcs.csv, geoccs.csv, epsg.wkt, esri_extra.wkt). With self build GDAL on Linux there is no problem, as GDAL_DATA path will be: /usr/local/share/gdal In CPLFinderInit function using such default paths: 1. /usr/share/gdal 2. /usr/local/share/gdal If libgdal install from packages, the path to GDAL_DATA set to: /usr/share/gdal/. As result, crssync did not find GDAL_DATA and QGIS have empty srs.db. I suggest to add few lines to CPLFinderInit (cpl_findfile.cpp): {{{ static FindFileTLS* CPLFinderInit() { FindFileTLS* pTLSData = CPLGetFindFileTLS(); if( pTLSData != NULL && !pTLSData->bFinderInitialized ) { pTLSData->bFinderInitialized = TRUE; CPLPushFileFinder( CPLDefaultFindFile ); CPLPushFinderLocation( ""."" ); if( CPLGetConfigOption( ""GDAL_DATA"", NULL ) != NULL ) { CPLPushFinderLocation( CPLGetConfigOption( ""GDAL_DATA"", NULL ) ); } else { #ifdef INST_DATA CPLPushFinderLocation( INST_DATA ); #endif #ifdef GDAL_PREFIX #ifdef MACOSX_FRAMEWORK CPLPushFinderLocation( GDAL_PREFIX ""/Resources/gdal"" ); #else CPLPushFinderLocation( GDAL_PREFIX ""/share/gdal"" ); #endif #else CPLPushFinderLocation( ""/usr/local/share/gdal"" ); #endif } } return pTLSData; } }}} I can add this code if there are no objections." enhancement closed normal default svn-trunk normal fixed port, CPLFinder, find_file, GDAL_DATA