Execute Sample |
The Supermap iServer WPS 1.0.0 service encapsulates a set of analysis capabilities native to iServer (see WPS Overview ). Users can perform these analysis operations through the WPS service of Supermap iServer to get the results of the analysis.
This example performs the Execute operation and executes the POST request for the analysis function supported by the Execute operation of the WPS service, as shown below:
Clipping analysis is performed on two intersecting surfaces: the World.Countries.188 and the World.Ocean.1. The POST request address is: http://localhost:8090/iserver/services/spatialanalyst-changchun/wps100, and the request body is as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wps:Execute service="WPS" version="1.0.0"
xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
../wpsExecute_request.xsd">
<ows:Identifier>Clip</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>sourceGeometry</ows:Identifier>
<ows:Title>sourceGeometry</ows:Title>
<wps:Reference
xlink:href="http://localhost:8090/iserver/services/data-world/wfs100?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=World:Countries&FEATUREID=World.Countries.188&MAXFEATURES=1" />
</wps:Input>
<wps:Input>
<ows:Identifier>operatePolygon</ows:Identifier>
<ows:Title>operatePolygon</ows:Title>
<wps:Reference
xlink:href="http://localhost:8090/iserver/services/data-world/wfs100?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=World:Ocean&FEATUREID=World.Ocean.1&MAXFEATURES=1" />
</wps:Input>
<wps:Input>
<ows:Identifier>outputformat</ows:Identifier>
<ows:Title>format.</ows:Title>
<wps:Data>
<wps:LiteralData>gml212</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:ResponseDocument storeExecuteResponse="true">
<wps:Output asReference="true">
<ows:Identifier>ClippedPolygon</ows:Identifier>
<ows:Title>Clip from polygon.</ows:Title>
<ows:Abstract>Clip polygon by other polygon. Accepts the polygon as
GML and provides GML output for the clip feature.
</ows:Abstract>
</wps:Output>
</wps:ResponseDocument>
</wps:ResponseForm>
</wps:Execute>
The response results are as follows:
Extract isoline from the point dataset Company@Changchun. The POST address is: http://localhost:8090/iserver/services/spatialanalyst-changchun/wps100, and the request body is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wps:Execute service="WPS" version="1.0.0"
xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
../wpsExecute_request.xsd">
<ows:Identifier>ExtractIsoline</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>pointDataset</ows:Identifier>
<ows:Title>pointDataset</ows:Title>
<wps:Data>
<wps:LiteralData>Company@Changchun</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>zValueField</ows:Identifier>
<ows:Title>zValueField.</ows:Title>
<wps:Data>
<wps:LiteralData>SMID</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>Resolution</ows:Identifier>
<ows:Title>Distance which people will walk to get to a playground.
</ows:Title>
<wps:Data>
<wps:LiteralData>20</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>Interval</ows:Identifier>
<ows:Title>Interval.</ows:Title>
<wps:Data>
<wps:LiteralData>50</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>ResampleTolerance</ows:Identifier>
<ows:Title>ResampleTolerance.</ows:Title>
<wps:Data>
<wps:LiteralData>0.5</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>SmoothMethod</ows:Identifier>
<ows:Title>SmoothMethod.</ows:Title>
<wps:Data>
<wps:LiteralData>POLISH</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>Smoothness</ows:Identifier>
<ows:Title>Smoothness.</ows:Title>
<wps:Data>
<wps:LiteralData>3</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>TerrainInterpolateType</ows:Identifier>
<ows:Title>TerrainInterpolateType.</ows:Title>
<wps:Data>
<wps:LiteralData>IDW</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>outputformat</ows:Identifier>
<ows:Title>format.</ows:Title>
<wps:Data>
<wps:LiteralData>gml212</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:ResponseDocument storeExecuteResponse="true">
<wps:Output asReference="false">
<ows:Identifier>ExtractedIsoregion</ows:Identifier>
<ows:Title>ExtractedIsoregion.</ows:Title>
<ows:Abstract>ExtractedIsoregion.</ows:Abstract>
</wps:Output>
</wps:ResponseDocument>
</wps:ResponseForm>
</wps:Execute>
The response results are as follows:
Through the keyword "Changchun" to obtain the site information, and the POST request is executed for the http://localhost:8090/iserver/services/traffictransferanalyst-sample/wps100.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wps:Execute service="WPS" version="1.0.0"
xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0../wpsExecute_request.xsd">
<ows:Identifier>StopListByKeyWord</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>keyWord</ows:Identifier>
<ows:Title></ows:Title>
<wps:Data>
<wps:LiteralData>%e9%95%bf%e6%98%a5</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>returnPosition</ows:Identifier>
<ows:Title></ows:Title>
<wps:Data>
<wps:LiteralData>true</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:ResponseDocument storeExecuteResponse="true">
<wps:Output asReference="false">
<ows:Identifier>StopListByKeyWord</ows:Identifier>
<ows:Title>StopListByKeyWord.</ows:Title>
<ows:Abstract>StopListByKeyWord.</ows:Abstract>
</wps:Output>
</wps:ResponseDocument>
</wps:ResponseForm>
</wps:Execute>
The "%e9%95%bf%e6%98%a5" is obtained by URL encoding of the keyword "Changchun".
The response results are as follows:
An optimal path is obtained through a network node ID array [1, 12] to be passed through. Execute the POST request on the http://localhost:8090/iserver/services/transportationanalyst-sample/wps100, and the request body is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wps:Execute service="WPS" version="1.0.0"
xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
../wpsExecute_request.xsd">
<ows:Identifier>Path</ows:Identifier>
<wps:DataInputs>
<wps:Input>
<ows:Identifier>points</ows:Identifier>
<ows:Title></ows:Title>
<wps:Data>
<wps:LiteralData></wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>nodeIDs</ows:Identifier>
<ows:Title>nodeIDs</ows:Title>
<wps:Data>
<wps:LiteralData>1,12</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>hasLeastEdgeCount</ows:Identifier>
<ows:Title></ows:Title>
<wps:Data>
<wps:LiteralData>false</wps:LiteralData>
</wps:Data>
</wps:Input>
<wps:Input>
<ows:Identifier>networkName</ows:Identifier>
<ows:Title>networkName</ows:Title>
<wps:Data>
<wps:LiteralData>RoadNet@Changchun</wps:LiteralData>
</wps:Data>
</wps:Input>
</wps:DataInputs>
<wps:ResponseForm>
<wps:ResponseDocument storeExecuteResponse="true">
<wps:Output asReference="false">
<ows:Identifier>FindedPath</ows:Identifier>
<ows:Title>FindedPath.</ows:Title>
<ows:Abstract>JSON stream describing the finded Path.</ows:Abstract>
</wps:Output>
</wps:ResponseDocument>
</wps:ResponseForm>
</wps:Execute>
The response results are as follows:
Note: In the above request body, the node <wps: ResponseDocument storeExecuteResponse="true">, so the <wps: Reference> node under the <wps: Output> node in the response document records the URL address of the analysis result. For example, in the response of the overlay analysis function Clip, the URL address of the analysis result is returned. Accessing this address in the browser: http://localhost:8090/iserver/services/spatialanalyst-changchun/wps100?request=getxml&file=ClippedPolygon.xml to obtain the result of Clip analysis, which is also stored in the "%SuperMap iServer HOME%\webapps\iserver\output\xml" folder. If the node <wps: ResponseDocument storeExecuteResponse="fasle">, after a post request, the result obtained from the analysis is directly reflected back without storing the result file.