[postgis-devel] [PostGIS] #1678: [raster] GDAL_DATA dependency

PostGIS trac at osgeo.org
Fri Oct 19 08:46:20 PDT 2012


#1678: [raster] GDAL_DATA dependency
--------------------+-------------------------------------------------------
 Reporter:  robe    |       Owner:  pracine      
     Type:  defect  |      Status:  new          
 Priority:  medium  |   Milestone:  PostGIS 2.1.0
Component:  raster  |     Version:  trunk        
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by mloskot):

 I just grabbed the latest PostGIS 2.0.1 installer for Windows and
 PostgreSQL 9.2.

 IMHO, setting GDAL_DATA by the installer is a not a idea.

 Couldn't PostGIS recover the location in run-time, on Windows, and set it
 with GDAL's CPLSetConfigOption according to scheme like this:

  * ''postgis-2.0.dll'' has DllMain defined
  * ''DllMain'' calls ''GetModuleFileName'' to find its own location, e.g.
 {{{
 C:\Program Files (x86)\PostgreSQL\9.2\lib\postgis-2.0.dll
 }}}
  * Assuming both, ''postgis-2.0.dll'' and ''lib\'' are static parts, it's
 easy to find root folder:
 {{{
 C:\Program Files (x86)\PostgreSQL\9.2
 }}}
  * Assuming both, ''gdal-data\'' directory name is static part, it's easy
 to compile GDAL_DATA location:
 {{{
 C:\Program Files (x86)\PostgreSQL\9.2\gdal-data\
 }}}
  * And, stores it in non-exported DLL global:
 {{{
 static char* gPostGISGDALDataFolder = NULL;
 }}}
  * Finally, each PostgreSQL sets its own copy of environment:
 {{{
 CPLSetConfigOption( "GDAL_DATA", gPostGISGDALDataFolder);
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1678#comment:13>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list