Jeff:<br><br>Thanks for quick reply. <br><br>I ran ogrinfo on the shapefiles in my data directory and the utility appears to open the files correctly. I really suspected that my error had to do with filepaths so I updated my SHAPEPATH to "./data/" as you suggested. I guess there is some kind of syntax issue. I was working off of the tutorial mapfile and found that whoever wrote the mapfile indicated "../data" as their SHAPEPATH.<br>
<br>The image displays fine now. If I have any other issues, I'll know where to turn!<br><br>Thank you again!<br><br>Best,<br><br>Kristen<br><br><br><br><div class="gmail_quote">On Sun, Sep 30, 2012 at 10:00 AM, <span dir="ltr"><<a href="mailto:ms4w-users-request@lists.maptools.org" target="_blank">ms4w-users-request@lists.maptools.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send MS4W-Users mailing list submissions to<br>
<a href="mailto:ms4w-users@lists.maptools.org">ms4w-users@lists.maptools.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://lists.maptools.org/mailman/listinfo/ms4w-users" target="_blank">http://lists.maptools.org/mailman/listinfo/ms4w-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:ms4w-users-request@lists.maptools.org">ms4w-users-request@lists.maptools.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:ms4w-users-owner@lists.maptools.org">ms4w-users-owner@lists.maptools.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of MS4W-Users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. MS4W -- Shapefile not drawing via mapserver (<a href="mailto:krisk82@gmail.com">krisk82@gmail.com</a>)<br>
2. Re: MS4W -- Shapefile not drawing via mapserver (Jeff McKenna)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sun, 30 Sep 2012 00:31:12 -0700<br>
From: "<a href="mailto:krisk82@gmail.com">krisk82@gmail.com</a>" <<a href="mailto:krisk82@gmail.com">krisk82@gmail.com</a>><br>
Subject: [MS4W-Users] MS4W -- Shapefile not drawing via mapserver<br>
To: <a href="mailto:ms4w-users@lists.maptools.org">ms4w-users@lists.maptools.org</a><br>
Message-ID:<br>
<CAEjJ+Z2-oeDj+r7WwoknbPsrHaVOdzZ1Br4hjGVORc-=<a href="mailto:NfRS8g@mail.gmail.com">NfRS8g@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hello:<br>
<br>
Right now I'm trying to build a static map and from there build an<br>
interactive map--similar to the MS4W tutorial that came with the<br>
installation. I have had issues with Mapserver NOT drawing the polygons<br>
associated with my shapefile.<br>
<br>
Here are some details of my setup:<br>
<br>
MS4W - MapServer 4 Windows - version 3.0.6<br>
> MapServer CGI 6.0.3 at /cgi-bin/mapserv.exe<br>
><br>
<br>
My apache configuration to point to the web app folder is fine. Here is the<br>
fiile path on my HDD. To connect to the web app webpage I visit:<br>
<a href="http://localhost/testpage/" target="_blank">http://localhost/testpage/</a><br>
<br>
Location of mapfile --> C:\ms4w\apps\testpage\htdocs<br>
> Location of shapefile --> C:\ms4w\apps\testpage\htdocs\data\land_poly.shp<br>
><br>
When I try to access the image via url (<br>
<a href="http://localhost/cgi-bin/mapserv.exe?MAP=/ms4w/apps/testpage/htdocs/kristenmap.map&layer=land&mode=map" target="_blank">http://localhost/cgi-bin/mapserv.exe?MAP=/ms4w/apps/testpage/htdocs/kristenmap.map&layer=land&mode=map</a>),<br>
I receive the following error:<br>
<br>
*msDrawMap(): Image handling error. Failed to draw layer named 'land'.<br>
msShapefileOpen(): Unable to access file.<br>
(/ms4w/apps/testpage/htdocs/land_poly) msShapefileOpen(): Unable to access<br>
file. (/data/land_poly) *<br>
<br>
That lead me to see what was going on via shp2img, using "-map_debug 3"<br>
parameter. shp2img.exe returned to me the following responses:<br>
<br>
C:\ms4w\Apache\cgi-bin>shp2img -m<br>
> c:\ms4w\apps\testpage\htdocs\kristenm c:\ms4w\apps\testpage\htdocs\test.png<br>
> -map_debug 3<br>
> msDrawMap(): rendering using outputformat named png (AGG/PNG).<br>
> msDrawMap(): WMS/WFS set-up and query, 0.000s<br>
> msDrawMap(): Drawing Label Cache, 0.000s<br>
> msDrawMap() total time: 0.000s<br>
> msSaveImage(c:\ms4w\apps\testpage\htdocs\test.png) total time: 0.141s<br>
><br>
<br>
It looks like the shp2img is probably running into the same error--not<br>
being able to find the shapefile. The PNG file that shp2img creates is just<br>
a blue rectangle (blue is the map image background). I am not sure what is<br>
going on with the shapefile file paths. In my map file I indicated "<br>
SHAPEPATH "/data/". Here's the mapfile in its entirety. Hopefully, this<br>
is a pretty small fix and that someone can help me out. THANKS!<br>
<br>
#Developer Kristen K<br>
> #Date Created 09-29-2012<br>
> #Date Modified 09-29-2012<br>
> #<br>
> #<br>
> #<br>
> #<br>
> #<br>
> #This Mapserver Mapfile was created for Kristen's first map.<br>
> #In the order of rendering (bottom to top), the map contains the following<br>
> types of layers:<br>
> #<br>
> # land, shapefile, polygon<br>
> # SFBayCTs, shapefile, polygon<br>
> # tl_2012_06_sfbay_censustracts, shapefile, polygon<br>
> # sfbayplaces_cities, shapefile, polygon<br>
> # tb_2012_06_SFBayprisecroads, shapefile, line<br>
> # bayarea_allwater, shapefile, polygon<br>
> # SF Bay Area Congressional Districts, shapefile, polygon<br>
> # sfbaycounties, shapefile, polygon<br>
> #<br>
> #<br>
> #<br>
> #<br>
> #------Beginning of the Map Object instructions<br>
> #<br>
> MAP<br>
> NAME MapName<br>
> IMAGETYPE PNG<br>
> EXTENT -122.284468 37.292177 -121.731412 37.619507<br>
> SIZE 800 600<br>
> IMAGECOLOR 190 232 255<br>
> SHAPEPATH "/data/"<br>
><br>
> ####Output format information. Might not be necessary<br>
><br>
> OUTPUTFORMAT<br>
> NAME png<br>
> DRIVER 'GDAL/PNG'<br>
> MIMETYPE 'image/png'<br>
> IMAGEMODE RGBA<br>
> EXTENSION 'png'<br>
> END<br>
><br>
> # Beginning of Layer Definitions. Layers listed start from the first<br>
> (bottom) rendered layer to first (top)<br>
><br>
> LAYER<br>
> NAME land<br>
> DATA land_poly<br>
> STATUS OFF<br>
> TYPE POLYGON<br>
> CLASS<br>
> NAME 'Land Mass of The Bay Area'<br>
> STYLE<br>
> COLOR 255 255 190<br>
> END<br>
> END<br>
> END<br>
><br>
> END<br>
> #------End of the Map Object instructions<br>
><br>
<br>
Thank you in advance!<br>
<br>
Best,<br>
<br>
Kristen<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.maptools.org/pipermail/ms4w-users/attachments/20120930/ad2effea/attachment-0001.htm" target="_blank">http://lists.maptools.org/pipermail/ms4w-users/attachments/20120930/ad2effea/attachment-0001.htm</a><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: test.png<br>
Type: image/png<br>
Size: 2791 bytes<br>
Desc: not available<br>
Url : <a href="http://lists.maptools.org/pipermail/ms4w-users/attachments/20120930/ad2effea/attachment-0001.png" target="_blank">http://lists.maptools.org/pipermail/ms4w-users/attachments/20120930/ad2effea/attachment-0001.png</a><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Sun, 30 Sep 2012 09:23:17 -0600<br>
From: "Jeff McKenna" <<a href="mailto:jmckenna@gatewaygeomatics.com">jmckenna@gatewaygeomatics.com</a>><br>
Subject: Re: [MS4W-Users] MS4W -- Shapefile not drawing via mapserver<br>
To: <a href="mailto:ms4w-users@lists.maptools.org">ms4w-users@lists.maptools.org</a><br>
Message-ID:<br>
<<a href="mailto:87e33f3f670278e22fa2b92bca3ff253.squirrel@www.gatewaygeomatics.com">87e33f3f670278e22fa2b92bca3ff253.squirrel@www.gatewaygeomatics.com</a>><br>
Content-Type: text/plain;charset=utf-8<br>
<br>
<br>
><br>
> That lead me to see what was going on via shp2img, using "-map_debug 3"<br>
> parameter. shp2img.exe returned to me the following responses:<br>
><br>
> C:\ms4w\Apache\cgi-bin>shp2img -m<br>
>> c:\ms4w\apps\testpage\htdocs\kristenm<br>
>> c:\ms4w\apps\testpage\htdocs\test.png<br>
>> -map_debug 3<br>
>> msDrawMap(): rendering using outputformat named png (AGG/PNG).<br>
>> msDrawMap(): WMS/WFS set-up and query, 0.000s<br>
>> msDrawMap(): Drawing Label Cache, 0.000s<br>
>> msDrawMap() total time: 0.000s<br>
>> msSaveImage(c:\ms4w\apps\testpage\htdocs\test.png) total time: 0.141s<br>
>><br>
><br>
><br>
<br>
Hello Kristen,<br>
<br>
I can give some quick thoughts, but i'm out of the office this week so<br>
others will have to followup with you here on this mailing list. Some<br>
thoughts:<br>
<br>
- there is no error with shp2img, as it seems MapServer was never told to<br>
draw your layer. Make sure you have STATUS ON in your trouble layer, or<br>
maybe use the layer switch (-l ?) to call that layer specifically with<br>
shp2img.<br>
<br>
- maybe also use the shp2img switch '-all_debug 5' instead of<br>
'-map_debug', to see even more output<br>
<br>
- also verify the commandline utility 'ogrinfo' can read your shapefile<br>
<br>
- maybe set your SHAPEPATH to "./data/" (assuming that is the path from<br>
your mapfile) and make sure your 'land_poly.shp' lives in that data folder<br>
<br>
I hope others step in here on this mailing list with their thoughts if I<br>
cannot reply in time.<br>
<br>
-jeff<br>
<br>
<br>
--<br>
Jeff McKenna<br>
Director, Gateway Geomatics<br>
<a href="http://www.gatewaygeomatics.com" target="_blank">http://www.gatewaygeomatics.com</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
MS4W-Users mailing list<br>
<a href="mailto:MS4W-Users@lists.maptools.org">MS4W-Users@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/ms4w-users" target="_blank">http://lists.maptools.org/mailman/listinfo/ms4w-users</a><br>
<br>
<br>
End of MS4W-Users Digest, Vol 101, Issue 8<br>
******************************************<br>
</blockquote></div><br>