This project has moved and is read-only. For the latest updates, please go here.

GDAL exception when loading specific GeoTiff

Topics: SharpMap v0.9 / v1.x
Jan 22, 2016 at 4:27 PM
I have successfully used SharpMap 1.1 with GDAL 1.9.2 to load Tif files like this:

var layer = new GdalRasterLayer(file, file);

However I have just been provided with a Tif file by my client, which causes the following exception when that line is executed:

Unable to open EPSG support file gcs.csv.
Try setting the GDAL_DATA environment variable to point to the
directory containing EPSG csv files.
at SharpMap.Layers.GdalRasterLayer.OpenDataset(String imageFilename)

Now clearly it must have access go the gcs file because other Tif's are loading fine. So I am wondering if this error is thrown up because it can't find a valid entry in the gcs for my Tif?

My Tif projection is as follows:

PROJCS["NAD83 / UTM zone 18N",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.2572221010002,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-75],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","26918"]]

I would have liked to try upgrading to latest GDAL 1.11.1 to see if that helped, but SharpMap expects gdal_csharp 1.0.4 which is GDAL 1.9.2

Any suggestions appreciated!

Jan 25, 2016 at 7:42 AM
Using Gdal.1.9.2 with SharpMap, you should have the following folder structure in your output directory:
The \gdal\data\ folder should contain a/the gcs.csv file.
Marked as answer by timdavey on 1/27/2016 at 7:06 AM
Jan 25, 2016 at 7:40 PM
You are absolutely right, I should have that folder, and it had gone missing! I am still puzzled though, how existing TIFs were being processed with the gcs.csv file (indeed the whole folder) missing....

Thank you for such a fast response :)