On Fri, Oct 29, 2010 at 11:18 PM, AugustTown <[email protected]> wrote:
> None of the above four options generate correct WPS execute response, all
> returned exception. But what's interesting is that by looking at a sample
> WPS execute request built with WPS Query Builder, if in option 3 (reference
> WFS GetFeature HTTP POST), change the value of xlink:href to
> "http://geoserver/wfs", it just worked.
>
> My only guess is this is a hard code value to indicate the WFS is from the
> same parent GeoServer instance as WPS, so it figures out where to load the
> GML.
That specific URL makes GeoServer skip the GML encoding and parsing entirely,
and go directly get the data from the data source (the shapefile, the database,
whatever it is). So I guess the issue is parsing related.
However the module has tests that do use a literal collection and a remote
WFS request too, so not sure why it's not working in your case.
In fact I took one of your examples, the case of a literal collection, run it,
and it worked at the first attempt (request and response contained in
inline.txt,
attached).
However I also tried out making a remote WFS 1.1 request as follows:
<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.opengis.net/wps/1.0.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:wps="http://www.opengis.net/wps/1.0.0"
xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:wcs="http://www.opengis.net/wcs/1.1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
<ows:Identifier>gt:BufferFeatureCollection</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>features</ows:Identifier>
<wps:Reference mimeType="application/wfs-collection-1.1"
xlink:href="http://demo.opengeo.org/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&BBOX=-75.102613,40.212597,-72.361859,41.512517,EPSG:4326"
method="GET">
<wps:Body>
<wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
<wfs:Query typeName="topp:giant_polygon"/>
</wfs:GetFeature>
</wps:Body>
</wps:Reference>
</wps:Input>
<wps:Input>
<ows:Identifier>buffer</ows:Identifier>
<wps:Data>
<wps:LiteralData>1</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:RawDataOutput mimeType="text/xml; subtype=wfs-collection/1.0">
<ows:Identifier>result</ows:Identifier>
</wps:RawDataOutput>
</wps:ResponseForm>
</wps:Execute>
and this failed with a NullPointerException.
Investigating why I found out that the parse results in the following
feature type:
SimpleFeatureTypeImpl http://www.openplans.org/topp:states identified
extends
Feature(metaDataProperty:metaDataProperty,description:description,name:name,boundedBy:boundedBy,location:location,the_geom:the_geom,STATE_NAME:STATE_NAME,STATE_FIPS:STATE_FIPS,SUB_REGION:SUB_REGION,STATE_ABBR:STATE_ABBR,LAND_KM:LAND_KM,WATER_KM:WATER_KM,PERSONS:PERSONS,FAMILIES:FAMILIES,HOUSHOLD:HOUSHOLD,MALE:MALE,FEMALE:FEMALE,WORKERS:WORKERS,DRVALONE:DRVALONE,CARPOOL:CARPOOL,PUBTRANS:PUBTRANS,EMPLOYED:EMPLOYED,UNEMPLOY:UNEMPLOY,SERVICE:SERVICE,MANUAL:MANUAL,P_MALE:P_MALE,P_FEMALE:P_FEMALE,SAMP_POP:SAMP_POP)
The thing contains first the standard gml feature properties, one
being "location", which
is a geometry. The code grabs the default geometry in order to perform
the buffering,
and that breaks because the default geometry is the first one... location.
Justin, do you know if there is any way to get around this issue? The
default gml
properties are rarely used. At the very least I guess we should state
that the default
geometry is the first geometric attribute besides location.
Cheers
Andrea
-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584962313
fax: +39 0584962313
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
-----------------------------------------------------
REQUEST
---------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.opengis.net/wps/1.0.0"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:wps="http://www.opengis.net/wps/1.0.0"
xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:wcs="http://www.opengis.net/wcs/1.1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd">
<ows:Identifier>gt:BufferFeatureCollection</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>features</ows:Identifier>
<wps:Data>
<wps:ComplexData mimeType="application/wfs-collection-1.1">
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:it.geosolutions="http://www.geo-solutions.it"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:ows="http://www.opengis.net/ows"
xmlns:topp="http://www.openplans.org/topp"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
numberOfFeatures="1" timeStamp="2010-10-28T23:56:29.995-07:00"
xsi:schemaLocation="http://www.opengis.net/wfs
http://localhost:8080/geoserver-2.1-snapshot-10282010/schemas/wfs/1.1.0/wfs.xsd
http://www.geo-solutions.it
http://localhost:8080/geoserver-2.1-snapshot-10282010/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=it.geosolutions%3Ahighways">
<gml:featureMembers>
<it.geosolutions:highways gml:id="highways.1">
<it.geosolutions:the_geom>
<gml:MultiLineString srsDimension="2"
srsName="urn:x-ogc:def:crs:EPSG:4326">
<gml:lineStringMember>
<gml:LineString>
<gml:posList>37.769034 -122.397233 37.769474
-122.397642
37.769796 -122.397846 37.770061 -122.397977 37.770872
-122.398163 37.771951 -122.398085 37.772221
-122.398093
37.772474 -122.398224 37.772768 -122.398567 37.773345
-122.399321 37.773497 -122.399591 37.774593
-122.401125</gml:posList>
</gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</it.geosolutions:the_geom>
<it.geosolutions:LENGTH>0.469</it.geosolutions:LENGTH>
<it.geosolutions:HWYNAME>I 280</it.geosolutions:HWYNAME>
<it.geosolutions:FCC>A11</it.geosolutions:FCC>
<it.geosolutions:STATEFIPS>06</it.geosolutions:STATEFIPS>
<it.geosolutions:ALT1_NAME />
<it.geosolutions:ROAD_TYPE>Major
Roads/Highways</it.geosolutions:ROAD_TYPE>
</it.geosolutions:highways>
</gml:featureMembers>
</wfs:FeatureCollection>
</wps:ComplexData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>buffer</ows:Identifier>
<wps:Data>
<wps:LiteralData>20</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:RawDataOutput mimeType="text/xml; subtype=wfs-collection/1.0">
<ows:Identifier>result</ows:Identifier>
</wps:RawDataOutput>
</wps:ResponseForm>
</wps:Execute>
RESPONSE
------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:feature="http://www.geo-solutions.it"
xmlns:wfs="http://www.opengis.net/wfs"><gml:boundedBy><gml:Box
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"><gml:coord><gml:X>-142.4004184236931</gml:X><gml:Y>17.782353073285826</gml:Y></gml:coord><gml:coord><gml:X>-102.41055207328583</gml:X><gml:Y>57.773886423693114</gml:Y></gml:coord></gml:Box></gml:boundedBy><gml:featureMember><feature:highways
fid="fid-19e9e5fd_12c262febfc_-7ffe"><gml:boundedBy><gml:Box
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"><gml:coord><gml:X>-142.4004184236931</gml:X><gml:Y>17.782353073285826</gml:Y></gml:coord><gml:coord><gml:X>-102.41055207328583</gml:X><gml:Y>57.773886423693114</gml:Y></gml:coord></gml:Box></gml:boundedBy><feature:the_geom><gml:MultiPolygon
srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-137.0463952422639,24.15279200888108
-138.93304722516368,26.518679626284413 -138.93653022516366,26.523798626284414
-140.8137281476486,29.96587701546062 -141.9833400570762,33.7080399807443
-142.4004184236931,37.606478298008774 -142.04893515977045,41.51137716899095
-140.94239757002669,45.27267351997151 -139.12332927348223,48.745822841541575
-136.66163604462807,51.79735395303777 -133.65191937371557,54.30999822516367
-130.20984098453937,56.187196147648606 -126.4676780192557,57.356808057076215
-122.56923970199124,57.773886423693114 -118.66434083100904,57.42240315977045
-114.90304448002848,56.31586557002668 -111.42989515845842,54.496797273482244
-110.75070005274134,53.948885444395614 -111.0208113595192,54.2211265635266
-110.24484636268551,53.65631532330158 -110.2440923626855,53.65573832330158
-109.38273953098425,52.95790004739475 -109.38239653098425,52.957606047394755
-108.89879002621052,52.45493561849238 -108.37836404696222,52.03510404462807
-107.79827139229953,51.340252587626956 -107.7488887577361,51.386155991118926
-107.74847975773609,51.38571599111892 -107.2870922908857,50.77970423951046
-106.72145195314035,50.19176617752767 -106.31651392916383,49.56536141480078
-105.86571977483634,49.02538737371559 -106.15766308950836,49.31963264488628
-106.0575044935096,49.16469579567278 -105.37346856928986,48.26624527765312
-105.0542811883785,47.61279446953506 -104.63782395421596,46.968570466094434
-104.63769295421596,46.96831746609443 -103.995569904026,45.44536622613597
-103.65267110087872,44.743372621691016 -103.57416656652316,44.445905553944385
-103.41496679086731,44.068324503607585 -102.66231116601189,41.0124239876575
-102.66186016601189,41.0096769876575 -102.6670850915178,41.00881916406698
-102.65221663417941,40.952480043751486 -102.41055207328583,37.03924941964769
-102.93696445174608,33.154064007698935 -104.2112240370714,29.44622930444931
-106.18436174801073,26.05823531816706 -108.78055100888108,23.120280757736086
-111.90002172234688,20.745269569289846 -115.42289437830898,19.02447210087872
-119.21378695624851,18.02401763417941 -123.1270175803523,17.782353073285826
-127.01220299230107,18.30876545174608 -130.7200376955507,19.583025037071398
-134.10803168183295,21.55616274801074 -137.04598624226392,24.152352008881074
-137.0463952422639,24.15279200888108</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></feature:the_geom><feature:LENGTH>0.469</feature:LENGTH><feature:HWYNAME>I
280</feature:HWYNAME><feature:FCC>A11</feature:FCC><feature:STATEFIPS>06</feature:STATEFIPS><feature:ALT1_NAME>{}</feature:ALT1_NAME><feature:ROAD_TYPE>Major
Roads/Highways</feature:ROAD_TYPE></feature:highways></gml:featureMember></wfs:FeatureCollection>
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users