GetFeature request for INSPIRE Addresses

42 views
Skip to first unread message

IvoSilvestre

unread,
Sep 12, 2011, 4:51:45 PM9/12/11
to inspire-f...@googlegroups.com
Hello,

I'm trying to send a getfeature request that returns a specific door number from a specific street. This is the request:

"<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" xmlns:gn="urn:x-inspire:specification:gmlas:GeographicalNames:3.0" xmlns:ad="urn:x-inspire:specification:gmlas:Addresses:3.0" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" outputFormat="text/xml; subtype=gml/3.2.1">
  <wfs:Query typeName="ad:Address">
    <ogc:Filter>
    <ogc:And>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>ad:component/ad:ThoroughfareName/ad:name/gn:GeographicalName/gn:spelling/gn:SpellingOfName/gn:text</ogc:PropertyName>
                <ogc:Literal>STREET NAME</ogc:Literal>
              </ogc:PropertyIsEqualTo>
              <ogc:PropertyIsEqualTo>
                <ogc:PropertyName>ad:locator/ad:AddressLocator/ad:designator/ad:LocatorDesignator</ogc:PropertyName>
                <ogc:Literal>DOOR NUMBER</ogc:Literal>
              </ogc:PropertyIsEqualTo>
    </ogc:And>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>"

This is the answer:

<gml:FeatureCollection xsi:schemaLocation="http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/deprecatedTypes.xsd urn:x-inspire:specification:gmlas:Addresses:3.0 http://localhost:8080/services?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&OUTPUTFORMAT=text%2Fxml%3B+subtype%3Dgml%2F3.2.1&TYPENAME=ad:Address&NAMESPACE=xmlns(ad=urn%3Ax-inspire%3Aspecification%3Agmlas%3AAddresses%3A3.0)" gml:id="WFS_RESPONSE">
</gml:FeatureCollection>

Am I doing any thing wrong?

Regards,
Ivo Silvestre.


Markus Schneider

unread,
Sep 12, 2011, 6:01:49 PM9/12/11
to inspire-f...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Ivo,

your request is almost correct, but the second XPath ends too early --
it must always end on a primitive valued element. Try this:

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gn="urn:x-inspire:specification:gmlas:GeographicalNames:3.0"
xmlns:ad="urn:x-inspire:specification:gmlas:Addresses:3.0" xmlns:gml="
http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" outputFormat="text/xml;
subtype=gml/3.2.1">
<wfs:Query typeName="ad:Address">
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsEqualTo>

<ogc:PropertyName>ad:component/ad:ThoroughfareName/ad:name/gn:GeographicalName/gn:spelling/gn:SpellingOfName/gn:text</ogc:PropertyName>

<ogc:Literal>Madame Curiestraat</ogc:Literal>
</ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo>

<ogc:PropertyName>ad:locator/ad:AddressLocator/ad:designator/ad:LocatorDesignator/ad:designator</ogc:PropertyName>
<ogc:Literal>14</ogc:Literal>


</ogc:PropertyIsEqualTo>
</ogc:And>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Best regards,
Markus

P.S.: WFS 2.0 brings some additional query possibilities (e.g.
GetPropertyValue). Support in deegree 3 is not 100% complete yet [1],
but already pretty usable. If your curious, just download a current
SNAPSHOT [2]/[3], log in to the service console, select workspace and
download and start the deegree inspire workspace. You will find some WFS
2.0 example requests in the Generic Client ("send requests").

[1]
http://simplefeatures.wordpress.com/2011/09/05/status-of-wfs-2-0-support-in-deegree-3/
[2]
http://artefacts.deegree.org/libs-snapshots-local/org/deegree/deegree-webservices/3.1-pre13-SNAPSHOT/deegree-webservices-3.1-pre13-SNAPSHOT.zip
[3]
http://artefacts.deegree.org/libs-snapshots-local/org/deegree/deegree-webservices/3.1-pre13-SNAPSHOT/deegree-webservices-3.1-pre13-SNAPSHOT.war

> http://schemas.opengis.net/gml/3.2.1/deprecatedTypes.xsdurn:x-inspire:specification:gmlas:Addresses:3.0

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5ugU0ACgkQLM5hjXxU/E4aowCfTX1nZYThtzRXyGGVR8D2Ji1W
1DsAnAyrxKBAr7O3vuB4kMQ+Dtl1d7RV
=SO6v
-----END PGP SIGNATURE-----

IvoSilvestre

unread,
Sep 13, 2011, 11:33:43 AM9/13/11
to inspire-f...@googlegroups.com
Hi Markus,

Now It works. Thank you.
Sorry for my ignorance but you called primitive valued element to "ad:designator"? And why the "ad:designator" is duplicated?
Is there any documentation that explain this?

Regards,
Ivo Silvestre.

Markus Schneider

unread,
Sep 13, 2011, 5:06:14 PM9/13/11
to inspire-f...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ivo,

IMHO, the following specifications/pieces of documentation are relevant
here:

- - Filter Encoding specification [1]: defines how filters are evaluated
- - INSPIRE Data Specifications [2]: define the actual data model, i.e.
which elements exist and which type they have

In the end (for deegree), the INSPIRE GML Annex I application schemas
[3] (as an encoding of the Data Specifications) define the two
"ad:designator" elements (pretty stupid, I agree) and that the second
one is primitive valued.

Best regards,
Markus

[1] http://www.opengeospatial.org/standards/filter
[2] http://inspire.jrc.ec.europa.eu/index.cfm/pageid/2
[3] http://inspire.jrc.ec.europa.eu/index.cfm/pageid/541/downloadid/1698

> http://localhost:8080/services?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&OUTPUTFORMAT=text%2Fxml%3B+subtype%3Dgml%2F3.2.1&TYPENAME=ad:Address&NAMESPACE=xmlns(ad=urn%3Ax-inspire%3Aspecification%3Agmlas%3AAddresses%3A3.0)<http://localhost:8080/services?SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&OUTPUTFORMAT=text%2Fxml%3B+subtype%3Dgml%2F3.2.1&TYPENAME=ad:Address&NAMESPACE=xmlns%28ad=urn%3Ax-inspire%3Aspecification%3Agmlas%3AAddresses%3A3.0%29>


> "
>>>> gml:id="WFS_RESPONSE">
>>>> </gml:FeatureCollection>
>>>>
>>>> Am I doing any thing wrong?
>>>>
>>>> Regards,
>>>> Ivo Silvestre.
>>>>
>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5vxcYACgkQLM5hjXxU/E6rLgCfTVKZiFaTLklrjP7Uouzj+O0E
yuUAn12M82LYmhIfFeLBQYamL2CX4WuC
=pQXf
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages