[Gdal-dev] img format resizing

Frank Warmerdam warmerdam at pobox.com
Thu Apr 1 15:10:12 EST 2004


list67 at netscape.net wrote:
> Hello.
> 
> I have a possible bug to report.
> 
> I have a .img file.  When I run:
> gdalwarp -rb -of HFA -ot Byte -wm 512 -ts 1487 2899 ./beforeResize.img ./afterResize.img
> the afterResize.img file is upside down.  Does anyone know if there is 
 > something about the above command that should be changed?

Mike,

My guess is that your image has no georeferencing so the source
image coordinate system "y" is increasing as you move from the top
to the bottom, as opposed to the "y" decreasing from top to bottom
as would occur in common projected or geographic coordinate systems.

The warper will generally get ungeoreferenced images upside down I expect,
though I haven't tried this myself.

....

Hmm, I just tried it, and gdalwarp seems to error out if the is
no georeferencing (which is good).

Could you provide a gdalinfo report on the input file?

> I'm using a cvs version of gdal that was updated today.  The 
 > beforeResize.img file is about 4.5 MB when gzipped.
> 
> Also, the reason I'm using the .img format is that I have a program 
 > that needs to be able to work with large image files (36GB is the max size
 > so far).  The geotiff format has the file size limit.  The .img format seems
 > to get unexpectedly large when making modifications to the file.  I don't
 > have any test results to back this up.  Can anyone recommend one of the
 > other image formats that are suitable for large images files?

What exactly do you mean by "making modifications to the file"?  Are you
dynamically re-write image data after the creation pass?  While this should
- in theory - work, it isn't a path that is well tested.  There might well
be a bug.  Please provide some more detail on what you are doing and what
is going wrong and I might be able to figure out whats happening.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list