TILEINDEX and overviews (gdaladdo) ?

Frederic Claudel fclaudel at CSIR.CO.ZA
Thu Sep 29 07:38:50 EDT 2005


Hi Manfred,
I think it's normal, and that viewing a footprint of 20km*20km will need to access around 400 files, then mosaic the overviews, which cannot be lightning speed.
I experienced the same slowdown when trying to open more than a dozen of file with overviews.

My solution is to create already mosaicked overviews, which I add as new layers into my mapfile. A minscale/maxscale helps choosing the correct layer.
Tell me if you need more details (maybe that approach is not what you're lokkin for)

cheers,
Frederic Claudel

>>> Manfred Zerndl <manfred.zerndl at BVV.BAYERN.DE> 29/09/2005 12:42 >>>
Does mapserver not take advantage of overviews calculated with 
"gdaladdo" when
the files are accessed with TILEINDEX?

I have 77300 TIFF-Files. Each of them has 2500x2500 Pixels and each is 
equivalent to one square kilometer
(Ground-resolution is 0.4 meters per pixel (1000 meters / 2500 pixels)).

(by the way, creating a Tile-Index with gdaltindex failed, becuase of 
the amount of comand-line parameters.
So I generated a tileindex-Shapefile for my own, calculated each 
bondingbox and used the tools "shpadd" and "dbfadd".)

For each of the 77300 TIFF-Files I generate overviews with the tool 
"gdaladdo"
(for example: gdaladdo -r average file77300.tif 2 4 8 16 32 64 128)

Then I add the layer in the mapfile as following:

LAYER
  NAME "DOP"
  TILEINDEX "dop/dop.shp"
  TILEITEM "LOCATION"
  TYPE RASTER
  STATUS ON
END

When I try with mapserver to view 200 meters with an image size of 500 
Pixel,
the response is reasonably fast, because mapserver do not have to scale 
the image
(the ground-resolution is 0.4 m/px).
But when I try to view 10 km or 20 km (kilometers) with an imagesize of 
500 pixel,
mapserver take a very long time to answer (up to 1 Minutes).

Does mapserver not take advantage of the precalculated overviews in the 
tiff-files generated with "gdaladdo"
when the files are accessed with TILEINDEX?

I have compiled mapserver on linux with  --with-gdal and --without-tiff !!

$ mapserv -v
MapServer version 4.6.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT 
SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=EPPL7 
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE


Regards, Manfred



----- <start of additional infos> ---

Each of my TIFF-Files looks like this:

$ gdalinfo file77300.tif
Driver: GTiff/GeoTIFF
Size is 2500, 2500
Coordinate System is `'
Origin = (4467999.800000,5321000.200000)
Pixel Size = (0.40000000,-0.40000000)
Metadata:
  TIFFTAG_XRESOLUTION=125
  TIFFTAG_YRESOLUTION=125
  TIFFTAG_RESOLUTIONUNIT=3 (pixels/cm)
Corner Coordinates:
Upper Left  ( 4467999.800, 5321000.200)
Lower Left  ( 4467999.800, 5320000.200)
Upper Right ( 4468999.800, 5321000.200)
Lower Right ( 4468999.800, 5320000.200)
Center      ( 4468499.800, 5320500.200)
Band 1 Block=2500x1 Type=Byte, ColorInterp=Red
  Overviews: 1250x1250, 625x625, 313x313, 157x157, 79x79, 40x40, 20x20
Band 2 Block=2500x1 Type=Byte, ColorInterp=Green
  Overviews: 1250x1250, 625x625, 313x313, 157x157, 79x79, 40x40, 20x20
Band 3 Block=2500x1 Type=Byte, ColorInterp=Blue
  Overviews: 1250x1250, 625x625, 313x313, 157x157, 79x79, 40x40, 20x20

The tool "tiffinfo" generates this:
TIFF Directory at offset 0x11e685a
  Subfile Type: (0 = 0x0)
  Image Width: 2500 Image Length: 2500
  Resolution: 125, 125 pixels/cm
  Bits/Sample: 8
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Rows/Strip: 1
  Planar Configuration: single image plane
TIFF Directory at offset 0x11e6920
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 1250 Image Length: 1250
  Tile Width: 128 Tile Length: 128
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 3
  Planar Configuration: separate image planes
TIFF Directory at offset 0x11e732e
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 625 Image Length: 625
  Tile Width: 128 Tile Length: 128
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 3
  Planar Configuration: separate image planes
TIFF Directory at offset 0x11e7634
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 313 Image Length: 313
  Tile Width: 128 Tile Length: 128
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 3
  Planar Configuration: separate image planes
TIFF Directory at offset 0x11e77ba
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 157 Image Length: 157
  Tile Width: 128 Tile Length: 128
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 3
  Planar Configuration: separate image planes
TIFF Directory at offset 0x11e78c8
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 79 Image Length: 79
  Tile Width: 128 Tile Length: 128
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 3
  Planar Configuration: separate image planes
TIFF Directory at offset 0x11e798e
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 40 Image Length: 40
  Tile Width: 128 Tile Length: 128
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 3
  Planar Configuration: separate image planes
TIFF Directory at offset 0x11e7a54
  Subfile Type: reduced-resolution image (1 = 0x1)
  Image Width: 20 Image Length: 20
  Tile Width: 128 Tile Length: 128
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Samples/Pixel: 3
  Planar Configuration: separate image planes

----- <end of additional infos> -----

-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
 
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 
 
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 
 
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
HelpDesk at csir.co.za.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.



More information about the mapserver-users mailing list