[OpenLayers-Dev] Mapserver Mosaics with Tileindex

Paul Spencer pspencer at dmsolutions.ca
Tue Apr 29 15:38:31 EDT 2008


Jeff,

I think the problem is with your TILEITEM member, that is supposed to  
point to an attribute of the shape file that contains the relative  
path to the raster files, the default is LOCATION and if you didn't  
change the options for gdaltindex then it will automatically use  
LOCATION as well.  This means you should drop TILEITEM from your map  
file.

Another small gotcha is that the value in the LOCATION field is  
relative to the SHAPEPATH defined for the map, not the location of the  
TILEINDEX.  The easiest way to make this work is to run gdaltindex in  
the directory that is your SHAPEPATH.  For instance, if you have  
SHAPEPATH ../data/tiles then you want to run gdaltindex from the ../ 
data/tiles.

Cheers

Paul

On 29-Apr-08, at 1:42 PM, Copes, Jeff wrote:
> Pedro,
>
> Thank you for the suggestion. I am writing a map now to bypass
> OpenLayers to isolate the issue. I think your suggestion is a more
> appropriate first test step and will do that first.
>
> Thanks,
>
> Jeff
>
> -----Original Message-----
> From: Pedro Simonetti Garcia [mailto:pedrosimonetti at gmail.com]
> Sent: Tuesday, April 29, 2008 1:41 PM
> To: Copes, Jeff
> Cc: dev at openlayers.org; Jordan, Thomas; Ingersoll, Mark
> Subject: Re: [OpenLayers-Dev] Mapserver Mosaics with Tileindex
>
>
> Hi Jeff,
>
> I never worked with MapServer + Tile Mosaics + OpenLayers, so I don't
> have much to share with you.
>
> But here goes a small suggestion. Have you ever tried to use the
> "shp2img" command line tool to verify if MapServer is rendering
> correctly the mapfile? If you can't generate a proper image with
> shp2img it may indicate that you have a problem in your mapfile
> configuration.
>
> I hope this helps,
>
> Pedro Simonetti.
>
> 2008/4/29 Copes, Jeff <jcopes at harris.com>:
>>
>>
>>
>> All,
>>
>> I have not been able to connect MapServer to OpenLayers using
> TileIndex
>> directive in Mapserver. Has anyone been able to do this?
>>
>> There are four geoTIFFs in the directory
> /ms4w/apps/ms_tiles/data/tiles.
>> gdaltindex made a tileindex shapfile G15Tiles.shp in the same
> directory as
>> the data. The output G15Tiles.shp has the correct entries for each of
> the
>> four images to be mosaicked and the correct overall bounding box for
> the
>> mosaic. The MapServer mapfile has the following entry:
>>
>> LAYER
>>  NAME G15Tiles
>>  GROUP "Imagery"
>>  PROJECTION
>>   "init=epsg:4326"
>>  END
>>  TYPE RASTER
>>  DUMP TRUE
>>  STATUS DEFAULT
>>  # where the tiles are
>>  TILEINDEX "/ms4w/apps/ms_tiles/data/tiles/G15Tiles.shp"
>>  TILEITEM "../data/tiles/"
>>
>>   more metadata items
>>
>> END
>>
>> This is the layer creation code in OpenLayers:
>>
>>        var map;
>>        window.onload = function(){
>>        map = new OpenLayers.Map('map',{ controls: [] },
> {maxResolution:
>> 'auto'} );
>>        var g15tiles = new OpenLayers.Layer.MapServer("G15Tiles",
>>
>> "http://dnocc8036:8090/cgi-bin/ms_tiles",
>>
>> {layers: 'G15Tiles'});
>>       map.addLayer(g15tiles);
>>
>> The OpenLayers HTML page gives two pink boxes. Is there anyone who
> knows
>> about MapServer + Tile Mosaics + OpenLayers who can help?
>>
>> Thanks,
>>
>> Jeff Copes
>> Harris Corporation
>> Enterprise Architecture COE - Geospatial Systems
>> (321) 984-6556
>>
>>
>>
>>
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
>>
>>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://www.dmsolutions.ca/




More information about the Dev mailing list