Opened 21 years ago

Last modified 21 years ago

#370 closed defect (fixed)

wrong unit (degree) for UTM map on envi fromat

Reported by: alessandro_amici@… Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

gdalinfo on an envi file with the following map info line: 
 
map info = {UTM, 1,1, 500000, 5000000, 10, 10, 32, North} 
 
results in: 
PROJCS["UTM Zone 32, Northern Hemisphere", 
    GEOGCS["WGS 84", 
        DATUM["WGS_1984", 
            SPHEROID["WGS 84",6378137,298.257223563, 
                AUTHORITY["EPSG","7030"]], 
            TOWGS84[0,0,0,0,0,0,0], 
            AUTHORITY["EPSG","6326"]], 
        PRIMEM["Greenwich",0, 
            AUTHORITY["EPSG","8901"]], 
        UNIT["degree",0.0174532925199433, <------------------------ 
            AUTHORITY["EPSG","9108"]], 
        AXIS["Lat",NORTH], 
        AXIS["Long",EAST], 
        AUTHORITY["EPSG","4326"]], 
    PROJECTION["Transverse_Mercator"], 
    PARAMETER["latitude_of_origin",0], 
    PARAMETER["central_meridian",9], 
    PARAMETER["scale_factor",0.9996], 
    PARAMETER["false_easting",500000], 
    PARAMETER["false_northing",0]] 
 
right unit should be meters. 
 
thanks 
alessandro

Change History (1)

comment:1 by warmerdam, 21 years ago

Alessandro, 

The units you point to as being wrong are the units for the geographic
coordinate system (ie. WGS84), and are correct as degrees.  There is a problem
with the coordinate system.  There are no linear units provided at all.  Generally
if there are no linear units meter should be assumed but it is preferred that
anything generating WKT also insert the units explicitly. 

I have committed a change adding a call to oSRS.Fixup() which will insert 
some default settings where they are missing.  This seems to add in the linear
units as shown here:

vc6@gdal2200% gdalinfo lanier.dat
Driver: ENVI/ENVI .hdr Labelled
Size is 512, 512
Coordinate System is:
PROJCS["UTM Zone 17, Northern Hemisphere",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9108"]],
        AXIS["Lat",NORTH],
        AXIS["Long",EAST],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-81],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]

I would like to note here that the map_info handling for envi files is
pretty weak.   Lots of projections aren't supported for instance. 


Note: See TracTickets for help on using tickets.