Guest User

Untitled

a guest
Jan 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. function SimpleChain1(conf,inputs,outputs){
  2.  
  3. // Create all required ZOO.formats
  4. var fGJ=new ZOO.Format.GeoJSON();
  5. var fGML=new ZOO.Format.GML();
  6.  
  7. // Read the input GML
  8. var inputData=fGML.read(inputs["InputData"]["value"]);
  9.  
  10. // Compute big Buffer
  11. var bufferResultAsJSON=Buffer(inputData,0.015);
  12.  
  13. // Create the Buffer result BBOX
  14. var bbox = new ZOO.Bounds();
  15. var bounds=bufferResultAsJSON[0].geometry.getVertices();
  16. for(var t in bounds){
  17. bbox.extend(bounds[t]);
  18. }
  19. var finalG=bbox.toGeometry();
  20.  
  21. // Compute Buffer standard buffer
  22. var bufferResultAsJSON=Buffer(inputData,0.0015);
  23.  
  24. // Request Difference service using Buffer result and features in the BBOX
  25. var result=new ZOO.Feature(finalG,{"fid": "1","name": "Result1000"});
  26. var myProcess2 = new ZOO.Process(zoo_url,'DifferencePy');
  27. var myInputs2 = {InputEntity1: { type: 'complex', value: fGJ.write(bbox.toGeometry()), mimeType: "application/json" }, InputEntity2: { type: 'complex', value: fGJ.write(bufferResultAsJSON), mimeType: "application/json"} };
  28. var myOutputs2= {Result: { type: 'RawDataOutput', "mimeType": "application/json" } };
  29. var myExecuteResult4=myProcess2.Execute(myInputs2,myOutputs2);
  30.  
  31. return {result: ZOO.SERVICE_SUCCEEDED, outputs: [ {name:"Result", mimeType: "application/json", value: myExecuteResult4} ] };
  32.  
  33. }
Add Comment
Please, Sign In to add comment