[gdal-dev] Convert from GeoTiff to JP2

Livneh Yehiyam yehil at rafael.co.il
Thu Dec 2 03:51:48 EST 2010


Hi
I ran into a problem converting a GeoTiff to a Jpeg200 image, using gdal_translate and the JP2ECW driver.

My geotiff has GCP's as the georeference. Here is the output from gdalinfo:

Driver: GTiff/GeoTIFF
Files: 01122010-1509.tif
Size is 1680, 916
Coordinate System is `'
GCP Projection =
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["arc-second",4.848136811095361e-006],
    AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=1, Info=
          (0,0) -> (126151.273546348,115626.820459333,0)
GCP[  1]: Id=2, Info=
          (0,916) -> (126145.399132411,115623.500933949,0)
GCP[  2]: Id=3, Info=
          (1680,916) -> (126151.213029255,115615.934065356,0)
GCP[  3]: Id=4, Info=
          (1680,0) -> (126157.194618444,115619.120192017,0)
Metadata:
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  916.0)
Upper Right ( 1680.0,    0.0)
Lower Right ( 1680.0,  916.0)
Center      (  840.0,  458.0)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue

after converting to jp2 using the command:
gdal_translate -of jp2ecw 01122010-1509.tif 01122010-1509.jp2

I get this from gdalinfo:
E:\Data\test>gdalinfo 01122010-1509.jp2
Driver: JP2ECW/ERMapper JPEG2000
Files: 01122010-1509.jp2
       01122010-1509.jp2.aux.xml
Size is 1680, 916
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
GCP Projection =
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=1, Info=
          (0,0) -> (126151.273546348,115626.820459333,0)
GCP[  1]: Id=2, Info=
          (0,916) -> (126145.399132411,115623.500933949,0)
GCP[  2]: Id=3, Info=
          (1680,916) -> (126151.213029255,115615.934065356,0)
GCP[  3]: Id=4, Info=
          (1680,0) -> (126157.194618444,115619.120192017,0)
Metadata:
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
  AREA_OR_POINT=Area
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  916.0)
Upper Right ( 1680.0,    0.0)
Lower Right ( 1680.0,  916.0)
Center      (  840.0,  458.0)
Band 1 Block=1680x1 Type=Byte, ColorInterp=Red
  Overviews: arbitrary
Band 2 Block=1680x1 Type=Byte, ColorInterp=Green
  Overviews: arbitrary
Band 3 Block=1680x1 Type=Byte, ColorInterp=Blue
  Overviews: arbitrary

I think the problem is that both projectionRef, and GCPProjection are defined. This causes Global Mapper to fail reading the geo-reference data.

Is it a known problem, or am I doing something wrong?

Thanks
Yehiyam Livneh
**********************************************************************************************
This message (including any attachments) issued by RAFAEL- ADVANCED DEFENSE SYSTEMS LTD. 
(hereinafter "RAFAEL") contains confidential information intended for a specific individual and purpose, may 
constitute information that is privileged or confidential or otherwise protected from disclosure. If you are not 
the intended recipient, you should contact us immediately and thereafter delete this message from your 
system. You are hereby notified that any disclosure, copying, dissemination, distribution or forwarding of this 
message, or the taking of any action based on it, is strictly prohibited. If you have received this e-mail in error, 
please notify us immediately by e-mail mailto:lawraf at rafael.co.il and completely delete or destroy any and all 
electronic or other copies of the original message and any attachments thereof.
**********************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20101202/e79f1a00/attachment.html


More information about the gdal-dev mailing list