It sounds like the buffer polygon is a constant data value, which you have
in WKT?  If so, try using gs:Feature to convert the WKT to a Feature, and
then use that as one of the inputs to gs:IntersectionFeatureCollection (ie
by chaining).  FWIW example WPS XML is given below.

As for performance, this depends on a lot of factors (such as size of input
dataset and geometries), so it's hard to advise on what might help.  And
not quite sure how you are determining performance if you can't get the
process to run in the first place?

<?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>gs:IntersectionFeatureCollection</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>first feature collection</ows:Identifier>
      <wps:Reference mimeType="text/xml; subtype=wfs-collection/1.0"
xlink:href="http://geoserver/wps"; method="POST">
        <wps:Body>
          <wps:Execute version="1.0.0" service="WPS">
            <ows:Identifier>gs:Feature</ows:Identifier>
            <wps:DataInputs>
              <wps:Input>
                <ows:Identifier>geometry</ows:Identifier>
                <wps:Data>
                  <wps:ComplexData
mimeType="application/wkt"><![CDATA[POLYGON((0 0, 0 10,10 10,10 0,0
0))]]></wps:ComplexData>
                </wps:Data>
              </wps:Input>
              <wps:Input>
                <ows:Identifier>crs</ows:Identifier>
                <wps:Data>
                  <wps:LiteralData>EPSG:4326</wps:LiteralData>
                </wps:Data>
              </wps:Input>
              <wps:Input>
                <ows:Identifier>typeName</ows:Identifier>
                <wps:Data>
                  <wps:LiteralData>buf</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>
        </wps:Body>
      </wps:Reference>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>second feature collection</ows:Identifier>
      <wps:Reference mimeType="text/xml; subtype=wfs-collection/1.0"
xlink:href="http://geoserver/wfs"; method="POST">
        <wps:Body>
          <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
            <wfs:Query typeName="globe:world"/>
          </wfs:GetFeature>
        </wps:Body>
      </wps:Reference>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>intersectionMode</ows:Identifier>
      <wps:Data>
        <wps:LiteralData>INTERSECTION</wps:LiteralData>
      </wps:Data>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>percentagesEnabled</ows:Identifier>
      <wps:Data>
        <wps:LiteralData>true</wps:LiteralData>
      </wps:Data>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>areasEnabled</ows:Identifier>
      <wps:Data>
        <wps:LiteralData>true</wps:LiteralData>
      </wps:Data>
    </wps:Input>
  </wps:DataInputs>
  <wps:ResponseForm>
    <wps:RawDataOutput mimeType="application/json">
      <ows:Identifier>result</ows:Identifier>
    </wps:RawDataOutput>
  </wps:ResponseForm>
</wps:Execute>


On Tue, Oct 16, 2012 at 7:16 AM, apmartins <antonioppmart...@gmail.com>wrote:

> Hi
>
> I'm using Geoserver 2.2 and I have 3 different layers with various
> attributes. I want to get the percentage of the area intersected by the
> buffer.
>
> I tried to use the process chaining with gs:IntersectFeatureCollection,
> gs:CollectGeometries and gs:Clip or just the gs:IntersectFeatureCollection
> with a WKT with the polygon but I always get an error:
> The process output is incompatible with the input target type, was
> expecting
> org.geotools.feature.FeatureCollection and got
> com.vividsolutions.jts.geom.MultiPolygon
>
> I'm using the builder for tests and there's a poor performance. Is there
> anyway to optimize the response?
>
> I think there is a simpler way of doing this but I need help.
> Thanks in advance.
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/Geoserver-2-2-Insertection-with-buffer-tp5009029.html
> Sent from the GeoServer - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>



-- 
Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to