[FWTools] Large image creation for MapServer

Bryan Keith bryan at geomega.com
Thu Jun 1 15:01:01 EDT 2006


Hello,

I have 3 band jpg (RGB) with 34925 x 36748 pixels.  I'm trying to create 
an image that will display quickly in MapServer.  After some testing it 
seems that both tiling and adding overviews to the image help a lot.  I 
can do a test with a smaller jpg and create an Imagine file that seems 
all right:

gdal_translate -of HFA -co TILED=YES --config GDAL_CACHEMAX 100 
Aerial_overall_fourmeter.jpg Aerial_overall_quartermeter_tiled.img

gdaladdo -r nearest Aerial_overall_fourmeter_tiled.img 2 4 8 16 32 64

However, when I run these same two commands on the large jpg, I get this 
error (repeated many times with slight changes):

Invalid argument
ERROR 3: Seek to 0:e3e6815e on 0xad2bf98 failed
Invalid argument
ERROR 3: Seek to 0:e3e6b15e on 0xad2bf98 failed

Using gdalinfo the new file looks OK except that the georeferencing 
information is gone:

Origin = (0.000000,0.000000)
Pixel Size = (1.00000000,1.00000000)
Corner Coordinates:
Upper Left  (   0.0000000,   0.0000000)
Lower Left  (       0.000,   36748.000)
Upper Right (   34925.000,       0.000)
Lower Right (   34925.000,   36748.000)
Center      (   17462.500,   18374.000)

When I view the image in MapServer, only the top ~2/3 of image draws. 
On disk I see that a couple files were created (one with 2 ** 31 - 1 bytes):

-rwxr-xr-x  1 bryan bryan 1294480699 May 31 18:46 
Aerial_overall_quartermeter_tiled.img
-rwxr-xr-x  1 bryan bryan 2147483647 May 31 17:47 
Aerial_overall_quartermeter_tiled.ige

What's the best way to accomplish what I'm trying to do?  Thank you,

Bryan

Bryan Keith
GIS Specialist
Geomega, Inc.
Boulder, CO, USA


More information about the FWTools mailing list