[gdal-dev] When does the env var GDAL_DATA get processed?

Tamas Szekeres szekerest at gmail.com
Thu May 7 18:43:06 EDT 2009


2009/5/7 brettwiesner <brettwiesner at gmail.com>

> Yes that's the error message. It goes on the say somthing about trying to
> find gcs.csv which is there but since it can't find the env var, it doesn't
> find the data. This is weird because I set the env var using the win32
> function SetEnvironmentVariable() before the call to OGRSpatialReference is
> made. Since I was setting the variable and getting this message I suspected
> that GDAL_DATA was being read by something at startup.
>

Hi,

I'm afraid you won't be able to set the environment variable this way. GDAL
is using getenv() to retrieve the value which operated on a local copy of
the variables created when the process is started. By this means the env
variable should be set before the process is spawned.



>
> Is there some code I can write that can tell me what gdal thinks the
> GDAL_DATA env var is set to?
>

You should instead use SetConfigOption or PushFinderLocation (both exposed
to the SWIG API) for this purpose.


Best regards,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090508/5f10d8f7/attachment.html


More information about the gdal-dev mailing list