OK. I just realize I should use GetFeature instead of GetPropertyValue. I
thought response of GetFeature must contain geometry so I turned to
GetPropertyValue. Actually GetFeature can return multiple attributes
without geometry. The following post request meets my requirements.
<?xml version="1.0" encoding="UTF-8"?>
<wfs*:GetFeature* service="WFS" version="2.0.0"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xmlns:fes="http://www.opengis.net/fes/2.0"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:topp="http://www.openplans.org/topp"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/wfs/2.0/wfs.xsd
http://www.opengis.net/gml/3.2
http://schemas.opengis.net/gml/3.2.1/gml.xsd">
<wfs:Query typeNames="topp:states">
*<wfs:PropertyName>topp:STATE_NAME</wfs:PropertyName>*
* <wfs:PropertyName>topp:FAMILIES</wfs:PropertyName> *
<fes:Filter>
<fes:Intersects>
<fes:ValueReference>topp:the_geom</fes:ValueReference>
<gml:Polygon gml:id="polygon.1" srsName="EPSG:4326">
<gml:exterior>
<gml:LinearRing>
<!-- pairs must form a closed ring -->
<gml:posList>-90 40 -90 45 -80 45 -80 40 -90 40</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</fes:Intersects>
</fes:Filter>
</wfs:Query>
</wfs:GetFeature>
Thanks.
Drew
On Sat, Feb 25, 2017 at 12:04 PM, Zhiyu (Drew) Li <zyli2...@gmail.com>
wrote:
> Hi there,
>
> I am trying to do a WFS spatial query to get values of multiple attributes
> via a post request.
> For instance, the sample layer topp:states has attributes STATE_NAME and
> FAMILIES. I found I could only query either STATE_NAME or FAMILIES in one
> query, but not both. Is it possible to query multiple attributes through on
> request?
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wfs:GetPropertyValue xmlns:topp="http://www.openplans.org/topp"
> xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:wfs="http://www.opengis.
> net/wfs/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" service="WFS"
> version="2.0.0" *valueReference="STATE_NAME"*>
> <wfs:Query typeNames="topp:states">"
> <fes:Intersects>
> <fes:ValueReference>topp:the_geom</fes:ValueReference>
> <gml:Polygon gml:id="polygon.1" srsName="EPSG:4326">
> <gml:exterior>
> <gml:LinearRing>
> <!-- pairs must form a closed ring -->
> <gml:posList>-90 40 -90 45 -88 45 -88 40 -90 40</gml:posList>
> </gml:LinearRing>
> </gml:exterior>
> </gml:Polygon>
> </fes:Intersects>
> </wfs:Query>
> </wfs:GetPropertyValue>
>
> Thanks
> Drew
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users