i created a new WPS process. I have a class with method and class with implementation into GeoServer.
@DescribeProcess(title="overlayWPS", description="Creates buffer around point and overlays it with polygon layer. Returns areas of overlay.")
public class OverlayPolygons implements GeoServerProcess {
@DescribeResult(name="result", description="output result")
public String execute() throws IOException{
Process p = new Process();
return p.overlayPolygons();
}
}
i would like to put input shapefiles as parameter which can user change in wps requiest builder, now i have static URL to specific shp
String overlayPolygons() throws IOException {
String areas = "Object : Area of overlay";
ShapefileDataStore sfds;
sfds = new ShapefileDataStore(new URL("file:///F:\\GeoServer285\\data_dir\\data\\test_data\\lesy_cr.shp"));
SimpleFeatureSource fs;
fs = sfds.getFeatureSource("lesy_cr");
ShapefileDataStore sfds2;
sfds2 = new ShapefileDataStore(new URL("file:///F:\\GeoServer285\\data_dir\\data\\test_data\\chranene_uzemi_cr.shp"));
SimpleFeatureSource fs2;
fs2 = sfds2.getFeatureSource("chranene_uzemi_cr");
I found out there must be some @DescribeParameter annotation, but i cant figure out how to use it at all.