On Tue, Jul 26, 2011 at 10:04 AM, Arnaud Vandecasteele
<[email protected]> wrote:
> Thank you Andrea and Justin for your anwsers.
>
> More precisely my need is simply to check if a point is inside a shape
> of polygones. This polygones are stored in a shapefile.

Ah, there is a variety of ways to deal with this already, no need to make
a new process, you just need to chain existing ones.
If the polygons are few and you can load all of them in memory safely
you can use the jts:intersects process with one argument being the
point, and the other the result of the "collectGeometries" process against
the shapefile.
The attached "containsStates.xml" provides an example, checking if
a point is in any of the topp:states polygons.

If they are many you should probably first call the gs:filter process with
a smal bbox around the point to just get the candidates, and then
call collect and intersect.
The containsShape.xml file, attached, shows a chain that does the
above against a zipped shapefile I have on disk.


> When I will have more time, I will try to use again the WPS extension.
> But I have a last question. If I understand well the documentation, to
> execute a WPS process I have to send to geoserver a XML file. This
> file contains all the elements (input and output) needed by GeoServer.
> But can we use it as well with a simple URL ?

It can, but you'll have to read the WPS specification to build it, the
demo request builder for the moment just builds xml requests.
Chaining 3 processes in a GET request is also going to push you beyond
the maximum length of a GET request quickly.

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

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

-------------------------------------------------------
<?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>JTS:intersects</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>a</ows:Identifier>
      <wps:Data>
        <wps:ComplexData mimeType="application/wkt"><![CDATA[POINT(-100 47)]]></wps:ComplexData>
      </wps:Data>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>b</ows:Identifier>
      <wps:Reference mimeType="text/xml; subtype=gml/3.1.1" xlink:href="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"; method="POST">
                  <wps:Body>
                    <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2">
                      <wfs:Query typeName="topp: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>
<?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>JTS:intersects</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>a</ows:Identifier>
      <wps:Data>
        <wps:ComplexData mimeType="application/wkt"><![CDATA[POINT(-100 47)]]></wps:ComplexData>
      </wps:Data>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>b</ows:Identifier>
      <wps:Reference mimeType="text/xml; subtype=gml/3.1.1" xlink:href="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/wps"; method="POST">
                  <wps:Body>
                    <wps:Execute version="1.0.0" service="WPS">
                      <ows:Identifier>gs:Query</ows:Identifier>
                      <wps:DataInputs>
                        <wps:Input>
                          <ows:Identifier>features</ows:Identifier>
                          <wps:Reference mimeType="application/zip" xlink:href="file:///home/aaime/devel/gisData/world.zip" method="GET"/>
                        </wps:Input>
                        <wps:Input>
                          <ows:Identifier>filter</ows:Identifier>
                          <wps:Data>
                            <wps:ComplexData mimeType="text/plain; subtype=cql"><![CDATA[BBOX(the_geom, -101, 46, -99, 48)]]></wps:ComplexData>
                          </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: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>
------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to