[gdal-dev] Units to Feet in ECW Metadata

Mullins, Steven Steven.Mullins at dmme.virginia.gov
Thu Jun 19 14:26:18 EDT 2008


Hello all.  I've ran into a bit of trouble doing a geotiff to ECW conversion.  I started with a geotiff with a gdalinfo dump of:

Driver: GTiff/GeoTIFF
Files: duty_01.tif
Size is 9073, 10904
Coordinate System is:
PROJCS["NAD27 / Virginia South",
    GEOGCS["NAD27",
        DATUM["North_American_Datum_1927",
            SPHEROID["Clarke 1866",6378206.4,294.9786982139006,
                AUTHORITY["EPSG","7008"]],
            AUTHORITY["EPSG","6267"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4267"]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",36.76666666666667],
    PARAMETER["standard_parallel_2",37.96666666666667],
    PARAMETER["latitude_of_origin",36.33333333333334],
    PARAMETER["central_meridian",-78.5],
    PARAMETER["false_easting",2000004.000008],
    PARAMETER["false_northing",0],
    UNIT["foot",0.3048,
        AUTHORITY["EPSG","9002"]],
    AUTHORITY["EPSG","32047"]]
Origin = (901010.167897604870000,312728.275525033300000)
Pixel Size = (5.105997194290739,-5.105997194290740)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_SOFTWARE=AutoCAD Raster Design 2008
  TIFFTAG_XRESOLUTION=25
  TIFFTAG_YRESOLUTION=25
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (  901010.168,  312728.276) ( 82d16'15.11"W, 37d 7'55.18"N)
Lower Left  (  901010.168,  257052.482) ( 82d15'47.70"W, 36d58'45.10"N)
Upper Right (  947336.880,  312728.276) ( 82d 6'43.43"W, 37d 8'13.08"N)
Lower Right (  947336.880,  257052.482) ( 82d 6'17.19"W, 36d59'2.97"N)
Center      (  924173.524,  284890.379) ( 82d11'15.85"W, 37d 3'29.18"N)
Band 1 Block=9073x2 Type=Byte, ColorInterp=Red
  Overviews: 116x140
  Mask Flags: PER_DATASET ALPHA
Band 2 Block=9073x2 Type=Byte, ColorInterp=Green
  Overviews: 116x140
  Mask Flags: PER_DATASET ALPHA
Band 3 Block=9073x2 Type=Byte, ColorInterp=Blue
  Overviews: 116x140
  Mask Flags: PER_DATASET ALPHA
Band 4 Block=9073x2 Type=Byte, ColorInterp=Alpha
  Overviews: 116x140

Notice that the projection units are feet.  Now I transfore this GeoTiff to a ECW with the following command:

gdal_translate -b 1 -b 2 -b 3 -of ECW -co "TARGET=85" duty_01.tif duty_01.ecw

A GDAL dump of the resulting ECW is as follows:

Driver: ECW/ERMapper Compressed Wavelets
Files: duty_01.ecw
       duty_01.ecw.aux.xml
Size is 9073, 10904
Coordinate System is:
PROJCS["LM2VIRSF",
    GEOGCS["NAD27",
        DATUM["North_American_Datum_1927",
            SPHEROID["Clarke 1866",6378206.4,294.978698213898,
                AUTHORITY["EPSG","7008"]],
            TOWGS84[-3,142,183,0,0,0,0],
            AUTHORITY["EPSG","6267"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9108"]],
        AXIS["Lat",NORTH],
        AXIS["Long",EAST],
        AUTHORITY["EPSG","4267"]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",36.7666667],
    PARAMETER["standard_parallel_2",37.9666667],
    PARAMETER["latitude_of_origin",37.3674801],
    PARAMETER["central_meridian",-78.49999999999994],
    PARAMETER["false_easting",2000000],
    PARAMETER["false_northing",376513.28],
    UNIT["Meter",1]]
Origin = (901010.167897604870000,312728.275525033300000)
Pixel Size = (5.105997194290739,-5.105997194290740)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_SOFTWARE=AutoCAD Raster Design 2008
  TIFFTAG_XRESOLUTION=25
  TIFFTAG_YRESOLUTION=25
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Corner Coordinates:
Upper Left  (  901010.168,  312728.276) ( 90d44'37.95"W, 36d 8'58.51"N)
Lower Left  (  901010.168,  257052.482) ( 90d39'51.81"W, 35d39'7.62"N)
Upper Right (  947336.880,  312728.276) ( 90d13'59.38"W, 36d12'8.84"N)
Lower Right (  947336.880,  257052.482) ( 90d 9'24.93"W, 35d42'16.70"N)
Center      (  924173.524,  284890.379) ( 90d26'58.38"W, 35d55'38.92"N)
Band 1 Block=9073x1 Type=Byte, ColorInterp=Red
  Overviews: arbitrary
  Metadata:
    LAYER_TYPE=athematic
Band 2 Block=9073x1 Type=Byte, ColorInterp=Green
  Overviews: arbitrary
  Metadata:
    LAYER_TYPE=athematic
Band 3 Block=9073x1 Type=Byte, ColorInterp=Blue
  Overviews: arbitrary
  Metadata:
    LAYER_TYPE=athematic

Now the units are in Meters and the ESPG code for my projection EPSG:32047 has been dropped.  Another twist is that ACAD correctly projects the resulting ECW, while ARCGIS does not.  Seems that ACAD ignores the UNITS tag while ARCGIS does not.  

Does anyone know how to make ECW keep the correct projection unit?

Thanks,

Steve


More information about the gdal-dev mailing list