In the following, the configuration of deegree WFS is to be shown on the basis of an example. All configuration files and data are attached to the mentioned deegree demo WFS.
The following FeatureTypes (data sets) have to be made accessible by the WFS:
Table 4. Feature Types
| FeatureType | Description | Data source | DataStore |
|---|---|---|---|
| Cities | Important cities of Europe | MS Access DB | PointDBDataStore |
| Europe | International borders of Europe | MS Access DB | GMLDBDataStore |
| Rivers | largest rivers of Europe | ESRI Shapefile | ShapeDataStore |
In the example, the WFS ensures only reading access to the data. Accordingly, the following Capabilities document must be provided:
<?xml version="1.0" encoding="UTF-8"?>
<WFS_Capabilities version="1.0.0">
<Service>
<Name>WebFeatureServer</Name>
<Title>deegree WFS</Title>
<Abstract>Web Feature Server maintained by the lat/lon GmbH</Abstract>
<OnlineResource>http://127.0.0.1:8080/deegreewfs?</OnlineResource>
</Service>
<Capability>
<Request>
<GetCapabilities>
<DCPType>
<HTTP>
<Post onlineResource="http://121.0.0.1:8080/deegreewfs/wfs"/>
<Get onlineResource="http://121.0.0.1:8080/deegreewfs/wfs"/>
</HTTP>
</DCPType>
</GetCapabilities>
<DescribeFeatureType>
<SchemaDescriptionLanguage>
<XMLSCHEMA/>
</SchemaDescriptionLanguage>
<DCPType>
<HTTP>
<Post onlineResource="http://121.0.0.1:8080/deegreewfs/wfs"/>
<!-- the use of the Get-request address for DescribeFeatureType
request isn't declared as mandatory within the WFS
specifications but if not declared a WFS won't work as he
should (see WFS specification 1.0.0 OGC Document 01-65
chapter 9.3 page 36 -->
<Get onlineResource="http://121.0.0.1:8080/deegreewfs/wfs"/>
</HTTP>
</DCPType>
</DescribeFeatureType>
<GetFeature>
<ResultFormat>
<XML className="org.deegree_impl.services.wfs.XMLResponseHandler"/>
<GML2 className="org.deegree_impl.services.wfs.GMLResponseHandler"/>
<FEATURECOLLECTION
className="org.deegree_impl.services.wfs.FCResponseHandler"/>
</ResultFormat>
<DCPType>
<HTTP>
<Post onlineResource="http://121.0.0.1:8080/deegreewfs/wfs"/>
</HTTP>
</DCPType>
</GetFeature>
</Request>
</Capability>
<FeatureTypeList>
<Operations>
<Query/>
</Operations>
<FeatureType>
<ResponsibleClass
className="org.deegree_impl.services.wfs.shape.ShapeDataStore"
configURL="file:///$deegreewfs_home/xml/shape_config.xml"/>
<Name>Rivers</Name>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-180" miny="-90" maxx="180" maxy="90"/>
</FeatureType>
<FeatureType>
<ResponsibleClass
className="org.deegree_impl.services.wfs.db.PointDBDataStore"
configURL="file:///$deegreewfs_home/xml/pointdb_config.xml"/>
<Name>Cities</Name>
<Title>capital cities of europe</Title>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-180" miny="-90" maxx="180" maxy="90"/>
</FeatureType>
<FeatureType>
<ResponsibleClass
className="org.deegree_impl.services.wfs.gml.GMLDBDataStore"
configURL="file:///$deegreewfs_home/xml/gmldb_config.xml"/>
<Name>Europe</Name>
<Title>european bordes</Title>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-180" miny="-90" maxx="180" maxy="90"/>
</FeatureType>
</FeatureTypeList>
</WFS_Capabilities>
Each FeatureType specified in the Capabilites document is served by another data source and accordingly refers to its own configuration document.
As described more exactly below, the configuration document for the description of the access to the Shapefile (feature type = rivers) defines mainly the file names of the Shapefiles, the used spatial coordinate system and the names (<PropertyName>) the fields of the be accessed through.
<?xml version="1.0" encoding="UTF-8"?>
<DatastoreConfiguration name="rivers" type="SHAPEFILES">
<FeatureType name="Rivers">
<OutputFormat>
<GML2
responsibleClass="org.deegree_impl.services.wfs.shape.SHPDataStoreOutputGML">
<SchemaLocation>file:///$deegreewfs_home/xml/rivers.xsd</SchemaLocation>
</GML2>
<XML
responsibleClass="org.deegree_impl.services.wfs.shape.SHPDataStoreOutputXML">
<SchemaLocation>file:///$deegreewfs_home/xml/ rivers.xsd</SchemaLocation>
</XML>
<FEATURECOLLECTION
responsibleClass="org.deegree_impl.services.wfs.shape.SHPDataStoreOutputFC">
<SchemaLocation>file:///$deegreewfs_home/xml/rivers.xsd</SchemaLocation>
</FEATURECOLLECTION>
</OutputFormat>
<MappingField>
<Property name="/Rivers/ID" type="DOUBLE"></Property>
<DatastoreField name="ID" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Rivers/Name" type="VARCHAR"></Property>
<DatastoreField name="Name" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Rivers/Geometry" type="GEOMETRY"></Property>
<DatastoreField name="GEOM" type="GEOMETRY"></DatastoreField>
</MappingField>
<MasterTable name="file:///c:/java/source/deegree_release/data/mjrivers">
<!-- name of the table column that stores the id of a feature -->
<IdField number="false" auto="false">ID</IdField>
<GeoFieldIdentifier>GEOM</GeoFieldIdentifier>
</MasterTable>
<CRS>EPSG:4326</CRS>
</FeatureType>
</DatastoreConfiguration>
For example the third <MappingField> means that the geometries of the shape will be administered internally with the name 'GEOM', but it is accessible through the name (Xpath expression) '/Rivers/Geometry'. Something similar applies to the two other MappingFields. This means through the MappingField elements will be defined through which name a field of the datastore - in this case a shapefile - can be accessed.
For each MappingField it is indicated, which data type it concerns with a property and the associated database field. For this the type names defined in the class java.sql.Types are used. Additionally the type GEOMETRY for the marking of geometry is known. In future versions of deegree it should be possible to perform a Mapping between different data types.
In contrast, the data base connection description must be specified for the access to the cities.
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<DatastoreConfiguration name="cities point" type="POINTDB">
<Connection name="cities">
<driver>sun.jdbc.odbc.JdbcOdbcDriver</driver>
<logon>jdbc:odbc:cities</logon>
<user/>
<password/>
</Connection>
<FeatureType name="Cities">
<OutputFormat>
<GML2
responsibleClass="org.deegree_impl.services.wfs.db.PointDBDataStoreOutputGML">
<SchemaLocation>file:///$deegreewfs_home/xml/cities.xsd</SchemaLocation>
</GML2>
<XML
responsibleClass="org.deegree_impl.services.wfs.db.PointDBDataStoreOutputXML">
<SchemaLocation>file:///$deegreewfs_home/xml/cities.xsd</SchemaLocation>
</XML>
<FEATURECOLLECTION
responsibleClass="org.deegree_impl.services.wfs.db.PointDBDataStoreOutputFC">
<SchemaLocation>file:///$deegreewfs_home/xml/cities.xsd</SchemaLocation>
</FEATURECOLLECTION>
</OutputFormat>
<MappingField>
<Property name="/Cities/ID" type="INTEGER"></Property>
<DatastoreField name="tab_cities.Cities_ID" type="INTEGER"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Cities/Name" type="VARCHAR"></Property>
<DatastoreField name="tab_cities.City_Name" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Cities/AdminAreaShort" type="VARCHAR"></Property>
<DatastoreField name="tab_cities.GMI_Admin" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Cities/AdminArea" type="VARCHAR"></Property>
<DatastoreField name="tab_cities.Admin_Name" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Cities/CountryShort" type="VARCHAR"></Property>
<DatastoreField name="tab_cities.FIPS_Cntry" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Cities/Country" type="VARCHAR"></Property>
<DatastoreField name="tab_cities.Cntry_Name" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Cities/Status" type="VARCHAR"></Property>
<DatastoreField name="tab_cities.Status" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Cities/PopulationRanking" type="VARCHAR"></Property>
<DatastoreField name="tab_cities.Pop_Rank" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Cities/PopulationClass" type="VARCHAR"></Property>
<DatastoreField name="tab_cities.Pop_Class" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Cities/location" type="GEOMERTY"></Property>
<DatastoreField name="tab_cities.coordinate" type="DOUBLE"></DatastoreField>
</MappingField>
<MasterTable name="tab_cities" targetName="Cities">
<!-- name of the table column that stores the id of a feature -->
<IdField number="true" auto="false">CITIES_ID</IdField>
<GeoFieldIdentifier dimension="2">coordinate</GeoFieldIdentifier>
</MasterTable>
<CRS>EPSG:4326</CRS>
</FeatureType>
</DatastoreConfiguration>
Special attention earns the last MappingField; it makes the connection between the property under its name the point geometry to be addressed and the associated n data base fields. Since each coordinate of one point is put in its own column, the following name convention applies: All coordinates belonging to one point must be put in data base fields, that have the same, freely selectable Prefix and be ended on _ x, _ y and _ z. Only the use of the x-coordinate is mandatory. In the MappingField as name of the data base field the name of the table separated by a point from the Prefix is used. The number of Geometry fields for a table is not limited.
Each geometry has to be published to the table it belongs to by adding a <GeoFieldIdentifier> element to the table description section.
The third available feature type - Europe - has to be configured in a more complex manner. On the one hand, a complex data base schema tied up with one related table is to be defined. On the other hand, the result of the GetFeature request is to be transferred into another data model defined by a filter. This is indicated by "outputFormat=XML".
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<DatastoreConfiguration name="europe" type="GMLDB">
<Connection name="latlon">
<driver>sun.jdbc.odbc.JdbcOdbcDriver</driver>
<logon>jdbc:odbc:europe</logon>
<user/>
<password/>
</Connection>
<FeatureType name="Europe">
<!-- The OutputFormat element contains information about wich java class is
responsible for generating a named output format. The name of the output
format is given by the name of the element; the responsible class is named
by the responsibleClass attribute. -->
<OutputFormat>
<GML2
responsibleClass="org.deegree_impl.services.wfs.gml.GMLDBDataStoreOutputGML">
<SchemaLocation>file:///$deegreewfs_home/xml/europe.xsd</SchemaLocation>
</GML2>
<XML
responsibleClass="org.deegree_impl.services.wfs.gml.GMLDBDataStoreOutputXML">
<Param name="FILTER" value="file:///$deegreewfs_home/xml/transform.xsl"/>
<SchemaLocation>file:///$deegreewfs_home/xml/europe.xsd</SchemaLocation>
</XML>
<FEATURECOLLECTION
responsibleClass="org.deegree_impl.services.wfs.gml.GMLDBDataStoreOutputFC">
</FEATURECOLLECTION>
</OutputFormat>
<MappingField>
<Property name="/Europe/EURNUTS0_I" type="VARCHAR"></Property>
<DatastoreField name="europe_tab.EURNUTS0_I" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/ID" type="INTEGER"></Property>
<DatastoreField name="europe_tab.ID" type="INTEGER"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/CountryName" type="VARCHAR"></Property>
<DatastoreField name="europe_tab.Name" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/CountryArea" type="VARCHAR"></Property>
<DatastoreField name="europe_tab.Area" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/PopulationDensity" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.PopDenKM" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Population" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.PopTotal" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Birth_Abs_1994" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.Birth_94" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/BirthRate_1994" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.BirthRt_94" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Death_Abs_1994" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.Death_94" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/DeathRate_1994" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.DeathRt_94" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Border" type="GEOMETRY"></Property>
<DatastoreField name="europe_tab.GEOM" type="GEOMETRY"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/WEST" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.GEOM_MINX" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/SOUTH" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.GEOM_MINY" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/EAST" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.GEOM_MAXX" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/NORTH" type="DOUBLE"></Property>
<DatastoreField name="europe_tab.GEOM_MAXY" type="DOUBLE"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Administrator" type="VARCHAR"></Property>
<DatastoreField name="europe_tab.Administrator" type="OTHER"/>
</MappingField>
<MappingField>
<Property name="/Europe/Administrator/ID" type="VARCHAR"></Property>
<DatastoreField name="admin_tab.ID" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Administrator/Name" type="VARCHAR"></Property>
<DatastoreField name="admin_tab.Name" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Administrator/Street" type="VARCHAR"></Property>
<DatastoreField name="admin_tab.Street" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Administrator/City" type="VARCHAR"></Property>
<DatastoreField name="admin_tab.City" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Administrator/Phone" type="VARCHAR"></Property>
<DatastoreField name="admin_tab.Phone" type="VARCHAR"></DatastoreField>
</MappingField>
<MappingField>
<Property name="/Europe/Administrator/Email" type="VARCHAR"></Property>
<DatastoreField name="admin_tab.Email" type="VARCHAR"></DatastoreField>
</MappingField>
<!-- name of the top level table if a relational schema is used. otherwise this
is the only table. -->
<MasterTable name="europe_tab" targetName="Europe">
<!-- name of the table column that stores the id of a feature -->
<IdField number="true" auto="true">ID</IdField>
<Reference tableField="administrator" replaceable="true"
targetTable="Admin_Tab" targetField="ID"/>
<GeoFieldIdentifier>GEOM</GeoFieldIdentifier>
</MasterTable>
<RelatedTable name="Admin_Tab" targetName="Administrator" jointable="false">
<!-- name of the table column that stores the id of a feature -->
<IdField number="true" auto="true">ID</IdField>
</RelatedTable>
</FeatureType>
</DatastoreConfiguration>
The element <FeatureType> indicates that the main table "Europe_Tab" possesses a field "administrator", which serves as a foreign key for the table "Admin_Tab" and there refers to the field "ID". As "replaceable=true" is set, the field "administrator" is replaced with the contents of the relation (referenced row(s) of the table "Admin_Tab") in the GML document given as a reply.
A view of the MappingFields shows that also the fields of the table Admin_tab are specified there. In order to mark this with the formulation of a requests, the property names contain the path element '/administrator/'. This is however not obligatory. In principle the Property names can be chosen freely. They must be clear within a type of feature.
Also the field "GEOM" in the main table is marked for interpretation as a geometry field, i.e. the international borders of Europe are to be put as GML geometries in the "GEOM row".
A filter is defined for the XML output transforming the result of a GetFeatureRequest with "outputFormat=XML" to the data model defined in the referenced XSLT stylesheet. The XSLT stylesheet is listed below:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:gml="http://www.opengis.net/gml" version="1.0">
<xsl:template match="ResultCollection">
<Result xmlns:gml="http://www.opengis.net/gml">
<xsl:apply-templates select="./gml:featureMember"/>
</Result>
</xsl:template>
<xsl:template match="gml:featureMember/Europe">
<EuropeanCountry>
<ID>
<xsl:value-of select="ID"/>
</ID>
<Name>
<xsl:value-of select="NAME"/>
</Name>
<Area>
<xsl:value-of select="AREA"/>
</Area>
</EuropeanCountry>
</xsl:template>
</xsl:stylesheet>
The XSLT script applies a simple transformation to the incoming GML documents. Id, name and the area of each country (gml:featureMember/Europe in the source document) are selected; any other elements are ignored. The selected elements are rearranged in the corresponding <EuropeanCountry> element.
See below for different example requests showing the central capabilities of the deegree WFS.
a)
<?xml version="1.0" encoding="iso-8859-1"?>
<GetFeature outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml">
<!--
get all European country borders and all of their properties within the defined bounding box
-->
<Query typeName="Europe">
<Filter>
<BBOX>
<PropertyName>GEOM</PropertyName>
<gml:Box>
<gml:coord>
<gml:X>1</gml:X>
<gml:Y>40</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>12</gml:X>
<gml:Y>56</gml:Y>
</gml:coord>
</gml:Box>
</BBOX>
</Filter>
</Query>
</GetFeature>
The GetFeature request selects all features of the FeatureType Europe located inside the given bounding box.
b)
<?xml version="1.0" encoding="iso-8859-1"?>
<GetFeature outputFormat="XML" xmlns:gml="http://www.opengis.net/gml">
<!--
get all European country borders and all of their properties within the defined bounding box
-->
<Query typeName="Europe">
<Filter>
<BBOX>
<PropertyName>GEOM</PropertyName>
<gml:Box>
<gml:coord>
<gml:X>1</gml:X>
<gml:Y>40</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>12</gml:X>
<gml:Y>56</gml:Y>
</gml:coord>
</gml:Box>
</BBOX>
</Filter>
</Query>
</GetFeature>
Request 1b is identical to the request 1a regarding the conditions of the filters. However, XML instead of GML2 is defined as the output format. As the XSLT stylesheet above was set in the configuration for the FeatureType Europe, the results of the requests differ significantly.
<?xml version="1.0" encoding="iso-8859-1"?>
<GetFeature outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml">
<!--
get all European country borders, the countries name and their area within
the defined bounding box
-->
<Query typeName="Europe">
<PropertyName>NAME</PropertyName>
<PropertyName>AREA</PropertyName>
<PropertyName>GEOM</PropertyName>
<Filter>
<BBOX>
<PropertyName>GEOM</PropertyName>
<gml:Box>
<gml:coord>
<gml:X>1</gml:X>
<gml:Y>40</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>12</gml:X>
<gml:Y>56</gml:Y>
</gml:coord>
</gml:Box>
</BBOX>
</Filter>
</Query>
</GetFeature>
Request 2 targets the same FeatureType as request 1, but by giving three <PropertyName> elements not all properties of the FeatureTypes are requested for selection.
<?xml version="1.0" encoding="iso-8859-1"?>
<GetFeature outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml">
<!--
get all European country borders, the countries name and their area within
the defined bounding box and with an area < 50000 km²
-->
<Query typeName="Europe">
<PropertyName>/Europe/Name</PropertyName>
<PropertyName>/Europe/Area</PropertyName>
<PropertyName>/Europe/Border</PropertyName>
<Filter>
<And>
<BBOX>
<PropertyName>/Europe/Border</PropertyName>
<gml:Box>
<gml:coord>
<gml:X>1</gml:X>
<gml:Y>40</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>12</gml:X>
<gml:Y>56</gml:Y>
</gml:coord>
</gml:Box>
</BBOX>
<PropertyIsLessThan>
<PropertyName>/Europe/Area</PropertyName>
<Literal>50000</Literal>
</PropertyIsLessThan>
</And>
</Filter>
</Query>
</GetFeature>
Request 3 resembles request 2 in its basic form but the filter conditions are expanded to the size (AREA) of a state.
<?xml version="1.0" encoding="iso-8859-1"?>
<GetFeature outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml">
<Query typeName="Europe">
<PropertyName>/Europe/CountryName</PropertyName>
<PropertyName>/Europe/Administrator</PropertyName>
<PropertyName>/Europe/Administrator/Name</PropertyName>
<PropertyName>/Europe/Administrator/City</PropertyName>
<Filter>
<And>
<Or>
<PropertyIsLike wildCard="*" singleChar="?" escape="\">
<PropertyName>/Europe/Administrator/City</PropertyName>
<Literal>London</Literal>
</PropertyIsLike>
<PropertyIsLike wildCard="*" singleChar="?" escape="\">
<PropertyName>/Europe/Administrator/City</PropertyName>
<Literal>53115 Bonn</Literal>
</PropertyIsLike>
</Or>
<BBOX>
<PropertyName>/Europe/Border</PropertyName>
<gml:box>
<gml:coord>
<gml:X>1</gml:X>
<gml:Y>40</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>12</gml:X>
<gml:Y>56</gml:Y>
</gml:coord>
</gml:box>
</BBOX>
</And>
</Filter>
</Query>
</GetFeature>
As mentioned above, the FeatureType "Europe" consists of a relational link of two tables in the database. Request 4 shows how fields in a related table are explicitly queried with a GetFeature request.
<?xml version="1.0" encoding="iso-8859-1"?>
<GetFeature outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml">
<!--
get all cities and all their properties within the defined bounding box
and their names like "on"
-->
<Query typeName="Cities">
<Filter>
<And>
<BBOX>
<PropertyName>/Cities/location</PropertyName>
<gml:Box>
<gml:coord>
<gml:X>-8</gml:X>
<gml:Y>40</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>12</gml:X>
<gml:Y>56</gml:Y>
</gml:coord>
</gml:Box>
</BBOX>
<PropertyIsLike wildCard="*" singleChar="#" escape="!">
<PropertyName>/Cities/Name</PropertyName>
<Literal>*on*</Literal>
</PropertyIsLike>
</And>
</Filter>
</Query>
</GetFeature>
Request 5 targets the FeatureType "Cities" and uses a combined filter of both spatial borders and non-spatial conditions.
<?xml version="1.0" encoding="iso-8859-1"?>
<GetFeature outputFormat="GML2" xmlns:gml="http://www.opengis.net/gml">
<!--
get all cities and all their properties within the defined bounding box
and their names like "on"
-->
<Query typeName="Cities">
<Filter>
<Or>
<And>
<BBOX>
<PropertyName>/Cities/location</PropertyName>
<gml:Box>
<gml:coord>
<gml:X>-8</gml:X>
<gml:Y>40</gml:Y>
</gml:coord>
<gml:coord>
<gml:X>5</gml:X>
<gml:Y>56</gml:Y>
</gml:coord>
</gml:Box>
</BBOX>
<PropertyIsLike wildCard="*" singleChar="#" escape="!">
<PropertyName>/Cities/Country</PropertyName>
<Literal>*on*</Literal>
</PropertyIsLike>
</And>
<PropertyIsEqualTo>
<PropertyName>/Cities/Country</PropertyName>
<Literal>Germany</Literal>
</PropertyIsEqualTo>
</Or>
</Filter>
</Query>
</GetFeature>
Similar to request 5, but more complex conditions for the filter.
<?xml version="1.0" encoding="iso-8859-1"?> <!-- get the XML schema just for the Cities feature type --> <DescribeFeatureType outputFormat="XMLSCHEMA"> <TypeName>Cities</TypeName> </DescribeFeatureType>
Request 7 inquires the XML schema of the FeatureType "Cities".
<?xml version="1.0" encoding="iso-8859-1"?> <!-- get a combined XML schema for the Cities-, Rivers- and Europe feature type --> <DescribeFeatureType outputFormat="XMLSCHEMA"> <TypeName>Cities</TypeName> <TypeName>Rivers</TypeName> <TypeName>Europe</TypeName> </DescribeFeatureType>
Request 8 determines a combined schema definition, valid for all three FeatureTypes at the same time, even if mixed in the GML document.
<?xml version="1.0" encoding="UTF-8"?>
<Transaction xmlns:gml="http://www.opengis.net/gml">
<!-- This request inserts a new city with the ID 2224.0 into the
database. -->
<Insert>
<Cities fid="ID2">
<Cities.ID>2224.0</Cities.ID>
<Cities.Status>Provincial capital</Cities.Status>
<Cities.PopulationClass>100,000 to 250,000</Cities.PopulationClass>
<Cities.AdminArea>NRW</Cities.AdminArea>
<Cities.Name>Euskirchen</Cities.Name>
<Cities.location>
<gml:Point srsName="EPSG:4326">
<gml:coordinates cs="," decimal="." ts=" ">6.79,50.66</gml:coordinates>
</gml:Point>
</Cities.location>
</Cities>
</Insert>
</Transaction>
This requests shows an example of an INSERT-Statement. A new City named "Euskirchen" is inserted into the Cities-database with the ID 2224.
<?xml version="1.0" encoding="UTF-8"?>
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc">
<!-- This request updates the City-Feature with the ID 2224 to add
change the old name (Euskirchen) to the new name (updated city
named Euskirchen) -->
<wfs:Update typeName="Cities">
<wfs:Property>
<wfs:Name>Cities/Name</wfs:Name>
<wfs:Value>updated city named Euskirchen</wfs:Value>
</wfs:Property>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>Cities/ID</ogc:PropertyName>
<ogc:Literal>2224</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Update>
</wfs:Transaction>
This requests shows, how an update of the above Feature can be done. The update is specified by the Feature ID (2224).
<?xml version="1.0" encoding="UTF-8"?>
<wfs:Transaction xmlns:gml="http://www.opengis.net/gml"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc">
<!-- This requests deletes a City with the ID 2224. It's available
if you have used the wfs_request_insert.xml request
(Euskirchen) -->
<wfs:Delete typeName="Cities">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>Cities/ID</ogc:PropertyName>
<ogc:Literal>2224</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Delete>
</wfs:Transaction>
This request is an example for the transaction DELETE. It deletes the inserted city-feature with the ID 2224.