[gdal-dev] set projection: issue in detecting utm

garfy adiba.nizami at gmail.com
Tue Sep 24 21:25:37 PDT 2013


Hi All,

I have two images cor.tif and prob.tif

cor.tif <http://osgeo-org.1560.x6.nabble.com/file/n5079746/cor.tif>  
prob.tif <http://osgeo-org.1560.x6.nabble.com/file/n5079746/prob.tif>  

gdalinfo for both images as below :
*cor.tif*
Coordinate System is:
PROJCS["WGS 84 / UTM zone 43N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS84",6378137,298.2572235630016,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    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","32643"]] 


*prob.tif*
Coordinate System is:
PROJCS["WGS 84 / UTM zone 45N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.2572235630016,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",87],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32645"]]


I read the projection information (using gdalgetprojeciton) for the file and
set it to an output file (using gdalsetprojection)....(my gdal version is
1.4.5.....)
The problem is that  with cor.tif as input...the projection is set properly
i.e it set as utm 43n... to output file
but with prob.tif as input, the projection is set as tmerc with all
parameters mentioned separately...and not as utm zone 45..to the output fi;e

My question is ... 
1. How does gdal know whether it is utm or not ?  
as this string "PROJCS["WGS 84 / UTM zone 43N"]" is merely a string and can
be anything ..right ?
2. If it checks each proj. parameter and if that matches the set of
projection parameters for a utm zone...is it then that gdal calls it utm ?
If yes ... then is my problem due to scale factor being 1 and not 0.9996
(standard for utm) in prob.tif ?

Thanks



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/set-projection-issue-in-detecting-utm-tp5079746.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list