[Mapserver-users] help! newbie's question about displaying the shape file.

Tyler Mitchell TMitchell at lignum.com
Mon May 31 13:35:52 EDT 2004


Are you sure you are drawing the features properly? I don't think you are.
-Remove EXPRESSION from your layer stuff, you don't need it yet, that 
might be the problem.
-You should have a SYMBOL setting in your CLASS section.  The default with 
the recent version of mapserver draws a very thin line, but your version 
may not have that feature. 

Add this after your REFERENCE section:
SYMBOL
  NAME "circle"
  TYPE ellipse
  FILLED true
  POINTS
    1 1
  END
END

Then add:
 SYMBOL 'circle'
 SIZE 2
to your layer CLASS section.

-Also, try specifying a COLOR too, therefore your polygons will be filled 
and you'll see them easily when they do draw

See if that helps.  You can keep the discussion open in the mapserver list 
so others can pipe up when they see I'm wrong about something :)

Tyler

shiming <sli1 at uni-forst.gwdg.de> wrote on 05/31/2004 10:20:10 AM:

> Thanks for your answering so quickly.
> According to your guide, I add the line 
> IMAGECOLOR 100 100 100 , I check the files under tmp directory, there 
are
> -rw-r--r--    1 nobody   4294967295      110 2004-05-31 18:53 
> XX10860223845231.png
> -rw-r--r--    1 nobody   4294967295      110 2004-05-31 18:53 
> XX10860223895232.png
> -rw-r--r--    1 nobody   4294967295       84 2004-05-31 18:53 
> XXleg10860223845231.png
> -rw-r--r--    1 nobody   4294967295      524 2004-05-31 18:53 
> XXleg10860223895232.png
> -rw-r--r--    1 nobody   4294967295    40128 2004-05-31 18:53 
> XXref10860223845231.png
> -rw-r--r--    1 nobody   4294967295    40174 2004-05-31 18:53 
> XXref10860223895232.png
> I use gimp to show .png, XX10860223845231.png is a dark file, no data 
> information.
> 
>  I check my shape file in arcview, in the upper right corner, it show 
> 111.41  33.66
> and the like.
> 
> I can show the europe file that come with ArcView software using the 
> similar files.
> I could not figure out why it happened.  .shp, .dbf, .shx are enough for 

> mapserver to display shape file?
> 
> 
> lism
> 
> index.html
> <html>
> <head>
> <title>
>  Hello! Welcome!
> </title>
> </head>
> <body bgcolor=#FFFFFF>
> <center><h1>
> Hello, welcome!
> </h1></center>
> <h2>
> The following is the GIS data demonstration:
> </h2>
> 
> <hr noshade size=7>
> <br>
> <form method=GET action="/cgi-bin/mapserv">
> 
> <input type="hidden" name="map" 
> value="/usr/local/apache2/htdocs/xx/xx_demo.map">
> <input type="hidden" name="layer" value="test2">
> <!--<input type="hidden" name="layer" value="dlgstln2">-->
> <input type="hidden" name="zoomsize" value=2>
> 
> <input type="hidden" name="program" value="/cgi-bin/mapserv">
> 
> <input type="hidden" name="map_web_imagepath" 
> value="/usr/local/apache2/htdocs/tmp/">
> <input type="hidden" name="map_web_imageurl" value="/tmp/">
> 
> <center><input type="submit" value="View My demo "></center>
> 
> </form>
> 
> template file
> 
> <html>
> <head>
>         <title>MapServer Demo </title>
> </head>
> 
> <body bgcolor=#FFFFFF>
> 
> <center><h1>MapServer Demo </h1></center>
> <hr>
> <form name="mapserv" method=GET action="[program]">
> 
> <center>
> <table border=0 cellspacing=0 cellpadding=4 bgcolor="#000000">
> <tr>
> <td valign="top" align=center>
>   <table cellpadding="0" cellspacing="0" border="0">
>      <tr>
>       <td colspan="2"><INPUT NAME="img" TYPE="image" SRC="[img]" 
> width=600 height=600 border=0></td>
>     </tr>
>     <tr>
>       <td>&nbsp;<font size=-1 face="arial,helvetica" 
> color="#FFFFFF"><b>Powered by MapServer</b></font></td>
>       <td align="right"><img src="[scalebar]"></td>
>     </tr>
>   </table>
> </td>
> <td valign="top" bgcolor=#ffffff>
>   <table cellpadding="5" cellspacing="0" border="0" bgcolor="#ffffff">
>     <tr><td>
>       <center><input type="submit" value="Refresh/Query"></center>
>       <p>
> 
>       <input type="radio" name="mode" value="browse" checked> <b>Browse 
> map</b><br>
>       <input type="radio" name="mode" value="query"> <b>Query 
> feature</b><br>
>       <input type="radio" name="mode" value="nquery"> <b>Query multiple 
> features</b>
> 
>       <hr>
> 
>       <p>
>       <b>Select Layers to Display: </b><br>
>       <select multiple name="layer" size=3>
>      <option value="dxregion" [dxregion_select]> dxregion
>       </select>
> 
>       <p>
>       Zoom In <input type=radio name=zoomdir value=1 [zoomdir_1_check]>
>       Pan <input type=radio name=zoomdir value=0 [zoomdir_0_check]>
>       Zoom Out <input type=radio name=zoomdir value=-1 
[zoomdir_-1_check]>
>       <p>
>       Zoom Size <input type=text name=zoomsize size=4 value=[zoomsize]>
>       <p>
> 
>       <font size=+1><b>Legend</b></font><br><hr>
>       <img src="[legend]"><hr>
> 
>       <p>
>       <center><INPUT NAME="ref" TYPE="image" SRC="[ref]" 
> border="1"></center>
>     </td></tr></table>
> 
>   </td></tr>
> </table>
> </center>
> 
> <input type="hidden" name="imgxy" value="299.5 299.5">
> <input type="hidden" name="imgext" value="[mapext]">
> <input type="hidden" name="map" value="[map]">
> <input type="hidden" name="savequery" value="true">
> 
> <input type="hidden" name="imgbox" value="-1 -1 -1 -1">
> 
> <input type="hidden" name="program" value="[program]">
> <input type="hidden" name="map_web_imagepath" 
value="[map_web_imagepath]">
> <input type="hidden" name="map_web_imageurl" value="[map_web_imageurl]">
> 
> </form>
> 
> <p><hr><p>
> 
> </body>
> </html>
> 
> 
> >1) 
> >First, have a peek in the above folder and view all the image files. Do 

> >you see your map in there at all?  You may want to delete them all and 
> >then re-run that mapserver app so you have fewer images to check out. 
> >There SHOULD be an image for the legend, scalebar and map.
> >
> >2)
> >Can you confirm that you are actually getting a blank/white image file 
> >loading in your web page?  Or is the web page just not finding the 
graphic 
> >to show you?  There is a subtle but important difference here.  To find 

> >this out, try changing the background colour of your map - oh wait, you 

> >don't have one specified, add in under FONTSET:
> >
> >IMAGECOLOR 100 100 100
> >
> >That should give you a grey-ish background colour.  When you run the 
map 
> >again, do you see just a white map or do you see this grey?
> >
> >3) If you don't see any colour at all, then your web page is not 
finding 
> >the image to load.  It could be because the image doesn't exist (that's 

> >what step (1) is meant to help discern).  The usual culprits are bad 
> >IMAGEPATH AND IMAGEURL parameters.  These may also be set in your 
initial 
> >html files - so check there too!
> >
> >4) Is your dxregion data in lat/long?  When you view this in Arc view 
and 
> >move your cursor over the map, what kind of numbers do you get for 
> >coordinates in the map?  If you are not in lat/long units in your map 
> >data, then you either need to a) change the overall map projection for 
> >your map file or b) add a PROJECTION setting to the end of your LAYER 
> >definition.
> >
> >Hope that helps.
> >
> >
> > 
> >
> 
> [attachment "XX10860223845231.png" deleted by Tyler Mitchell/Lignum]
> [attachment "XXleg10860223845231.png" deleted by Tyler 
> Mitchell/Lignum] [attachment "XXref10860223845231.png" deleted by 
> Tyler Mitchell/Lignum] 



More information about the mapserver-users mailing list