[gdal-dev] GDAL C# bindings and TIFF read projection trouble
Frank Warmerdam
warmerdam at pobox.com
Tue Apr 1 14:04:35 EDT 2008
Kerry Halligan wrote:
> Tamas and Frank,
>
> Thank you both for your replies. I tried Tamas' suggestion and found the
> same problem. I suspect that my problem is that it is not finding the
> correct CSV files as Frank suggested. Because I am using the prebuilt
> binaries from FWTools, I have been copying the DLL files (e.g., gdal_csharp)
> into my c# application directories (debug/release) but linking to support
> files by simply including the appropriate directories (in my case:
> C:\Program Files\FWTools1.3.9\bin\;C:\Program Files\FWTools1.3.9) in the
> PATH environment variable. I am guessing that this works fine for libraries
> but does not help it locate the CSV files, is that correct?
Kerry,
That is correct.
> What is the
> right way to tell a C# application where/how to find these files? My
> apologies if this is a super basic question or has been answered repeated on
> this list - I am obviously new to this...
You could define them in the system environment (using the GDAL_DATA
and perhaps the GEOTIFF_CSV environment variables). It should also
be possible to call the GDALSetConfigOption() function (I'm not sure
what the C# binding is called) to set these values. This should be
one of the first things you do with GDAL - before the first GDALOpen()
at least.
In C/C++:
CPLSetConfigOption( "GDAL_DATA", "C:\\gdal\\data" );
The GDAL plugin loader also automatically searches for plugins in
a directory relative to the .exe. This same sort of .exe relative
searching might make sense for GDAL_DATA, at least on win32 where it
is easy to find the .exe path. I'm not sure if this sort of thing
works smoothly in .net applications or not.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo, http://osgeo.org
More information about the gdal-dev
mailing list