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

Hayden
(Stranger )
05/20/07 05:33 AM
MapServer working... almost new 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!!!
Hayden

# Hello.map
NAME "First"
SIZE 400 300
IMAGECOLOR 255 255 255
IMAGETYPE JPEG
EXTENT -125.00 20.00 -65.00 50.00
WEB
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\"
END
LAYER
NAME "US States"
STATUS default
TYPE line
DATA "c:\inetpub\wwwroot\biz_new\AMS\shape\statesp020"
LABELITEM "STATE"
CLASS
STYLE
COLOR 0 0 0
END
LABEL
COLOR 0 0 0
SIZE small
END
END
END
END #End of Hello.map


[html]
[head][title]MapServer First Map[/title][/head]
[body]
[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\hello.map"/]
[input type="hidden" name="map_web_imagepath" value="C:\Inetpub\wwwroot\biz_new\AMS_Final\MapServer\temp\"/]
[/form]
[img src="[img]" width="400" height="300" border="0"/]
[/body]
[/html]

Directory Structure:
c:\inetpub\scripts\mapserv.exe
c:\inetpub\wwwroot\biz_new\admin\trial.html
c:\inetpub\wwwroot\biz_new\admin\hello.map
c:\inetpub\wwwroot\biz_new\AMS\MapServer\lib\[all library files]
c:\inetpub\wwwroot\biz_new\AMS\MapServer\temp\[all jpeg files]
c:\inetpub\wwwroot\biz_new\AMS\shape\statesp020.shp
c:\inetpub\wwwroot\biz_new\AMS\shape\statesp020.shx
c:\inetpub\wwwroot\biz_new\AMS\shape\statesp020.dbf

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



blindthief
(Stranger )
05/24/07 06:43 AM
Re: MapServer working... almost [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

 

Trimble
CADalog.com - Countless CAD add-ons, plug-ins and more.



Internet Business Systems © 2016 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