[OpenLayers-Users] wfs with mapserver

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Thu Oct 11 10:50:46 EDT 2007


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/



More information about the Users mailing list