[MS4W-Users] MS4W -- Shapefile not drawing via mapserver
krisk82 at gmail.com
krisk82 at gmail.com
Sun Sep 30 02:31:12 EST 2012
Hello:
Right now I'm trying to build a static map and from there build an
interactive map--similar to the MS4W tutorial that came with the
installation. I have had issues with Mapserver NOT drawing the polygons
associated with my shapefile.
Here are some details of my setup:
MS4W - MapServer 4 Windows - version 3.0.6
> MapServer CGI 6.0.3 at /cgi-bin/mapserv.exe
>
My apache configuration to point to the web app folder is fine. Here is the
fiile path on my HDD. To connect to the web app webpage I visit:
http://localhost/testpage/
Location of mapfile --> C:\ms4w\apps\testpage\htdocs
> Location of shapefile --> C:\ms4w\apps\testpage\htdocs\data\land_poly.shp
>
When I try to access the image via url (
http://localhost/cgi-bin/mapserv.exe?MAP=/ms4w/apps/testpage/htdocs/kristenmap.map&layer=land&mode=map),
I receive the following error:
*msDrawMap(): Image handling error. Failed to draw layer named 'land'.
msShapefileOpen(): Unable to access file.
(/ms4w/apps/testpage/htdocs/land_poly) msShapefileOpen(): Unable to access
file. (/data/land_poly) *
That lead me to see what was going on via shp2img, using "-map_debug 3"
parameter. shp2img.exe returned to me the following responses:
C:\ms4w\Apache\cgi-bin>shp2img -m
> c:\ms4w\apps\testpage\htdocs\kristenm c:\ms4w\apps\testpage\htdocs\test.png
> -map_debug 3
> msDrawMap(): rendering using outputformat named png (AGG/PNG).
> msDrawMap(): WMS/WFS set-up and query, 0.000s
> msDrawMap(): Drawing Label Cache, 0.000s
> msDrawMap() total time: 0.000s
> msSaveImage(c:\ms4w\apps\testpage\htdocs\test.png) total time: 0.141s
>
It looks like the shp2img is probably running into the same error--not
being able to find the shapefile. The PNG file that shp2img creates is just
a blue rectangle (blue is the map image background). I am not sure what is
going on with the shapefile file paths. In my map file I indicated "
SHAPEPATH "/data/". Here's the mapfile in its entirety. Hopefully, this
is a pretty small fix and that someone can help me out. THANKS!
#Developer Kristen K
> #Date Created 09-29-2012
> #Date Modified 09-29-2012
> #
> #
> #
> #
> #
> #This Mapserver Mapfile was created for Kristen's first map.
> #In the order of rendering (bottom to top), the map contains the following
> types of layers:
> #
> # land, shapefile, polygon
> # SFBayCTs, shapefile, polygon
> # tl_2012_06_sfbay_censustracts, shapefile, polygon
> # sfbayplaces_cities, shapefile, polygon
> # tb_2012_06_SFBayprisecroads, shapefile, line
> # bayarea_allwater, shapefile, polygon
> # SF Bay Area Congressional Districts, shapefile, polygon
> # sfbaycounties, shapefile, polygon
> #
> #
> #
> #
> #------Beginning of the Map Object instructions
> #
> MAP
> NAME MapName
> IMAGETYPE PNG
> EXTENT -122.284468 37.292177 -121.731412 37.619507
> SIZE 800 600
> IMAGECOLOR 190 232 255
> SHAPEPATH "/data/"
>
> ####Output format information. Might not be necessary
>
> OUTPUTFORMAT
> NAME png
> DRIVER 'GDAL/PNG'
> MIMETYPE 'image/png'
> IMAGEMODE RGBA
> EXTENSION 'png'
> END
>
> # Beginning of Layer Definitions. Layers listed start from the first
> (bottom) rendered layer to first (top)
>
> LAYER
> NAME land
> DATA land_poly
> STATUS OFF
> TYPE POLYGON
> CLASS
> NAME 'Land Mass of The Bay Area'
> STYLE
> COLOR 255 255 190
> END
> END
> END
>
> END
> #------End of the Map Object instructions
>
Thank you in advance!
Best,
Kristen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20120930/ad2effea/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.png
Type: image/png
Size: 2791 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/ms4w-users/attachments/20120930/ad2effea/attachment.png
More information about the MS4W-Users
mailing list