Geoserver WPS 执行请求

问题描述 投票:0回答:1

我有一个 GeoServer,我正在尝试使用带有 Web 链接的 WPS 返回 GeoJSON,但我不确定如何操作。

GeoServer 网站上的教程说要做一个

curl
。我确信 GeoServer 可以做到这一点,因为它有一个演示 WPS 构建器并返回我需要的内容。我正在使用 Leaflet 来可视化返回的 Web 链接,因此最好让它动态拉动而不是指向上传的文件。

这就是我所拥有的。非常感谢任何帮助。

http://localhost:8081/geoserver/ows?service=wps&version=1.0.0&request=Execute&identifier=vec:InclusionFeatureCollection&dataInputs=Layer=https://rawgit.com/pq1/772-Final/master/housesMetro.geojson&Layer=https://rawgit.com/pq1/772-Final/master/housesSchoolDistricts.geojson&Output=application/json
execute geoserver wps
1个回答
3
投票

您可能需要使用类似 POST 请求

curl -v -u admin:geoserver -X POST -H "Content-type: xml" \
-d @test.xml \
http://localhost:4080/geoserver/wps\?request\=Execute\&service\=WPS\&version\=1.0.0

(如果你使用 Windows,显然全部在一行,没有 \)

对我有用,其中

test.xml
包含:

<?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>vec:InclusionFeatureCollection</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>first</ows:Identifier>
      <wps:Reference mimeType="text/xml" xlink:href="http://geoserver/wfs" method="POST">
        <wps:Body>
          <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:sf="http://www.openplans.org/spearfish">
            <wfs:Query typeName="sf:bugsites"/>
          </wfs:GetFeature>
        </wps:Body>
      </wps:Reference>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>second</ows:Identifier>
      <wps:Reference mimeType="text/xml" xlink:href="http://geoserver/wfs" method="POST">
        <wps:Body>
          <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2" xmlns:sf="http://www.openplans.org/spearfish">
            <wfs:Query typeName="sf:restricted"/>
          </wfs:GetFeature>
        </wps:Body>
      </wps:Reference>
    </wps:Input>
  </wps:DataInputs>
  <wps:ResponseForm>
    <wps:RawDataOutput mimeType="application/json">
      <ows:Identifier>result</ows:Identifier>
    </wps:RawDataOutput>
  </wps:ResponseForm>
</wps:Execute>
© www.soinside.com 2019 - 2024. All rights reserved.