<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On 18-Jul-08, at 9:21 AM, Derek Bain wrote:</div></div></span></div><div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi<span class="Apple-converted-space"> </span><br>I cannot get ecw files to work in Mapserver. I have updated my map file (see below).<span class="Apple-converted-space"> </span><br><br>Is there any configuration that I have to do to enable this or is ecw by default. I am using ms4w beta 5..2.<span class="Apple-converted-space"> </span><br><br>My client is WorldWind and I am using the "Import to WMS Url Layer" option. It would appear that MapServer fails when processing the map file. Are there any options to set to enable a debug console window when processing the map file.<span class="Apple-converted-space"> </span><br><br>I have checked that my ecw file is georeferenced and it is.<span class="Apple-converted-space"> </span><br><br>Thanks<span class="Apple-converted-space"> </span><br>Derek<span class="Apple-converted-space"> </span><br><br><br> LAYER<span class="Apple-converted-space"> </span><br> NAME TestECWLayer<span class="Apple-converted-space"> </span><br> TYPE RASTER<span class="Apple-converted-space"> </span><br> STATUS ON<span class="Apple-converted-space"> </span><br> DUMP TRUE<span class="Apple-converted-space"> </span><br> DATA "C:/Progra~1/ms4w/Apps/All_Data/data/testfile.ecw"<span class="Apple-converted-space"> </span><br> PROJECTION<span class="Apple-converted-space"> </span><br> "init=epsg:4326"<span class="Apple-converted-space"> </span><br> END<span class="Apple-converted-space"> </span><br><br><br> METADATA<span class="Apple-converted-space"> </span><br> "wms_title" "TestECWLayer"<span class="Apple-converted-space"> </span><br> "wms_abstract" "TestECWLayer abstract goes here ...."<span class="Apple-converted-space"> </span><br> "wms_srs" "EPSG:4326"<span class="Apple-converted-space"> </span><br> "wms_name" "TestECWLayer"<span class="Apple-converted-space"> </span><br> "wms_format" "image/png image/jpeg"<span class="Apple-converted-space"> </span><br> "wms_extent" "-88.9803405 30.2175328 -88.9755868 30.2216604"<span class="Apple-converted-space"> </span><br> "wms_onlineresource" <span class="Apple-converted-space"> </span><a class="moz-txt-link-rfc2396E" href="http://localhost:8082/cgi-bin/mapserv.exe?map=C:/Progra%7E1/ms4w/apps/All_Data/ECW_Test.map">"http://localhost:8082/cgi-bin/mapserv.exe?map=C:/Progra~1/ms4w/apps/All_Data/ECW_Test.map"</a><span class="Apple-converted-space"> </span><br> END<span class="Apple-converted-space"> </span><br><br> CLASS<span class="Apple-converted-space"> </span><br> NAME "TestECWLayer"<span class="Apple-converted-space"> </span><br> COLOR 255 0 0<span class="Apple-converted-space"> </span><br> END<span class="Apple-converted-space"> </span><br> END<span class="Apple-converted-space"> </span></div></div></div></span></blockquote><br></div><div>Hello,</div><div><br></div><div>I have made some notes for you below to assist you with your ECW issue:</div><div><br></div><div><div>1) MS4W (and its underlying GDAL library) comes ready to use ECW data</div><div> by default. To verify this, execute /ms4w/setenv.bat at the</div><div> commandline, and then execute "gdalinfo --formats" to</div><div> see if ECW is supported, such as:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>>gdalinfo --formats</div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Supported Formats:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> VRT (rw+): Virtual Raster</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> GTiff (rw+): GeoTIFF</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> ...</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> ECW (rw): ERMapper Compressed Wavelets</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> ...</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> ADRG (rw+): ARC Digitized Raster Graphics</div><div><br></div><div><br></div><div><br></div><div>2) Now that you have established that your local build has ECW support,</div><div> now use the gdalinfo command on your data to get some basic info</div><div> on your ecw file, such as:</div><div> </div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>>gdalinfo image1.ecw</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Driver: ECW/ERMapper Compressed Wavelets</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Files: image1.ecw</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> image1.ecw.aux.xml</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Size is 7966, 8274</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Coordinate System is:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>PROJCS["LCC E008",</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> GEOGCS["NAD83",</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>DATUM["North_American_Datum_1983",</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> SPHEROID["GRS 1980",6378137,298.2572221010002,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>AUTHORITY["EPSG","7019"]],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> AUTHORITY["EPSG","6269"]],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>PRIMEM["Greenwich",0],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>UNIT["degree",0.0174532925199433],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>AUTHORITY["EPSG","4269"]],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> PROJECTION["Lambert_Conformal_Conic_2SP"],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> PARAMETER["standard_parallel_1",49],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> PARAMETER["standard_parallel_2",77],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> PARAMETER["latitude_of_origin",49],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> PARAMETER["central_meridian",-95],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> PARAMETER["false_easting",0],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> PARAMETER["false_northing",0],</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> UNIT["metre",1,</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>AUTHORITY["EPSG","9001"]]]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Origin = (2878735.262000000100000,995462.974999999980000)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Pixel Size = (30.000000000000000,-30.000000000000000)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Metadata:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> AREA_OR_POINT=Area</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Corner Coordinates:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Upper Left ( 2878735.262, 995462.975) ( 52d35'49.00"W, 48d59'18.47"N)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Lower Left ( 2878735.262, 747242.975) ( 54d36'32.41"W, 47d13'6.98"N)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Upper Right ( 3117715.262, 995462.975) ( 50d 6'40.01"W, 47d37'48.85"N)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Lower Right ( 3117715.262, 747242.975) ( 52d 9'36.52"W, 45d55'23.39"N)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Center ( 2998225.262, 871352.975) ( 52d22'14.82"W, 47d27'4.74"N)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Band 1 Block=7966x1 Type=Byte, ColorInterp=Red</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> Overviews: arbitrary</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Band 2 Block=7966x1 Type=Byte, ColorInterp=Green</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> Overviews: arbitrary</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Band 3 Block=7966x1 Type=Byte, ColorInterp=Blue</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> Overviews: arbitrary</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> </div><div>3) Next step is to create a small test mapfile with only one layer, for that</div><div> ecw file. For the EXTENT parameter you can use the lower left and upper right</div><div> coordinates listed in your gdalinfo response, such as:</div><div> </div><div> #</div><div> # Start of map file</div><div> #</div><div> #</div><div> NAME ecw-test</div><div> STATUS ON</div><div> SIZE 600 400</div><div> EXTENT 2878735.262 747242.975 3117715.262 995462.975</div><div> UNITS METERS</div><div> SHAPEPATH "../data"</div><div> </div><div> #</div><div> # Start of layer definitions</div><div> #</div><div> </div><div> LAYER</div><div> NAME "ecw-image"</div><div> TYPE RASTER</div><div> STATUS DEFAULT</div><div> DATA "image1.ecw"</div><div> END # Layer</div><div> </div><div> END # Map File</div><div><br></div><div>4) You can test your tiny mapfile with MapServer's "shp2img" utility that is part of</div><div> MS4W. (make sure you execute /ms4w/setenv.bat beforehand). shp2img will</div><div> create a map image file or return a MapServer error at the commandline.</div><div> You can use this MapServer error to track down the problem in your mapfile.</div><div> Here is an example shp2img command to show you how to see debugging information</div><div> with shp2img:</div><div> </div><div> >shp2img -m ecw.map -o test.png -map_debug 3</div><div> </div><div> msDrawRasterLayerLow(ecw-image): entering.</div><div> msDrawMap(): Layer 0 (ecw-image), 0.220s</div><div> msDrawMap(): Drawing Label Cache, 0.000s</div><div> msDrawMap() total time: 0.220s</div><div> msSaveImage() total time: 0.010s</div><div> </div><div> </div><div> In the above test case a "test.png" image file was created in the same </div><div> directory as my "ecw.map" file.</div><div> </div><div> </div><div><br></div><div><br></div></div><div><div>---</div><div>Jeff McKenna</div><div>FOSS4G Consulting and Training Services</div><div><div><a href="http://www.gatewaygeomatics.com/">http://www.gatewaygeomatics.com/</a></div></div><div><br></div></div><br></body></html>