[mapserver-users] problem with raster data..

Stephen Woodbridge woodbri at swoodbridge.com
Mon Feb 2 11:53:49 EST 2009


The tileindex is used in a layer like you have shown below.
Your map image is "built-up" from the layers in the mapfile. The first 
layers are drawn into the output image first and so on through the 
mapfile. So if you want your images to be the background of the image 
then put that layer first in the mapfile and all other layers will be 
drawn on top of that.

Also for directory paths, I think it is best if you lay them out 
something like:

/path/to/data/
/path/to/data/nztm/...

then:

cd /path/to/data/
gdaltindex 250k_index.shp nztm/250Kfiles/*.tif
shptree 250k_index.shp

adjust the paths as appropriate. Then in your mapfile

DATAPATH "/path/to/data"

...
LAYER
   ...
   TILEINDEX "250k_index"

basically start out putting all your tileindexes in /path/to/data and 
putting all your data in sub directories. This is a simple setup and 
should always work, so start like this. Then you can experiment with 
moving directories and tileindexes around. The reason for this is that 
the rules for how mapserver finds files is not always obvious and 
sometimes requires reading the code or a little simple experimentation 
to get it right.

-Steve


MeLv1n wAuRaN wrote:
>   Ok so basically it is done right? it created sample_index.dbf, 
> sample_index.shp, and sample_index.shx. Now, which file should i load 
> into the .MAP as my basemap?
> 
> An example from Robert Sanson:
> 
> LAYER
>   NAME nz250ktm
>   GROUP "Toposcans"
>   TYPE RASTER
>   STATUS ON
>   TILEINDEX ../data/nztm/250k_index
>   TILEITEM Location
>   MAXSCALE 300000
>   MINSCALE 75000
> 
> well, this is a layer right? what i mean is, this tile index will be the 
> basemap of the map instead of a layer, for example llike:
> 
> MAP
>    NAME "..........."
>    STATUS ........
>    EXTENT ....................
>    IMAGETYPE ........
>    SIZE ..............
>    SHAPEPATH "......................."
>    IMAGECOLOR .........
>    .........
>    .........
>    .........
> END
> 
> 
> or is this tileindex supposed to be a layer instead of a basemap?
> 
> 
> --- On *Mon, 2/2/09, Stephen Woodbridge /<woodbri at swoodbridge.com>/* wrote:
> 
>     From: Stephen Woodbridge <woodbri at swoodbridge.com>
>     Subject: Re: [mapserver-users] problem with raster data..
>     To: death_knight0911 at yahoo.com
>     Cc: "Robert Sanson" <SansonR at asurequality.com>,
>     mapserver-users at lists.osgeo.org
>     Date: Monday, February 2, 2009, 12:26 PM
> 
>     MeLv1n wAuRaN
>      wrote:
>     >   i already included the gdaltindex path in the environment variable. But
>     another error occured, it said:
>     > 
>     > "C:\ms4w\data\raster>gdaltindex sample_index.shp
>     sample*.tif
>     > ERROR 4: Unable to open sample_index.shp or sample_index.SHP.
>     > Creating new index file...
> 
>     This error is ok, it is just telling you that the index file does not already
>     exist and it is creating a new one. gdaltindex appends to an existing file so
>     keep that in mind if you need to add to your tileindex.
> 
>     > ERROR 4: `sample*.tif' does not exist in the file system,
>     > and is not recognised as a supported dataset name.
> 
>     This says that there are no files in the current directory named sample*.tif
>     what does a dir command respond with?
> 
>     -Steve W
> 
>     > Unable to open sample*.tif, skipping."
>     > 
>     > what do you think is the problem here?
>     >
>      
> 
> 



More information about the mapserver-users mailing list