[OpenLayers-Users] trouble with WFS and Mapserver

Arnd Wippermann arnd.wippermann at web.de
Thu Sep 27 16:57:31 EDT 2007


when you use FF with firebug, you can get the request for the WFS-layer.
Something like this:
 
http://geturl.asp?http%3A//localhost/mapserv.exe%3Fmap%3DTreppen.map
%26typename%3DPOI
%26maxfeatures%3D10
%26SERVICE%3DWFS
%26VERSION%3D1.0.0
%26REQUEST%3DGetFeature
%26SRS%3DEPSG%253A4326
%26BBOX%3D6.416875%2C50.556875%2C7.823125%2C51.963125
 
Retrieve the Url with your Internet Explorer and you should get some xml. If
not than i would think your proxy is not right or your mapfile. If you cut
the SRS and BBOX from the Url and then get an answer, it looks like you have
a problem with the projections in your mapfile.
 
To get my own WFS-layer working, i have learned
 
1. if the SRS in the request is the same as the WFS-layer, I only have to
declare a projection in the layer block
 
2. if the SRS in the request is different from the WFS-layer, I have to
declare the requested SRS as 'wfs_srs'  'EPSG:xxxx' in the WEB block and the
projection in the LAYER block of the WFS-layer. Then my data will reproject
and show in OpenLayers.
 
You have also declare 'wms_srs' in the WEB block for the requested SRS.
 
What I not understand, is, when I'm right with my mapfile, I must have for
different requested SRS an own mapfile.

Mit freundlichen Grüssen

Arnd Wippermann
http://gis.ibbeck.de/ginfo/



 
  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Burgholzer,Robert
Gesendet: Donnerstag, 27. September 2007 22:06
An: users at openlayers.org
Betreff: [OpenLayers-Users] trouble with WFS and Mapserver



I am having a hard time getting my mapserver to serve up WFS layers (or
accessing them via OpenLayers, I really don’t know which).

 

I have tested the mapserver with WMS, and all is good. I am able to retrieve
WFS data from mapserver via an URL request for getfeature, however, I get no
success when trying to load it into openlayers via WFS, just a blank map.
In the javascript error console, all I get is an error that the “maxExtent
has no properties”, indicating that there are no valid layers, I assume,
which is of course evidenced by the fact that my map is blank.

 

My creation statement and mapserver layer description is as follows:

 

OL:

            layer1 = new OpenLayers.Layer.WFS( "poli_bounds",

                    url, {'typename': 'poli_bounds'},

               {

                      typename: 'poli_bounds',

                      featureNS: 'http://www.openplans.org/topp',

                      extractAttributes: false

               } );

 

MAPFILE:

LAYER

   CONNECTIONTYPE postgis

   CONNECTION "host=localhost user=postgres password=*** dbname=wsp"

   NAME poli_bounds

   GROUP poli_bounds

   TYPE POLYGON

   STATUS DEFAULT

   DUMP TRUE

   DATA "the_geom from poli_bounds"

   FILTER "1 = 1"

   TEMPLATE drought.html

   #MINSCALE 1000

   #MAXSCALE 50000

   LABELITEM "name"

   CLASS

      NAME "Political Boundaries"

      SYMBOL 'circle'

      SIZE 3

      COLOR -1 -1 -1

      BACKGROUNDCOLOR 0 0 0

      OUTLINECOLOR 0 0 0

      LABEL

        COLOR 8 8 174

        #SHADOWCOLOR 218 218 218

        #SHADOWSIZE 2 2

        TYPE TRUETYPE

        FONT arial

        SIZE 7

        ANTIALIAS TRUE

        POSITION CC

        PARTIALS FALSE

        MINDISTANCE 300

        MINFEATURESIZE 30

        BUFFER 4

        #MINSCALE 1000

        #MAXSCALE 50000

      END # end of label

   END

   TOLERANCE 10

   PROJECTION

   # EPSG SRID = 4326

     "proj=latlong"

   END

   METADATA

    "DESCRIPTION"   "Political Boundaries"

    "RESULT_FIELDS" "name county state"

    "wfs_title"    "poli_bounds" ## REQUIRED

    "gml_featureid" "gid" ## REQUIRED

    "gml_include_items" "all"  ## Optional (serves all attributes for layer)

      "title" "Political Boundaries"

      "tablename" "Political Boundaries"

   END

END

 

 

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

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070927/b1677c7b/attachment.html


More information about the Users mailing list