Can anyone help me out with problems reading the correct projection information from a TIFF image?<br><br>I am using GDAL C# bindings from FWTools (1.3.9) and am getting unexpected results for projection information of TIFF files. If I use the gdalinfo utility I get the correct information, but if I use the gdal_csharp bindings I get "unnamed" as the projection. This is causing difficulty when comparing projections before processing multiple files. I am assuming this is a data and/or operator error, rather than a bug, but can anyone tell me what I might be doing wrong? I also tried this with the most recent version of FWTools and received the same results.<br>
<br>Sample outputs are listed below:<br><br><b>gdalinfo results:</b><br><br>C:\Program Files\FWTools1.3.9>gdalinfo E:\Imagery\ortho\drcog\3130375_1610645.tif<br>Driver: GTiff/GeoTIFF<br>Files: E:\Imagery\ortho\drcog\3130375_1610645.tif<br>
Size is 5000, 5000<br>Coordinate System is:<br>PROJCS["NAD83 / Colorado Central",<br> GEOGCS["NAD83",<br> DATUM["North_American_Datum_1983",<br> SPHEROID["GRS 1980",6378137,298.2572221010002,<br>
AUTHORITY["EPSG","7019"]],<br> AUTHORITY["EPSG","6269"]],<br> PRIMEM["Greenwich",0],<br> UNIT["degree",0.0174532925199433],<br>
AUTHORITY["EPSG","4269"]],<br> PROJECTION["Lambert_Conformal_Conic_2SP"],<br> PARAMETER["standard_parallel_1",39.75],<br> PARAMETER["standard_parallel_2",38.45],<br>
PARAMETER["latitude_of_origin",37.83333333333334],<br> PARAMETER["central_meridian",-105.5],<br> PARAMETER["false_easting",3000000.000316083],<br> PARAMETER["false_northing",999999.999996],<br>
UNIT["US survey foot",0.3048006096012192,<br> AUTHORITY["EPSG","9003"]],<br> AUTHORITY["EPSG","26954"]]<br>Origin = (3130375.000000000000000,1615645.000000000000000)<br>
Pixel Size = (1.000000000000000,-1.000000000000000)<br>Metadata:<br> AREA_OR_POINT=Area<br> TIFFTAG_SOFTWARE=Adobe Photoshop 7.0<br> TIFFTAG_DATETIME=2006:10:27 09:33:52<br> TIFFTAG_XRESOLUTION=72<br> TIFFTAG_YRESOLUTION=72<br>
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)<br>Corner Coordinates:<br>Upper Left ( 3130375.000, 1615645.000) (105d 2'16.18"W, 39d31'22.13"N)<br>Lower Left ( 3130375.000, 1610645.000) (105d 2'16.50"W, 39d30'32.71"N)<br>
Upper Right ( 3135375.000, 1615645.000) (105d 1'12.37"W, 39d31'21.87"N)<br>Lower Right ( 3135375.000, 1610645.000) (105d 1'12.71"W, 39d30'32.45"N)<br>Center ( 3132875.000, 1613145.000) (105d 1'44.44"W, 39d30'57.29"N)<br>
Band 1 Block=5000x1 Type=Byte, ColorInterp=Red<br>Band 2 Block=5000x1 Type=Byte, ColorInterp=Green<br>Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue<br><br><b>csharp code:<br><br>Gdal.AllRegister();<br>Dataset ds = Gdal.Open(infile, Access.GA_ReadOnly);<br>
// get the projection<br>string proj = ds.GetProjection();<br><br>printing 'proj' produces:<br></b><br>"PROJCS[\"unnamed\",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\"]],UNIT[\"US survey foot\",0.3048006096012192,AUTHORITY[\"EPSG\",\"9003\"]],AUTHORITY[\"EPSG\",\"26954\"]]"<br>