[MS4W-Users] MS4W-Users Digest, Vol 101, Issue 8

krisk82 at gmail.com krisk82 at gmail.com
Sun Sep 30 16:20:59 EST 2012


Jeff:

Thanks for quick reply.

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.

The image displays fine now.  If I have any other issues, I'll know where
to turn!

Thank you again!

Best,

Kristen



On Sun, Sep 30, 2012 at 10:00 AM, <ms4w-users-request at lists.maptools.org>wrote:

> Send MS4W-Users mailing list submissions to
>         ms4w-users at lists.maptools.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.maptools.org/mailman/listinfo/ms4w-users
> or, via email, send a message with subject or body 'help' to
>         ms4w-users-request at lists.maptools.org
>
> You can reach the person managing the list at
>         ms4w-users-owner at lists.maptools.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of MS4W-Users digest..."
>
>
> Today's Topics:
>
>    1. MS4W -- Shapefile not drawing via mapserver (krisk82 at gmail.com)
>    2. Re: MS4W -- Shapefile not drawing via mapserver (Jeff McKenna)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 30 Sep 2012 00:31:12 -0700
> From: "krisk82 at gmail.com" <krisk82 at gmail.com>
> Subject: [MS4W-Users] MS4W -- Shapefile not drawing via mapserver
> To: ms4w-users at lists.maptools.org
> Message-ID:
>         <CAEjJ+Z2-oeDj+r7WwoknbPsrHaVOdzZ1Br4hjGVORc-=
> NfRS8g at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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-0001.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-0001.png
>
> ------------------------------
>
> Message: 2
> Date: Sun, 30 Sep 2012 09:23:17 -0600
> From: "Jeff McKenna" <jmckenna at gatewaygeomatics.com>
> Subject: Re: [MS4W-Users] MS4W -- Shapefile not drawing via mapserver
> To: ms4w-users at lists.maptools.org
> Message-ID:
>         <
> 87e33f3f670278e22fa2b92bca3ff253.squirrel at www.gatewaygeomatics.com>
> Content-Type: text/plain;charset=utf-8
>
>
> >
> > 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
> >>
> >
> >
>
> Hello Kristen,
>
> I can give some quick thoughts, but i'm out of the office this week so
> others will have to followup with you here on this mailing list.  Some
> thoughts:
>
> - there is no error with shp2img, as it seems MapServer was never told to
> draw your layer.  Make sure you have STATUS ON in your trouble layer, or
> maybe use the layer switch (-l ?) to call that layer specifically with
> shp2img.
>
> - maybe also use the shp2img switch '-all_debug 5' instead of
> '-map_debug', to see even more output
>
> - also verify the commandline utility 'ogrinfo' can read your shapefile
>
> - maybe set your SHAPEPATH to "./data/" (assuming that is the path from
> your mapfile) and make sure your 'land_poly.shp' lives in that data folder
>
> I hope others step in here on this mailing list with their thoughts if I
> cannot reply in time.
>
> -jeff
>
>
> --
> Jeff McKenna
> Director, Gateway Geomatics
> http://www.gatewaygeomatics.com
>
>
>
>
>
>
>
>
>
>
>
> ------------------------------
>
> _______________________________________________
> MS4W-Users mailing list
> MS4W-Users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ms4w-users
>
>
> End of MS4W-Users Digest, Vol 101, Issue 8
> ******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ms4w-users/attachments/20120930/8cda6315/attachment.htm 


More information about the MS4W-Users mailing list