Class ModelsSupporter
- java.lang.Object
-
- org.hortonmachine.gears.libs.modules.ModelsSupporter
-
public class ModelsSupporter extends Object
Facility methods and constants used by the console engine
- Author:
- Andrea Antonello - www.hydrologis.com
-
-
Field Summary
Fields Modifier and Type Field Description static StringACTIVEREGIONWINDOWname for the JGrass active region constantstatic StringCATSMAPcolor map type identificatorstatic StringCOLORMAPcolor map type identificatorstatic StringCONSOLEvariable telling that the output should be redirected to consolestatic StringDEFAULTKEYstatic StringDELTATname for the deltat constantstatic int[][]DIRThe 9 directions around a pixel as ROW/COL of the flowdirections grid.static int[][]DIR_WITHFLOW_ENTERINGThe 8 flowdirections, defined as entering towards the center cell.static int[][]DIR_WITHFLOW_EXITINGThe 8 flowdirections, defined as exiting from the center cell.static int[][]DIR_WITHFLOW_EXITING_INVERTEDstatic StringENDDATEname for the enddate constantstatic StringFEATURECOLLECTIONname for the JGrass featurecollectionstatic StringGRASSDBname for the JGrass database constantstatic StringGRASSRASTERMAPraster map type identificatorstatic StringLOCATIONname for the JGrass location constantstatic StringMAPSETname for the JGrass mapset constantstatic StringREMOTEDBURLname for the remotedb constantstatic StringRESOLUTIONstatic StringSTARTDATEname for the startdate constantstatic StringTEXTFILEtext file type identificatorstatic StringUITABLEvariable telling that the output should be redirected to gui tablestatic StringUNITID_CATSname for the categories unit idstatic StringUNITID_COLORMAPname for the color map unit idstatic StringUNITID_FEATUREname for the vector unit idstatic StringUNITID_RASTERname for the raster unit idstatic StringUNITID_SCALARname for the scalar unit idstatic StringUNITID_TEXTFILEname for the text unit idstatic StringUNITID_UNKNOWNname for the generic unit idstatic StringUNKNOWNname for the JGrass unknown elements
-
Constructor Summary
Constructors Constructor Description ModelsSupporter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double[]calculateDirectionFactor(double dx, double dy)Calculate the drainage direction factor (is used in some horton machine like pitfiller, flow,...)static voidcollectParameters(StringBuilder sbTmp, Collection<Access> accessList, String pre)static StringgenerateHelp(Object parent)static StringgenerateTemplate(Object parent)static StringgetStatusString(int statusValue)
-
-
-
Field Detail
-
GRASSDB
public static final String GRASSDB
name for the JGrass database constant- See Also:
- Constant Field Values
-
LOCATION
public static final String LOCATION
name for the JGrass location constant- See Also:
- Constant Field Values
-
MAPSET
public static final String MAPSET
name for the JGrass mapset constant- See Also:
- Constant Field Values
-
STARTDATE
public static final String STARTDATE
name for the startdate constant- See Also:
- Constant Field Values
-
ENDDATE
public static final String ENDDATE
name for the enddate constant- See Also:
- Constant Field Values
-
DELTAT
public static final String DELTAT
name for the deltat constant- See Also:
- Constant Field Values
-
REMOTEDBURL
public static final String REMOTEDBURL
name for the remotedb constant- See Also:
- Constant Field Values
-
ACTIVEREGIONWINDOW
public static final String ACTIVEREGIONWINDOW
name for the JGrass active region constant- See Also:
- Constant Field Values
-
FEATURECOLLECTION
public static final String FEATURECOLLECTION
name for the JGrass featurecollection- See Also:
- Constant Field Values
-
UNKNOWN
public static final String UNKNOWN
name for the JGrass unknown elements- See Also:
- Constant Field Values
-
UNITID_RASTER
public static final String UNITID_RASTER
name for the raster unit id- See Also:
- Constant Field Values
-
UNITID_COLORMAP
public static final String UNITID_COLORMAP
name for the color map unit id- See Also:
- Constant Field Values
-
UNITID_TEXTFILE
public static final String UNITID_TEXTFILE
name for the text unit id- See Also:
- Constant Field Values
-
UNITID_CATS
public static final String UNITID_CATS
name for the categories unit id- See Also:
- Constant Field Values
-
UNITID_SCALAR
public static final String UNITID_SCALAR
name for the scalar unit id- See Also:
- Constant Field Values
-
UNITID_FEATURE
public static final String UNITID_FEATURE
name for the vector unit id- See Also:
- Constant Field Values
-
UNITID_UNKNOWN
public static final String UNITID_UNKNOWN
name for the generic unit id- See Also:
- Constant Field Values
-
CONSOLE
public static final String CONSOLE
variable telling that the output should be redirected to console- See Also:
- Constant Field Values
-
UITABLE
public static final String UITABLE
variable telling that the output should be redirected to gui table- See Also:
- Constant Field Values
-
DIR
public static final int[][] DIR
The 9 directions around a pixel as ROW/COL of the flowdirections grid.Also containing the central position 0,0
FIXME Erica used to add several {0,0} at the end, in order to catch certain values. Those have to be tracked down.
-
DIR_WITHFLOW_ENTERING
public static final int[][] DIR_WITHFLOW_ENTERING
The 8 flowdirections, defined as entering towards the center cell.Each array contains [row, col, flowvalue].
NOTE that these work in ROW/COL order, not COL/ROW!
-1 0 1 +-----+-----+-----+ -1 | 8 | 7 | 6 | +-----+-----+-----+ 0 | 1 | 0 | 5 | +-----+-----+-----+ 1 | 2 | 3 | 4 | +-----+-----+-----+
-
DIR_WITHFLOW_EXITING
public static final int[][] DIR_WITHFLOW_EXITING
The 8 flowdirections, defined as exiting from the center cell.Each array contains [col, row, flowvalue].
-1 0 1 +-----+-----+-----+ -1 | 4 | 3 | 2 | +-----+-----+-----+ 0 | 5 | 0 | 1 | +-----+-----+-----+ 1 | 6 | 7 | 8 | +-----+-----+-----+
-
DIR_WITHFLOW_EXITING_INVERTED
public static final int[][] DIR_WITHFLOW_EXITING_INVERTED
-
COLORMAP
public static final String COLORMAP
color map type identificator- See Also:
- Constant Field Values
-
TEXTFILE
public static final String TEXTFILE
text file type identificator- See Also:
- Constant Field Values
-
CATSMAP
public static final String CATSMAP
color map type identificator- See Also:
- Constant Field Values
-
GRASSRASTERMAP
public static final String GRASSRASTERMAP
raster map type identificator- See Also:
- Constant Field Values
-
DEFAULTKEY
public static final String DEFAULTKEY
- See Also:
- Constant Field Values
-
RESOLUTION
public static final String RESOLUTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
calculateDirectionFactor
public static double[] calculateDirectionFactor(double dx, double dy)Calculate the drainage direction factor (is used in some horton machine like pitfiller, flow,...)Is the distance betwen the central pixel, in a 3x3 kernel, and the neighboured pixels.
- Parameters:
dx- is the resolution of a raster map in the x direction.dy- is the resolution of the raster map in the y direction.- Returns:
- fact the direction factor or 1/lenght where lenght is the distance of the pixel from the central poxel.
-
getStatusString
public static String getStatusString(int statusValue)
-
collectParameters
public static void collectParameters(StringBuilder sbTmp, Collection<Access> accessList, String pre) throws Exception
- Throws:
Exception
-
-