首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Geoserver WPS执行请求

Geoserver WPS执行请求
EN

Stack Overflow用户
提问于 2016-05-04 21:20:16
回答 1查看 1.1K关注 0票数 2

我有一个Geoserver,我正在尝试返回一个带有web链接的WPS的GeoJSON,但我不确定怎么做。

Geoserver网站上的教程说要做卷曲。我相信Geoserver可以做到这一点,因为它有一个演示的WPS构建器,并返回我需要的东西。我使用Leaflet来可视化返回的web链接,所以让它动态拉取而不是指向上传的文件会更好。

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

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2016-05-05 00:54:36

您可能需要使用POST请求,如

代码语言:javascript
复制
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包含以下内容的情况下适用于我:

代码语言:javascript
复制
<?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>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37029050

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档