>> GIS Tools
Thread views: 13877 View all threadsNext thread*Threaded Mode

(Stranger )
05/20/07 05:33 AM
MapServer working... almost Report this article as Inappropriate to us !!!Login to Reply

Hi All,

I have just started using MapServer recently via IIS and asp, I have successfully done a test run with a shapefile and am now trying to incorporate the same scenerio into my own website. However I have configured the directories a little differently. In a way that it is now throwing up the following error:

msDrawMap(): Image handling error. Failed to draw layer named 'US States'.
msSHPOpenFile(): Unable to access file. (c:\inetpub\wwwroot\biz_new\AMS\shape\statesp020)
msSHPOpenFile(): Unable to access file. (c:\inetpub\wwwroot\biz_new\AMS\shape\statesp020)

MapServer seems to be doing its job however its seems not able to read/access the "statesp020" shapefiles. The directory is correct where it is looking and the folder security for all user accounts I've switched to Full Control. Also IIS has got full permissions for the shape folder.

I guess the question is what else might I have missed? Below is my map file, html and directory structure.

Any advice would be greatly appreciated!!!

NAME "First"
SIZE 400 300
IMAGECOLOR 255 255 255
EXTENT -125.00 20.00 -65.00 50.00
TEMPLATE "C:\Inetpub\wwwroot\biz_new\admin\trial.html"
IMAGEPATH "C:\Inetpub\wwwroot\biz_new\AMS\MapServer\temp\"
IMAGEURL "C:\Inetpub\wwwroot\biz_new\AMS\MapServer\temp\"
NAME "US States"
STATUS default
TYPE line
DATA "c:\inetpub\wwwroot\biz_new\AMS\shape\statesp020"
COLOR 0 0 0
COLOR 0 0 0
SIZE small
END #End of

[head][title]MapServer First Map[/title][/head]
[form method="get" action="/scripts/mapserv.exe?"]
[input type="submit" value="Click Me"/]
[input type="hidden" name="map" value="C:\Inetpub\wwwroot\biz_new\admin\"/]
[input type="hidden" name="map_web_imagepath" value="C:\Inetpub\wwwroot\biz_new\AMS_Final\MapServer\temp\"/]
[img src="[img]" width="400" height="300" border="0"/]

Directory Structure:
c:\inetpub\wwwroot\biz_new\AMS\MapServer\lib\[all library files]
c:\inetpub\wwwroot\biz_new\AMS\MapServer\temp\[all jpeg files]

Edited by Hayden on 05/20/07 06:00 AM.

(Stranger )
05/24/07 06:43 AM
Re: MapServer working... almost new [re: Hayden]Report this article as Inappropriate to us !!!Login to Reply

Looking at one of my MAP files, I have...

At the beginning I have a SHAPEPATH defined which will be relative to the directory your MAP file is in...

SHAPEPATH "../trra"

# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root
# of the drive where the .MAP file resides.
IMAGEPATH "/ms4w/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"

and further down for the layer definition this is going to be the name of the shapefile without the path because the SHAPEPATH above already sets that up...

DATA PROV_Shorelined

Notice that the DATA def has no quotes. At the very least, try removing the quotes first. Failing that try setting the SHAPEPATH and make sure your IMAGEPATH and IMAGEURL are resolvable URL because these are the location for the temp images MapServer creates accessible to your web app.

Edited by blindthief on 05/24/07 06:56 AM.

View all threadsNext thread*Threaded Mode
Jump to


Teledyne: - Countless CAD add-ons, plug-ins and more.

Internet Business Systems © 2017 Internet Business Systems, Inc.
595 Millich Dr., Suite 216, Campbell, CA 95008
+1 (408)-337-6870 — Contact Us, or visit our other sites:
AECCafe - Architectural Design and Engineering EDACafe - Electronic Design Automation TechJobsCafe - Technical Jobs and Resumes  MCADCafe - Mechanical Design and Engineering ShareCG - Share Computer Graphic (CG) Animation, 3D Art and 3D Models
  Privacy Policy