It works in a similar way than tileindex with geotiffs. Actually I would recommend to test first with a geotiff tileindex and couple of images so that you know that everything else despite ECW is configured correctly. If changing to ECW breaks something you know where to start searching the reason for the issue. It can be that the GDAL of your Mapserver does not support ECW. However, if you could create the tileindex then probably that is not the case. Two suggerstions:
- Perhaps the paths in tileindex are not correct? I always create them with
"-write_absolute_path" but some others prefer to write them relative to SHAPEPATH http://www.mapserver.org/optimization/tileindex.html.
- Learn to use DEBUG in your mapfiles
- Learn to test with shp2img utility, it removes the hassle caused by the clients and the web. Once you know that Mapserver is OK you can continue and try to connect it from your client.
#In case of trouble uncomment DEBUG and see MS_ERRORFILE
OFFSITE 0 0 0
'wms_srs' 'EPSG:4326 EPSG:3587'
Here comes the whole procedure for making a WMS layer from a bunch of images.
- Acquire some images. I use the demo images which come with Geoserver installation and files can be found from directory geoserver-2.5\data_dir\coverages\mosaic_sample. They are png images but it is not important because all the images behave in the same way for Mapserver if it has a driver for reading them.
- Check the native projection of the images. In this case it can be done by opening one .prj file which shows "AUTHORITY["EPSG","4326"]]". Gdalinfo is the standard tool for checking the projection but it fails with these png images.
Create tileindex as
C:\ms4w\apps\image_data>gdaltindex -write_absolute_path png_mosaic.shp
Check the extents of the tileindex with ogrinfo
C:\ms4w\apps\image_data>ogrinfo -al -so png_mosaic.shp INFO: Open of
using driver `ESRI Shapefile' successful.
Layer name: png_mosaic Geometry: Polygon Feature Count: 25 Extent:
(6.346175, 36.491772) - (20.829683, 46.590767)
- Write a basic mapfile "tileindex.map" with all this information.
SIZE 800 800
EXTENT 6.346175 36.491772 20.829683 46.590767
IMAGECOLOR 20 250 250
"wms_srs" "CRS:84 EPSG:4326 EPSG:3857"
"wms_title" "tileindex demo"
CONFIG "PROJ_LIB" "C:/ms4w/proj/nad"
CONFIG "CPL_DEBUG" "ON"
CONFIG "MS_ERRORFILE" "c:/ms4w/tmp/debug.txt"
6. Test your Mapserver and mapfile. All these can be sent from the browser. The request and output that shows that everything is OK follows. See \comments
No query information to decode. QUERY_STRING is set, but empty.
\mapserv.exe executable is found
mapserv(): Web application error. Traditional BROWSE mode requires a TEMPLATE in the WEB section, but none was provided.
\mapfile from is found
\mode=map may be ancient but sometimes handy for testing
\this is a real complete WMS request and below is the result
Everything is done in a similar way with ECW images but it is better to test fist with some images which are for sure supported with all Mapserver and GDAL versions.