Implement a JAI operators one to compute a watershed from a set of pixel locations the other to compute all watersheds.
The syntax will be
From pixel locations
ParameterBlock p = new ParameterBlock();
p.addSource(geoRaster); //The input raster is a D8 flow direction
p.add(Point[]);//Collection of points.
// Run the new operator.
RenderedOp output = JAI.create("D8Watershed", p);
All watersheds
This method needs to identify all outlets and compute the watershed for each of them.
ParameterBlock p = new ParameterBlock();
p.addSource(geoRaster); //The input raster is a D8 flow direction
// Run the new operator.
RenderedOp output = JAI.create("D8Watershed", p);
SQL function
The ST_D8Watershed will have the following signatures
ST_D8Watershed(RASTER::TYPE) -> return a new raster with all watersheds.
ST_D8Watershed(RASTER::TYPE, MULTIPOINTS or Geometry collection') -> a set of watersheds stored in a raster with an indice.
Implement an algorithm to extract all watersheds or one based on a pixel location.
See https://grass.osgeo.org/grass64/manuals/r.watershed.html
Implement a JAI operators one to compute a watershed from a set of pixel locations the other to compute all watersheds.
The syntax will be
From pixel locations
All watersheds
This method needs to identify all outlets and compute the watershed for each of them.
The ST_D8Watershed will have the following signatures