Addressing a WPS using Geotools' ExecuteProcessRequest

المشرف العام

Administrator
طاقم الإدارة
I am trying to address a WPS that is running on a known machine to retrieve some isochrones. Below are excerpts from the relevant parts of the WSDL of said server:

Here are the capabilities as retrieved from the server:

xxx_isochrones XXX Isochrones This process calculates isochrones. Process xxx_isochrones successfully calculated isochrones_png Isochrones PNG PNG showing segments of isochrones for 5, 10 and 20 minutes of traveltime for the chosen means of transport. It reassembles the given bounding box isochrones_gml Isochrones GML GML vector data consisting of segments of isochrones for 5, 10 and 20 minutes of traveltime for the chosen means of transport.

To address the service I am doing the following (error and exception handling removed to increase readability):

// The WeProcessingServiceManager manages a map of already instantiated services, nothing fancy.WebProcessingService wps = WebProcessingServiceManager.getServiceFor(new URL("ourServerURL"));ExecuteProcessRequest request = wps.createExecuteProcessRequest();request.setIdentifier("xxx_isochrones");request.addInput("network_id", Arrays.asList(wps.createLiteralInputValue("bicycles")));request.addInput("x_coord", Arrays.asList(wps.createLiteralInputValue("1234567")));request.addInput("y_coord", Arrays.asList(wps.createLiteralInputValue("1234567")));ResponseDocumentType doc = wps.createResponseDocumentType(false, true, true, "isochrones_pngResult");DocumentOutputDefinitionType odt = (DocumentOutputDefinitionType) doc.getOutput().get(0);odt.setMimeType("image/png");odt.setAsReference(true);ResponseFormType responseForm = wps.createResponseForm(doc, null);request.setResponseForm(responseForm);ExecuteProcessResponse response = wps.issueRequest(request);Unfortunately it seems that I cannot extract the desired result. I am not sure why it isn't working. I followed a very basic tutorial who doesn't explain much. I also find the documentation lacking.

Would anyone have an idea how to extract the desired result, that is, the PNG or at least the URL of the png? Thank you!



أكثر...
 
أعلى