WFS Configuration

From MapbenderWiki

Jump to: navigation, search

Contents

Preparation

  • Table (database) / Layer have to be of type POINT, MULTILINESTRING or MULTIPOLYGON (current requirements for Mapbender 2.4.)
  • Table has to have a field of type serial with a primary key (current Geoserver 1.5.3). After configuration within Geoserver and Mapbender this field will not be displayed anymore, but is necessary for fid of the gml).
  • Administration of Geoserver
  • Create datastore in Geoserver
  • Create featuretype in Geoserver
  • Configuration of WFS within Mapbender (see detailed description below)

WFS Configuration

The module for loading a WFS is integrated in the administration interface 'admin1' and 'admin_xx_services'. Note that the userspecific administration of the WFS services is yet not fully implemented, so this module shall only be available for administrators.

Loading WFS

Load a WFS into a GUI
Enlarge
Load a WFS into a GUI

Configure a WFS respectively a gazetteer with the corresponding modules in the administration interface in Mapbender. Load a WFS with the module 'LOAD WFS'. Choose a gui and fill in the path or URL to the WFS-Capabilities document. After successful upload of the WFS-Capabilities document, the data within this document will be shown in the administration interface of Mapbender. The next step is to configure the WFS, so the different modules of Mapbender are able to use it.

Example:

http://wms1.ccgis.de/geoserver/wfs?REQUEST=getCapabilities&VERSION=1.0.0&SERVICE=WFS

Configuring WFS

Configure the WFS with the module 'WFS CONF' for further processing in different modules. Select a WFS for configuration from the dropdown-menu. Following all layers are chooseable, which are defined in Geoserver as FeatureTypes. After activating a layer/FeatureType the following settings are possible:

  • Abstract: Choose a unique name to use for further identification of the WFS.
  • Label: Title of the gazetteer.
  • Label_id: Unique ID for the declaration of a class of a stylesheet in the field 'Style' (see below).
  • Button: Labeling of the button for sending the WFS-request.
  • Button_id: Unique ID for the declaration of a class of a stylesheet in the field 'Style' (see below).
  • Style: Definition of stylesheets (Design).
  • Buffer: Declaration for a buffer to zoom to an object (map units).
  • ResultStyle: Declaration for layout (stylesheet) of the resultset (classes even/uneven)
  • WZ-Graphics: Selection for clientsided rendering of geometries (within the browser)
  • Settings for single attributes:
Configuration Attribute
Enlarge
Configuration Attribute
    • geom: Definition of the geometry field.
    • gid: Definition of a unique ID (for transanction).
    • search: Attribute shall be offered for a alphanumeric search (textfield).
    • pos: Position of the textfields. This is important for the order of the fields (use with tabulators > Accessibility).
    • style_id: Definition of a stylesheet-class, which can be done in the field 'Style' (Layout).
    • upper: If values within the underlaying table are uppercase, entries in the client will be also changed to uppercase, so a caseinsensitive search can be done.
    • label: Labeling of the textfield.
    • label_id: Definition of a stylesheet-class, which can be done in the field 'Style' (Layout).
    • show: Values of an attribute column will be shown in the resultset.
    • position: Position of the displayed field in the resultset.
    • mandatory: mandatory field for saving and updating.
    • html: this field can be used to enter a select-field. The option value will be used for saving. Name and ID of the select-field have to be the same as the according attribute, e.g.:
<select name='objekttyp_id'  id='objekttyp_id'>
 <option>Auswahl...</option>
 <option value='1'>Landschaftselement</option>
 <option value='2'>Wald</option>
 <option value='3'>Landw. Nutzfl.</option>
 <option value='4'>Hof-Weg-Gebaeude</option>
 <option value='5'>sonstige nicht LN</option>
 <option value='20'>sonstiges</option>
</select>

The html field can also be used to enter a checkbox. Name and ID of the checkbox have to be the same as the according attribute, in the example below: 'altlastenkataster'. Please note that you use only single quotes.

 <input type='checkbox' name='altlastenkataster' id='altlastenkataster' value='1'>

Important for a WFS-T is the definition of an abstract and the setting for the geometry column by activating the radiobutton. Also a unique GID is important. If there is no OID column, it is possible to use the geometry column for this purpose. Finally don't forget to save your configuration with the button SAVE.

To change your configuration, see the link editWFSConfiguration. Choose an existing WFS from the dropdown-menu and change your settings.

Connecting a WFS to a Gui

Connect the loaded and configured WFS/ WFS-T to a Gui with the module EDIT GUI-WMS. After choosing the corresponding Gui and WMS, see the button setWFS in each row in the schema in table form. Set the connection to the defined FeatureType within Geoserver with this button setWFS. Following choose and save the FeatureType (previously named abstract). Finally the ID of the FeatureType will be shown on the button setWFS, e.g. WFS: 10. If the GUI_Digitize was chosen for building your Gui, your configured WFS-T is now ready to use.

Notice

The WFS selection is connected to the queryability of a WMS Layer. That means that Layer, which are connected to a WFS configuration have to be queryable (see getCapabilities-document: queryable=1)

Assign a WFS to a GUI

To activate the above described configuration, assign the WFS configuration to a gui. Choose the module assign WFS conf to GUI within the gui admin_en_services.

Choose the according wfs from the wfs list. All configurated wfs will now show up in the wfs configuration list. Choose now the gui from the gui list and assign the wfs configuration to the gui with the arrow button. To remove the gui configuration from a gui use the arrow button to the left.

Personal tools