[OpenLayers-Users] FW: wfs with mapserver

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Thu Oct 11 14:03:26 EDT 2007


> Hi Robert,
> Tried out your suggestions and the ones on the other email you sent and I 
> managed to display the map, thanks! :)
> My only problem now is with the time it's taking to run - several minutes 
> both to load the image at first and to every single operation - pan is 
> almost impossible.

Congratulations! You have moved in lock-step with my own experiences... 1) overcome knowledge gap to get mapserver WFS to display, followed by 2) realize that the shapes that I am displaying are so complicated that the client side rendering becomes quite sluggish!

What I have done, which has helped somewhat, is to follow suggestions from the OL listserv regarding my problems at step #2:  Use a simplify() function to make my shapes less complicated, and combining WMS and WFS to speed rendering.  WMS, since it produces an image, can be used very economically to display underlying features (background images and shapes).  WFS is then reserved for ONLY the features that you absolutely need to have as selectable vectors, and where you need to have attribute information on the client side.  Depending on the application, you may find that you need to have only minimal amounts of entities displayed as WFS, even if you needed to do something such as selection highlighting, and attribute retrieval, much of this can be done in the background using queries if you need.  The nice thing about using mapserver, is that you can have a single map file act as the WMS and WFS source.

I am working on overcoming these issues myself, so I will be very interested to hear your ongoing thoughts and solutions.

r.b.

-----Original Message-----
From: Tasslehoff Burrfoot [mailto:tasslehoff66 at hotmail.com] 
Sent: Thursday, October 11, 2007 1:54 PM
To: Burgholzer,Robert
Subject: RE: FW: [OpenLayers-Users] wfs with mapserver

Hi Robert,
Tried out your suggestions and the ones on the other email you sent and I 
managed to display the map, thanks! :)
My only problem now is with the time it's taking to run - several minutes 
both to load the image at first and to every single operation - pan is 
almost impossible. It's a 500kb shapefile, I dunno if it's usual for it to 
take that long, but I don't expect it to be.
I'm not on the mailing list yet, though I'll join it, probably with my work 
email address, since we should be using it soon. Will let you know.
Thanks for all your help!

>From: "Burgholzer,Robert" <rwburgholzer at deq.virginia.gov>
>To: <tasslehoff66 at hotmail.com>
>Subject: FW: [OpenLayers-Users] wfs with mapserver
>Date: Thu, 11 Oct 2007 11:59:25 -0400
>
>In case you're not on the list (it's a good one, well worth your time).
>
>r.b.
>
>-----Original Message-----
>From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On 
>Behalf Of Burgholzer,Robert
>Sent: Thursday, October 11, 2007 10:51 AM
>To: users at openlayers.org
>Subject: Re: [OpenLayers-Users] wfs with mapserver
>
>My thought is that you may wish to experiment with some of the settings 
>that you have in calling your layer from OpenLayers.  The one that is 
>working for me is:
>             layer2 = new OpenLayers.Layer.WFS( "proj_subsheds",
>                     url, {typename: 'proj_subsheds' },
>                {
>                       typename: 'proj_subsheds',
>                       featureNS: 'http://www.openplans.org/topp',
>                       extractAttributes: true
>                } );
>
>Which differs from yours in that you have included a "maxfeatures" 
>attribute, and you have a "featureClass" specification, whereas I do not, 
>and I have a "featureNS" in mine, and you do not.
>
>My settings have been gleaned from working openlayers examples, so perhaps 
>you should duplicate these (I think that leaving the "maxfeatures" should 
>be OK, since I have seen that in working implementations) and see what 
>happens.
>
>Let me know!
>r.b.
>
>PS - please make sure that your response goes to the listserv, as this will 
>help catalog our dialog, and possibly help someone else in the future.
>
>-----Original Message-----
>From: Tasslehoff Burrfoot [mailto:tasslehoff66 at hotmail.com]
>Sent: Thursday, October 11, 2007 10:19 AM
>To: Burgholzer,Robert
>Subject: RE: wfs with mapserver
>
>Robert,
>Thanks for you quick answer.
>I had went through the how-to, and now changed all address to my local ip,
>but it still won't work. I queried the server for getFeature and it works
>fine. I might be having projection problems, but i set them up all as the
>same, and it still won't show the map, so i'm at a loss here, specially
>since i'm very new to gis, projections and all. I'm sending you the codes,
>if you can have a look at them i'd greatly appreciate it. Thanks a lot!
>
>OpenLayers creation:
>
>layer = new OpenLayers.Layer.WFS( "Test MapServer",
>
>"http://10.0.16.47/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/testwfs.map",
>                 {typename: "Test", maxfeatures: 10},
>                 { featureClass: OpenLayers.Feature.WFS, isBaseLayer: 
>true});
>
>MAP file:
>
>MAP
>   NAME WFS_server
>   STATUS ON
>   IMAGETYPE      PNG
>   EXTENT         -97.238976 41.619778 -82.122902 49.385620
>   SIZE           400 300
>   SHAPEPATH      "/ms4w/apps/tutorial/data"
>   IMAGECOLOR     255 255 255
>
>
>   # Definições para servidor WFS
>   WEB
>     IMAGEPATH "/ms4w/tmp/ms_tmp/"
>     IMAGEURL "/ms_tmp/"
>     METADATA
>       "wfs_title" "GMap WFS Demo Server"
>       "wfs_onlineresource" "http://10.0.16.47/cgi-bin/mapserv.exe?"
>       "wfs_srs" "EPSG:4326"
>     END
>   END
>
>
>   # Start of LAYER DEFINITIONS 
>---------------------------------------------
>   LAYER # States polygon layer begins here
>     NAME         states
>     METADATA
>       "wfs_title" "states"
>       "gml_includeitems" "all"
>	"gml_excludeitems" ""
>     END
>     DATA         states_ugl
>     PROJECTION
>       "init=EPSG:4326"
>     END
>     STATUS       ON
>     TYPE         POLYGON
>     DUMP TRUE
>
>
>     CLASS
>       NAME       "The Upper Great Lakes States"
>
>       STYLE
>         COLOR        132 232 132
>         OUTLINECOLOR 32 32 32
>       END
>     END
>   END # States polygon layer ends here
>   # End of LAYER DEFINITIONS -------------------------------
>
>END
>
>
> >From: "Burgholzer,Robert" <rwburgholzer at deq.virginia.gov>
> >To: <tasslehoff66 at hotmail.com>,<users at openlayers.org>
> >Subject: RE: wfs with mapserver
> >Date: Thu, 11 Oct 2007 09:21:46 -0400
> >
> >Tasslehoff66,
> >My problem ended up being because I had a couple of difficulties, I will
> >try to enumerate them here (HTH!), although they may not be in the most
> >useful order:
> >
> >1. Projection troubles, I had a mix of "proj=latlon" and
> >"init=epsg:4326", they have no problem co-existing under normal map
> >server operation, and WMS, however, under WFS they seemed to be a deal
> >breaker.
> >2. Make sure that you go through the "must haves" in:
> >http://mapserver.gis.umn.edu/docs/howto/wfs_server  there are a number
> >of deal-breakers here as well.
> >3. Make sure that you can query the server from an URL, and get properly
> >formatted WFS XML output, i.e.,
> >../cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/testwfs.map&typena
> >me=proj_points&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature
> >
> >where "typename" is the name of some layer that you have in your mapfile
> >(mine is "proj_points").  Below is my version:
> >
> >http://172.16.210.66/cgi-bin/mapserv.exe?map=C:/usr/local/home/httpd/uci
> >tool//map_proj3.map&typename=proj_points&SERVICE=WFS&VERSION=1.0.0&REQUE
> >ST=GetFeature
> >
> >4. Check that your map location is correct, the "../cgi-bin" reference
> >in your setup seems that it could be a problem. Maybe "/cgi-bin" without
> >the ".." in front would work?
> >
> >5. Finally, check that the URL of your page, and the URL of the map have
> >the same base IP.  I ran into trouble because I was loading my page in
> >my browser as "localhost", and I had my map defined as "172.16.xx.yy".
> >When this occurs, the openlayers wishes there to be a proxy defined, and
> >this is troublesome.  By typing in the proper IP "172..." in my browser,
> >I was golden.
> >
> >
> >Good luck!
> >
> >Robert W. Burgholzer
> >Surface Water Modeler
> >Office of Water Supply and Planning
> >Virginia Department of Environmental Quality
> >rwburgholzer at deq.virginia.gov
> >804-698-4405
> >Open Source Modeling Tools:
> >http://sourceforge.net/projects/npsource/
> >Web-Based Water Supply Planning Demo:
> >http://soulswimmer.dynalias.net/models/wsdemo/demo_hsi.php
> >
> >-----Original Message-----
> >From: tasslehoff66 at hotmail.com [mailto:tasslehoff66 at hotmail.com]
> >Sent: Thursday, October 11, 2007 8:53 AM
> >To: Burgholzer,Robert
> >Subject: wfs with mapserver
> >
> >Hi Robert,
> >I'm trying to test openlayers' wfs with MapServer, and ran into the same
> >problem as you did - the screen showing blank. I'm wondering how you set
> >up the locations, since it might be what's going wrong for me. Mine is
> >set as follows:
> >http://localhost/openlayers/wfs_mapserv.html for the html file.
> >"../cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/testwfs.map" for
> >the map file.
> >I went through the steps you did also, setting the wfs layer as the base
> >layer and the layer projection.
> >Thanks for your help.
>
>_________________________________________________________________
>Chegou o Windows Live Spaces com rede social. Confira
>http://spaces.live.com/
>_______________________________________________
>Users mailing list
>Users at openlayers.org
>http://openlayers.org/mailman/listinfo/users

_________________________________________________________________
Inscreva-se no novo Windows Live Mail beta e seja um dos primeiros a testar 
as novidades-grátis. Saiba mais: 
http://www.ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d



More information about the Users mailing list