[gdal-dev] When does the env var GDAL_DATA get processed?
Ari Jolma
ari.jolma at tkk.fi
Thu May 7 14:18:57 EDT 2009
brettwiesner kirjoitti:
> Hi,
>
> I have an application that programatically sets the GDAL_DATA
> environment variable. However, when I do this I get errors
> complaining that it can't find GDAL_DATA. When I use an application
> like process explorer to see the environment of the process I see that
> I am correctly setting the environment variable to what I want. If I
> run the application from a batch file that "sets" the env var before
> running the application then things work.
>
> Because I can see from process explorer that I'm correctly setting the
> env var for the process, I am left to believe that some dll get's
> loaded and the GDAL_DATA env var is used before my code gets a chance
> to set it. Is this possible? When/ where does the value of the env var
> GDAL_DATA get used?
Does the error message you get specifically mention GDAL_DATA? I.e.,
does it contain "...Try setting the GDAL_DATA environment variable..."?
I believe that's the only error message which refers to GDAL_DATA and
it's called from OGRSpatialReference::importFromEPSGA in
ogr_fromepsg.cpp. That method "Initialize SRS based on EPSG GCS or PCS
code." (from docs). It shoudn't be called in an initialization of a DLL.
GDAL_DATA is used often when GDAL needs to find files, but if GDAL_DATA
is not found there's no complaints.
Regards,
Ari
>
> Thanks,
> Brett
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
--
Prof. Ari Jolma
Environmental Management Information Technology
Teknillinen Korkeakoulu / Helsinki University of Technology
tel: +358 9 4511 address: POBox 5300, 02015 TKK, Finland
Email: ari.jolma at tkk.fi URL: http://geoinformatics.tkk.fi
More information about the gdal-dev
mailing list