[Geoserver-devel] why is this wps request not working?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I try to send some vector data into geoserver WPS interface (2.2
snapshot, rev 16632)

I try to send the data as reference or directly, geoserver does not
like them and

Could anybody tell me, how both request types should look like or if
the input data are somehow corrupted? They are produced by OpenLayers
(direct input) and MapServer (Reference).

As Reference input:

<wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0&quot;
version="1.0.0" service="WPS"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;&lt;ows:Identifier
xmlns:ows="http://www.opengis.net/ows/1.1&quot;&gt;JTS:area&lt;/ows:Identifier&gt;&lt;wps:DataInputs&gt;&lt;wps:Input&gt;&lt;ows:Identifier
xmlns:ows="http://www.opengis.net/ows/1.1&quot;&gt;geom&lt;/ows:Identifier&gt;&lt;wps:Data/&gt;&lt;wps:Reference
mimeType="text/xml; subtype=gml/3.1.1"
xlink:href="http://briseide.ccss.cz/cgi-bin/owsproxy.cgi?map=/var/www/localhost/htdocs/tmp/WFS-8066ca5a58f48c499f919d45529596c0wpD64C/mapfile.map&amp;owsService=WFS&amp;owsUrl=http://bnhelp.cz/ows/crwfs&amp;VERSION=1.1.0&amp;SERVICE=WFS&amp;REQUEST=GetFeature&amp;SRSNAME=urn:ogc:def:crs:EPSG::3035&amp;TYPENAME=kraje&amp;BBOX=-49543.523624,1128107.277079,8769896.158324,5846507.506921&quot;
xmlns:xlink="http://www.w3.org/1999/xlink&quot;/&gt;&lt;/wps:Input&gt;&lt;/wps:DataInputs&gt;&lt;wps:ResponseForm&gt;&lt;wps:ResponseDocument&gt;&lt;wps:Output&gt;&lt;ows:Identifier
xmlns:ows="http://www.opengis.net/ows/1.1&quot;&gt;result&lt;/ows:Identifier&gt;&lt;ows:Title
xmlns:ows="http://www.opengis.net/ows/1.1&quot;/&gt;&lt;ows:Abstract
xmlns:ows="http://www.opengis.net/ows/1.1&quot;/&gt;&lt;/wps:Output&gt;&lt;/wps:ResponseDocument&gt;&lt;/wps:ResponseForm&gt;&lt;/wps:Execute&gt;

Result: Could not convert
org.geotools.feature.DefaultFeatureCollection@anonymised.com to target type
com.vividsolutions.jts.geom.Geometry

Direct input

<wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0&quot;
version="1.0.0" service="WPS"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;&lt;ows:Identifier
xmlns:ows="http://www.opengis.net/ows/1.1&quot;&gt;JTS:area&lt;/ows:Identifier&gt;&lt;wps:DataInputs&gt;&lt;wps:Input&gt;&lt;ows:Identifier
xmlns:ows="http://www.opengis.net/ows/1.1&quot;&gt;geom&lt;/ows:Identifier&gt;&lt;wps:Data&gt;&lt;wps:ComplexData
mimeType="text/xml; subtype=gml/3.1.1"><gml:featureMembers
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/gml
http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd&quot;&gt;&lt;feature:null
xmlns:feature="http://www.opengis.net/gml&quot;&gt;&lt;feature:geometry&gt;&lt;gml:Polygon&gt;&lt;gml:exterior&gt;&lt;gml:LinearRing&gt;&lt;gml:posList&gt;3358492\.0671158
4520866.085022 2714672.9703337 4009338.583469 2511825.8576489
4776629.8357984 2864603.4449268 5217601.8198958 3190922.7131588
5323435.0960791 3358492.0671158
4520866.085022</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></feature:geometry></feature:null></gml:featureMembers></wps:ComplexData></wps:Data></wps:Input></wps:DataInputs><wps:ResponseForm><wps:ResponseDocument><wps:Output><ows:Identifier
xmlns:ows="http://www.opengis.net/ows/1.1&quot;&gt;result&lt;/ows:Identifier&gt;&lt;ows:Title
xmlns:ows="http://www.opengis.net/ows/1.1&quot;/&gt;&lt;ows:Abstract
xmlns:ows="http://www.opengis.net/ows/1.1&quot;/&gt;&lt;/wps:Output&gt;&lt;/wps:ResponseDocument&gt;&lt;/wps:ResponseForm&gt;&lt;/wps:Execute&gt;

Result: Could not convert
org.geotools.feature.DefaultFeatureCollection@anonymised.com to target type
com.vividsolutions.jts.geom.Geometry

Thanks

Jachym

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

iEYEARECAAYFAk7uZyIACgkQyKt0uAjU4I/z7QCgoaLUpYXyb3FGjaPUcraqZpeo
3G8Anj3s3MZ2/g+WUB5R2lfKPA5f2W/v
=SfsT
-----END PGP SIGNATURE-----

On Sun, Dec 18, 2011 at 11:20 PM, Jachym Cepicky <jachym.cepicky@anonymised.com> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I try to send some vector data into geoserver WPS interface (2.2
snapshot, rev 16632)

I try to send the data as reference or directly, geoserver does not
like them and

Could anybody tell me, how both request types should look like or if
the input data are somehow corrupted? They are produced by OpenLayers
(direct input) and MapServer (Reference).

It seems the parser is coming back with a feature collection instead of a Geomertry
object, which makes me think the GML you’re referring to is not a gml geometry,
but a feature or a feature collection instead.

The URL embedded in the request does not work here so I cannot see what the GML looks like

Cheers
Andrea

Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

Please take note that GeoSolutions will be closed for Christmas holidays from 27/12 to 30/12


On Mon, Dec 19, 2011 at 9:28 AM, Andrea Aime <andrea.aime@anonymised.com.1268…> wrote:

Could anybody tell me, how both request types should look like or if
the input data are somehow corrupted? They are produced by OpenLayers
(direct input) and MapServer (Reference).

It seems the parser is coming back with a feature collection instead of a Geomertry
object, which makes me think the GML you’re referring to is not a gml geometry,
but a feature or a feature collection instead.

The URL embedded in the request does not work here so I cannot see what the GML looks like

Ah, did not notice the second request, which confirms what I was saying: you have to provide
a geometry, not a feature

Cheers
Andrea

Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

Please take note that GeoSolutions will be closed for Christmas holidays from 27/12 to 30/12


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

thanks for your answer. Do I understand that correct, that I can not
send let sey whole vector file (e.g. Shapfile converted to GML) to
Geoserver-WPS interface? Or is that the process issue? Can the process
be configured, so it accepts whole vector files (feature collections),
instead of *only* geometry?

I'm a bit confused - I'm not the admin of the server, I'm just writing
the client part and so, I do not have much informations about it.

Thanks

Jachym

On 19.12.2011 09:29, Andrea Aime wrote:

On Mon, Dec 19, 2011 at 9:28 AM, Andrea Aime
<andrea.aime@anonymised.com>wrote:

Could anybody tell me, how both request types should look like or
if

the input data are somehow corrupted? They are produced by
OpenLayers (direct input) and MapServer (Reference).

It seems the parser is coming back with a feature collection
instead of a Geomertry object, which makes me think the GML
you're referring to is not a gml geometry, but a feature or a
feature collection instead.

The URL embedded in the request does not work here so I cannot
see what the GML looks like

Ah, did not notice the second request, which confirms what I was
saying: you have to provide a geometry, not a feature

Cheers Andrea

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

iEYEARECAAYFAk7u/xIACgkQyKt0uAjU4I8YMACfcxd+BXDVSx38RENc3fAxPNUc
2U4AmQGL14iNIOznL2/gBuqOjnBlnC/3
=Grt6
-----END PGP SIGNATURE-----

On Mon, Dec 19, 2011 at 10:08 AM, Jachym Cepicky <jachym.cepicky@anonymised.com> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

thanks for your answer. Do I understand that correct, that I can not
send let sey whole vector file (e.g. Shapfile converted to GML) to
Geoserver-WPS interface? Or is that the process issue? Can the process
be configured, so it accepts whole vector files (feature collections),
instead of only geometry?

A process can either accept geometries or feature collection, but not both,
there is no configuration possible, they are two entirely different things
(it’s like having something needing a wheel, and you’re asking why it does
not work if you give it a full car instead).

The JTS processes are meant to work against single geometries, while other
processes work against feature collection. You can tell the difference since
a process taking a feature collection will say it accepts a wfs feature collection
instead of a plain gml file.

There is a process that you can chain to bridge the two worlds, gs:CollectGeometries
if memory serves me right, it will take a feature collection and build a multi-geometry
with all the geometries in the feature collection, once you have that the JTS:area process
will do the rest.

Here is a sample using such chaining (warning, to read the vector data it’s using a
GeoServer extension that allows to directly peek into the original shapefile without
going through GML, but if you pass it a GML feature collection it will work anyways):

<?xml version="1.0" encoding="UTF-8"?>
<wps:Execute version="1.0.0" service="WPS" xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)" xmlns="[http://www.opengis.net/wps/1.0.0](http://www.opengis.net/wps/1.0.0)" xmlns:wfs="[http://www.opengis.net/wfs](http://www.opengis.net/wfs)" xmlns:wps="[http://www.opengis.net/wps/1.0.0](http://www.opengis.net/wps/1.0.0)" xmlns:ows="[http://www.opengis.net/ows/1.1](http://www.opengis.net/ows/1.1)" xmlns:gml="[http://www.opengis.net/gml](http://www.opengis.net/gml)" xmlns:ogc="[http://www.opengis.net/ogc](http://www.opengis.net/ogc)" xmlns:wcs="[http://www.opengis.net/wcs/1.1.1](http://www.opengis.net/wcs/1.1.1)" xmlns:xlink="[http://www.w3.org/1999/xlink](http://www.w3.org/1999/xlink)" xsi:schemaLocation="[http://www.opengis.net/wps/1.0.0](http://www.opengis.net/wps/1.0.0) [http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd](http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd)">
  <ows:Identifier>JTS:area</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>geom</ows:Identifier>
      <wps:Reference mimeType="text/xml; subtype=gml/3.1.1" xlink:href="[http://geoserver/wps](http://geoserver/wps)" method="POST">
        <wps:Body>
          <wps:Execute version="1.0.0" service="WPS">
            <ows:Identifier>gs:CollectGeometries</ows:Identifier>
            <wps:DataInputs>
              <wps:Input>
                <ows:Identifier>features</ows:Identifier>
                <wps:Reference mimeType="text/xml; subtype=wfs-collection/1.0" xlink:href="[http://geoserver/wfs](http://geoserver/wfs)" method="POST">
                  <wps:Body>
                    <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
                      <wfs:Query typeName="GeoSolutions:states"/>
                    </wfs:GetFeature>
                  </wps:Body>
                </wps:Reference>
              </wps:Input>
            </wps:DataInputs>
            <wps:ResponseForm>
              <wps:RawDataOutput mimeType="text/xml; subtype=gml/3.1.1">
                <ows:Identifier>result</ows:Identifier>
              </wps:RawDataOutput>
            </wps:ResponseForm>
          </wps:Execute>
        </wps:Body>
      </wps:Reference>
    </wps:Input>
  </wps:DataInputs>
  <wps:ResponseForm>
    <wps:RawDataOutput>
      <ows:Identifier>result</ows:Identifier>
    </wps:RawDataOutput>
  </wps:ResponseForm> 

</wps:Execute>

Cheers
Andrea

Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

Please take note that GeoSolutions will be closed for Christmas holidays from 27/12 to 30/12