[gdal-dev] GDAL C# bindings and TIFF read projection trouble
Kerry Halligan
halligan.kerry at gmail.com
Mon Mar 31 20:11:24 EDT 2008
Can anyone help me out with problems reading the correct projection
information from a TIFF image?
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.
Sample outputs are listed below:
*gdalinfo results:*
C:\Program Files\FWTools1.3.9>gdalinfo
E:\Imagery\ortho\drcog\3130375_1610645.tif
Driver: GTiff/GeoTIFF
Files: E:\Imagery\ortho\drcog\3130375_1610645.tif
Size is 5000, 5000
Coordinate System is:
PROJCS["NAD83 / Colorado Central",
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["Lambert_Conformal_Conic_2SP"],
PARAMETER["standard_parallel_1",39.75],
PARAMETER["standard_parallel_2",38.45],
PARAMETER["latitude_of_origin",37.83333333333334],
PARAMETER["central_meridian",-105.5],
PARAMETER["false_easting",3000000.000316083],
PARAMETER["false_northing",999999.999996],
UNIT["US survey foot",0.3048006096012192,
AUTHORITY["EPSG","9003"]],
AUTHORITY["EPSG","26954"]]
Origin = (3130375.000000000000000,1615645.000000000000000)
Pixel Size = (1.000000000000000,-1.000000000000000)
Metadata:
AREA_OR_POINT=Area
TIFFTAG_SOFTWARE=Adobe Photoshop 7.0
TIFFTAG_DATETIME=2006:10:27 09:33:52
TIFFTAG_XRESOLUTION=72
TIFFTAG_YRESOLUTION=72
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Corner Coordinates:
Upper Left ( 3130375.000, 1615645.000) (105d 2'16.18"W, 39d31'22.13"N)
Lower Left ( 3130375.000, 1610645.000) (105d 2'16.50"W, 39d30'32.71"N)
Upper Right ( 3135375.000, 1615645.000) (105d 1'12.37"W, 39d31'21.87"N)
Lower Right ( 3135375.000, 1610645.000) (105d 1'12.71"W, 39d30'32.45"N)
Center ( 3132875.000, 1613145.000) (105d 1'44.44"W, 39d30'57.29"N)
Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue
*csharp code:
Gdal.AllRegister();
Dataset ds = Gdal.Open(infile, Access.GA_ReadOnly);
// get the projection
string proj = ds.GetProjection();
printing 'proj' produces:
*
"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\"]]"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080331/3578673d/attachment-0001.html
More information about the gdal-dev
mailing list