我有一个Geoserver,我正在尝试返回一个带有web链接的WPS的GeoJSON,但我不确定怎么做。
Geoserver网站上的教程说要做卷曲。我相信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发布于 2016-05-05 00:54:36
您可能需要使用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>https://stackoverflow.com/questions/37029050
复制相似问题