[MS4W-Users] Trs: cannot render image

Jeff McKenna jmckenna at gatewaygeomatics.com
Wed Sep 2 08:29:27 EST 2009


Rangga Negara wrote:
> hi, i just not understand why the map cannot render
> this is my mapfile
> 
> name "b"
> SIZE 600 500
> UNITS DD
> IMAGETYPE JPEG
> IMAGECOLOR  255 255 255
> SHAPEPATH "C:/ms4w/home/mapdata/"
> EXTENT -77.119900 38.791513  -76.909396 38.995109
> STATUS ON
> 
> #
> #          Start of web interface definition
> #
> 
> WEB
>     TEMPLATE '/ms4w/apache/htdocs/b.html'
>     IMAGEPATH '/ms4w/tmp/ms_tmp/'
>     IMAGEURL '/ms_tmp/'
> END # WEB Section
> 
> #
> #          Start of Layer definition
> #
> LAYER
>     NAME  county
>     TYPE polygon
>     STATUS ON
>     CONNECTIONTYPE OGR
>     CONNECTION "c:/ms4w/home/mapdata/county.TAB"
>             CLASS
>             NAME "county"
>             STYLE
>                 COLOR 254 222 212
>                 OUTLINECOLOR 0 0 0
>             END
>         END # Class section
> END # LAYER Section
>        
> END # MapFile
> 
> 
> ------and this is my html--------------------------------------------
> <html>
> <head> <title>MapServer First Map</title></head>
> <body>
>    <form method=POST action="/cgi-bin/mapserv.exe?">
>       <input type="submit" value="Click Me">
>       <input type="hidden" name="map" 
> value="C:/ms4w/home/mapdata/b.map&layers=all&mode=map">
>       <input type="hidden" name="map_web"
>              value="imagepath /ms4w/tmp/ms_tmp/">
>    </form>
>    <IMG SRC="[img]" width=600 height=500 border=0>
> </body>
> </html>
> -------------------------------------------------------------------------
> 
> output just white colour on the image box?

Hello,

Here are my thoughts:

- use the ogrinfo commandline utility to get the extents of the TAB file 
(also included in MS4W)
- use the extents from ogrinfo in the EXTENT parameter of your mapfile
- test your mapfile using the shp2img commandline utility 
(http://www.mapserver.org/utilities/shp2img.html), which is included in MS4W

-jeff


-- 
Jeff McKenna
FOSS4G Consulting and Training Services
http://www.gatewaygeomatics.com/








More information about the MS4W-Users mailing list