alexander-petkov / wfas

A placeholder for the WFAS project.
5 stars 1 forks source link

Geoscript for WPS definition #36

Open alexander-petkov opened 3 years ago

alexander-petkov commented 3 years ago

Take a look at Geoscript--a platform to deploy Web Processing Services using various scripting languages, without the need to recomplie and redeploy:

Github repo: https://github.com/geoscript

Release announcement based on Geotools 24: https://groups.google.com/g/geoscript/c/_B0Ksr4TCiQ

alexander-petkov commented 3 years ago

Modest success!! This is a Javascript-defined process from the tutorials (I can't get Python to work as of yet) Screenshot from 2020-11-19 08-02-44

Javascript code:

var Process = require("geoscript/process").Process;

exports.process = new Process({
  title: "JavaScript Buffer Process",
  description: "Process that buffers a geometry.",
  inputs: {
    geom: {
      type: "Geometry",
      title: "Input Geometry",
      description: "The target geometry."
    },
    distance: {
      type: "Double",
      title: "Buffer Distance",
      description: "The distance by which to buffer the geometry."
    }
  },
  outputs: {
    result: {
      type: "Geometry",
      title: "Result",
      description: "The buffered geometry."
    }
  },
  run: function(inputs) {
    return {result: inputs.geom.buffer(inputs.distance)};
  }
});
alexander-petkov commented 3 years ago

I've got the Python example to work as well. I still need to find the correct dependencies, because now I need to include the whole app jar to the path. The app jar is ~130MB in size.

alexander-petkov commented 3 years ago

Geoscript Groovy reference:

https://jericks.github.io/geoscript-groovy-cookbook/#introduction