[mapserver-users] problem with shape files

Gregg Kelley gregg.kelley at stoner.com
Tue Jul 17 16:43:22 EDT 2001


Hi, I couldn't find any reference to this sort of problem in the archives so
here goes.  I have shape files in my C:\Inetpub\wwwroot directory called
gaslines.  They work fine with ESRI's products.  However, I have set up a
simple test to use these shape files, but with no success.  The legend and
scalebar png's are being produced, but the shape file image isn't.  I've
checked the output directory and the legend and scalebar images are there,
but the shape file image isn't (e.g. there are file names like
"testingleg333.png" and "testingsb333.png" but no "testing.png")  I have
tried moving the shape files to different directories (all web-accessible)
and changing the needed files, but that hasn't worked.  Also, there are no
errors produced by the mapserver.  It comes back with another web page with
everything there but the shape file image.  Also, the legend image is there
but it is empty (obviously, since the mapserver can't seem to find/read the
shape files).  I also tried running shp2img, and it at least outputs a
image, although it is blank (solid white).  It produces no errors.  Does
anyone have any ideas???  They would be greatly appreciated!  Oh here are my
map file and my test_init.html and test.html files.  Also my machine is
running WindowsNT 4.0 with IIS 4.0 and MapServer 3.4 (I just downloaded it
this morning).

------------testmap.map--------------------------------------
#
# Start of map file
#
NAME testing
STATUS OFF
SIZE 600 600
EXTENT 2205407.2 2206191.2662416105 1373732.7063506711 1374323.7036493286
UNITS DD
SHAPEPATH "C:\netpub\wwwroot"
IMAGECOLOR 255 255 255
SYMBOLSET symbol.sym

#IMAGETYPE PNG

#
# Projection definition, consult the PROJ.4 documentation for parameter
discussion
#
#PROJECTION
#  "proj=utm"
#  "ellps=GRS80"
#  "zone=15"
#  "north"
#  "no_defs"
#END

#
# Start of web interface definition
#
WEB
  HEADER test_header.html
  TEMPLATE test.html
  FOOTER test_footer.html
  MINSCALE 1000
  MAXSCALE 1550000
  IMAGEPATH "C:\Data\mapping project\free mapserver\www\output\"
  IMAGEURL "/mapserv/output/"
  # LOG "demo.log"
END

QUERYMAP
  SIZE 200 200
  STATUS ON
  STYLE HILITE
  COLOR 255 0 0
END

#
# Start of reference map
#
#REFERENCE
#  IMAGE graphics/reference.gif
#  EXTENT 393234.393701263 5205405.16440722 495769.579718949
5307959.02579127
#  SIZE 120 120
#  STATUS ON
#  COLOR -1 -1 -1
#  OUTLINECOLOR 255 0 0
#END

#
# Start of legend
#
LEGEND
  KEYSIZE 18 12
  LABEL
    TYPE BITMAP
    SIZE MEDIUM
    COLOR 0 0 89
  END
  STATUS ON
END

#
# Start of scalebar
#
SCALEBAR
  IMAGECOLOR 255 255 255
  LABEL
    COLOR 255 255 255
    SIZE tiny
  END
  STYLE 1
  SIZE 50 2
  COLOR 255 255 255
  UNITS MILES
  INTERVALS 1
  TRANSPARENT TRUE
  STATUS TRUE
END

#
# Start of layer definitions
#

LAYER
  NAME Gaslines
  DATA gaslines
  TYPE LINE
  STATUS ON

  CLASS
    COLOR 127 227 127
  END
END

#
#
# End of layer definitions
#

END # Map File
--------------------------------------------------

-----------test_init.html-------------------------
<HTML>
	<HEAD><TITLE>Mapserver Test</TITLE></HEAD>

	<BODY>
		<FORM ACTION="/cgi-bin/mapserv.exe" METHOD="GET">

			<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 SELECTED VALUE="gaslines">GasLines</OPTION>
				</SELECT>
			</P>

			<P>
				<SELECT NAME="zoomdir">
					<OPTION VALUE="1">Zoom In</OPTION>
					<OPTION VALUE="0">Pan</OPTION>
					<OPTION VALUE="-1">Zoom Out</OPTION>
				</SELECT>
			</P>
			<P>
				Zoom Size <input type="text" name="zoomsize" size="4" value="1">
			</P>

			<input type="hidden" name="imgxy" value="299.5 299.5">
			<input type="hidden" name="savequery" value="true">
			<input type="hidden" name="mapext" value="shapes">

			<INPUT TYPE="hidden" NAME="map" VALUE="C:\Data\mapping project\free
mapserver\www\testmap.map">
			<INPUT TYPE="submit" NAME="get_map" VALUE="Get the map!" />
		</FORM>
	</BODY>
</HTML>
--------------------------------------------------

---------test.html--------------------------------
<html>
<head><title>MapServer Demo Interface</title></head>
<body bgcolor=#FFFFFF>

<center><h1>MapServer Demo Interface</h1></center>
<hr>
<form method=GET action="/cgi-bin/mapserv.exe">

<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="gaslines" [gaslines_select]> gaslines
      </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="0"></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="mapext" value="shapes">

</form>

<p><hr><p>

</body></html>
--------------------------------------------------

-Gregg




More information about the mapserver-users mailing list