[gdal-dev] How to create a fake GeoTIFF for GeoJP2

Frank Warmerdam warmerdam at pobox.com
Sat May 12 15:36:11 EDT 2012


On 12-05-12 12:25 PM, Jukka Rahkonen wrote:
> Hi,
>
> I have Geotiff files and a fast program for compressing images into JPEG2000.
> However, this program does not add GeoJP2 georeferencing into JPEG2000 files and
> I would like to include it.  I have also a program that can add GeoTIFF as an
> UUID box into an existing JPEG2000 file.
>
> What I miss is the GeoTIFF to embed into JP2 file. It should be a 1 pixel sized
> GeoTIFF with the tags from the original image. Have I understood it right when I
> believe that I can create if with gdal_translate simply using
>
> gdal_translate -srswin 0 0 1 1 original.tif to_be_embedded.tif?
>
> This is the gdalinfo from a geotiff that I took out from the UUID box of a
> GeoJP2 image. It seems to be exactly just the topleft pixel of the image.

Jukka,

Yes, this should do what you need as the top left pixel of original.tif
contains the georeferencing for your whole output image.  If you are
actually compressing original.tif to jpeg2000 then you likely want to do:

   gdal_translate -outsize 1 1 original.tif to_be_embedded.tif

This will give you a 1x1 pixel geotiff that represents the whole area of
the source image.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://home.gdal.org/warmerda
and watch the world go round - Rush    | Geospatial Software Developer



More information about the gdal-dev mailing list