Package org.tinfour.svm.properties
Class SvmProperties
- java.lang.Object
-
- org.tinfour.svm.properties.SvmProperties
-
public class SvmProperties extends Object
Provides parameter and resource specifications for a SVM analysis run.
-
-
Constructor Summary
Constructors Constructor Description SvmProperties()Standard constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoesLocaleUseCommaForDecimal()Indicates whether the Locale uses the comma character for the decimal part of floating-point values.FilegetAnomalyTableFile()Get the path to a file for writing a table reporting anomalies.SvmBathymetryModelgetBathymetryModel()Gets the bathymetry model specified for the soundings.List<SvmFileSpecification>getBoundarySpecifications()Get a list of the SVM file specifications for the polygon bounding constraints of the body of water.DimensiongetCapacityGraphDimensions()Get the dimensions for the capacity graph image file.FilegetCapacityGraphFile()Get the path to a file for writing a graph of the capacity as a function of water level.StringgetCapacityGraphTitle()Gets the title for the capacity graph imageDimensiongetContourGraphDimensions()Get the dimensions for the contour graph image file.FilegetContourGraphFile()Get the path to a file for writing an image file showing a contour plot of the reservoir data.doublegetContourGraphInterval()Gets the contour graph intervalStringgetContourGraphLegendText()Gets the title for the capacity graph imageintgetContourGraphSmoothingFactor(int defaultValue)Gets the smoothing factor for constructing contours.FilegetContourLineShapefile()Get the path to a file for writing contour region Shapefile showing a contour plot of the reservoir data.FilegetContourRegionShapefile()Get the path to a file for writing contour region Shapefile showing a contour plot of the reservoir data.DimensiongetDrawdownGraphDimensions()Get the dimensions for the drawdown graph image file.FilegetDrawdownGraphFile()Get the path to a file for writing a graph of the drawdown as a function of water level.StringgetDrawdownGraphTitle()Gets the title for the drawdown graph imageFilegetExperimentalFilterFile()Get the path to a file for writing the output from an experimental filter.doublegetExperimentalFilterSlopeOfAnomaly(double defaultValue)doublegetExperimentalFilterSlopeOfSupport(double defaultValue)LocalegetExplicitLocale()Gets the explicit value for the locale, if it was set.FilegetGeoTiffFile()Gets the path to a file for writing an output GeoTIFF file containing the interpolated grid of water bottom elevations.floatgetGeoTiffNoDataCode()Gets a string to be used for the GDAL No-Data element.intgetGeoTiffProjectionCode()Gets the specified GeoTIFF projection code, if any.doublegetGridCellSize()Get the grid cell size, if provided.FilegetGridFile()Get the path to a file for writing an output data file giving an interpolated grid of water bottom elevations.FilegetGridFile(String extension)Get the path to a file for writing an output file to be used for processing raster grid.FilegetGridImageFile()Get the path to a file for writing an output image file giving an interpolated grid of water bottom elevations.ICoordinateTransformgetHorizontalTransform()Gets a horizontal coordinate scaling transform.FilegetInputFolder()Gets the input folder specification from the properties; if the properties do not contain a key/value for inputFolder, a null is returned.FilegetOutputFolder()Gets the output folder specification from the properties; if the properties do not contain a key/value for outputFolder, a null is returned.FilegetReportFile()Get the path to a file for writing an output report giving a record of the computation parameters and results used for running the Simple Volumetric Model.List<SvmFileSpecification>getSampleSpecifications()Get a list of the SVM file specifications for input samples.doublegetShorelineReferenceElevation()Get the shoreline reference elevation, if provided.FilegetSupplementalConstraintsFile()Get a reference to a supplemental shapefile providing constraints for SVM processing.List<SvmFileSpecification>getSupplementSpecifications()Get a list of the SVM file specifications for supplemental samples.FilegetTableFile()Get the path to a file for writing an output table giving volume and elevation at fixed intervals (specified by getTableInterval()).doublegetTableInterval()Get the interval for computing a series of surface elevation values to be used for modeling.SvmUnitSpecificationgetUnitOfArea()Get the a description and potential conversion factor unit to be used for specifying surface area.SvmUnitSpecificationgetUnitOfDistance()Get the a description and potential conversion factor unit to be used for specifying horizontal and vertical distances.SvmUnitSpecificationgetUnitOfVolume()Get the a description and potential conversion factor unit to be used for specifying volume.static intindexArg(String[] args, String target, boolean valueRequired)Checks to see if an argument list includes the specified target and returns its index within the argument array.booleanisBathymetryModelSpecified()Indicates whether the source data includes a bathymetry model specification.booleanisCapacityGraphEnabled()Indicates whether the capacity graph function is enabledbooleanisContourShapefileShorelineEnabled()Indicates whether the optional shoreline append operation is enabled.booleanisDrawdownGraphEnabled()Indicates whether the drawdown graph function is enabledbooleanisExperimentalFilterEnabled()booleanisFlatFixerEnabled()Indicates whether the near-shore, flat-triangle remediation is enabled.booleanisGeoTiffDataCompressionEnabled()Indicates whether data compression is enabled for GeoTIFF data.booleanisGeoTiffNoDataCodeSpecified()Indicates whether the properties file specifies a no-data code.booleanisGeoTiffProjectionCodeSpecified()Indicates whether the source properties includes a specification for the GeoTiff Projection code (usually an EPSG projection code).voidload(File file)Loads a properties instance using values and paths specified in the indicated file.static SvmPropertiesload(String[] args)Loads a properties instance using values and paths specified through the command-line arguments.voidwriteSummary(PrintStream ps)Writes summary data to the specified PrintStream instance.
-
-
-
Method Detail
-
indexArg
public static int indexArg(String[] args, String target, boolean valueRequired)
Checks to see if an argument list includes the specified target and returns its index within the argument array.- Parameters:
args- a valid list of stringstarget- the desired target stringvalueRequired- indicates that the target argument requires a value specification.- Returns:
- if found, a value of zero or greater; otherwise, -1.
-
load
public static SvmProperties load(String[] args) throws IOException
Loads a properties instance using values and paths specified through the command-line arguments.- Parameters:
args- a valid, potentially zero-length array of strings- Returns:
- if successful, a populated instance
- Throws:
IOException- in the event of a unrecoverable I/O condition.
-
load
public void load(File file) throws IOException
Loads a properties instance using values and paths specified in the indicated file.- Parameters:
file- a valid file instance- Throws:
IOException- in the event of an unrecoverable I/O condition.
-
getExplicitLocale
public Locale getExplicitLocale()
Gets the explicit value for the locale, if it was set.- Returns:
- if explicitly set, a valid instance; otherwise, a null
-
doesLocaleUseCommaForDecimal
public boolean doesLocaleUseCommaForDecimal()
Indicates whether the Locale uses the comma character for the decimal part of floating-point values. This method is used for formatting numeric strings in SVM. Many non-English speaking conventions use the comma rather than the period.- Returns:
- true if the Locale uses periods for decimals; otherwise, false.
-
getSampleSpecifications
public List<SvmFileSpecification> getSampleSpecifications()
Get a list of the SVM file specifications for input samples. The SvmFileSpecification may include metadata such as DBF file field name and unit conversion values.- Returns:
- a valid, potentially empty list
-
getSupplementSpecifications
public List<SvmFileSpecification> getSupplementSpecifications()
Get a list of the SVM file specifications for supplemental samples. Typically these are samples derived for shallow-water areas. The SvmFileSpecification may include metadata such as DBF file field name and unit conversion values.- Returns:
- a valid, potentially empty list
-
getBoundarySpecifications
public List<SvmFileSpecification> getBoundarySpecifications()
Get a list of the SVM file specifications for the polygon bounding constraints of the body of water. The SvmFileSpecification may include metadata such as DBF file field name and unit conversion values.- Returns:
- a valid, potentially empty list
-
getUnitOfDistance
public SvmUnitSpecification getUnitOfDistance()
Get the a description and potential conversion factor unit to be used for specifying horizontal and vertical distances. Note that the SVM model assumes uniform metrics in all directions.- Returns:
- a valid unit of distance instance.
-
getInputFolder
public File getInputFolder()
Gets the input folder specification from the properties; if the properties do not contain a key/value for inputFolder, a null is returned.- Returns:
- a valid instance; or a null if a folder is not specified.
-
getOutputFolder
public File getOutputFolder()
Gets the output folder specification from the properties; if the properties do not contain a key/value for outputFolder, a null is returned.- Returns:
- a valid instance; or a null if a folder is not specified.
-
getReportFile
public File getReportFile()
Get the path to a file for writing an output report giving a record of the computation parameters and results used for running the Simple Volumetric Model. If not specified, a null value is returned and it is assumed that the report should be written to standard output.- Returns:
- a valid File instance or a null if not specified.
-
getTableFile
public File getTableFile()
Get the path to a file for writing an output table giving volume and elevation at fixed intervals (specified by getTableInterval()). If not specified, a null value is returned and it is assumed that the table should be written to standard output.- Returns:
- a valid File instance or a null if not specified.
-
getTableInterval
public double getTableInterval()
Get the interval for computing a series of surface elevation values to be used for modeling. By default, the value for this specification is 1 unit (1 foot, 1 meter, etc.), but fractional values are allowed.- Returns:
- a floating point value greater than 0.
-
isFlatFixerEnabled
public boolean isFlatFixerEnabled()
Indicates whether the near-shore, flat-triangle remediation is enabled.- Returns:
- true if remediation is to be performed; otherwise, false.
-
writeSummary
public void writeSummary(PrintStream ps)
Writes summary data to the specified PrintStream instance. Note that the input to this method is often, but not always, System.out.- Parameters:
ps- a valid instance
-
getUnitOfArea
public SvmUnitSpecification getUnitOfArea()
Get the a description and potential conversion factor unit to be used for specifying surface area.- Returns:
- a valid unit specification instance.
-
getUnitOfVolume
public SvmUnitSpecification getUnitOfVolume()
Get the a description and potential conversion factor unit to be used for specifying volume.- Returns:
- a valid unit specification instance.
-
getShorelineReferenceElevation
public double getShorelineReferenceElevation()
Get the shoreline reference elevation, if provided.- Returns:
- a valid floating point number or a NaN if undefined
-
getGridCellSize
public double getGridCellSize()
Get the grid cell size, if provided.- Returns:
- a valid floating point number or a NaN if undefined
-
getGridFile
public File getGridFile()
Get the path to a file for writing an output data file giving an interpolated grid of water bottom elevations.- Returns:
- a valid File instance or a null if not specified.
-
getGridImageFile
public File getGridImageFile()
Get the path to a file for writing an output image file giving an interpolated grid of water bottom elevations.- Returns:
- a valid File instance or a null if not specified.
-
getGeoTiffFile
public File getGeoTiffFile()
Gets the path to a file for writing an output GeoTIFF file containing the interpolated grid of water bottom elevations.- Returns:
- a valid File instance or a null if not specified.
-
getSupplementalConstraintsFile
public File getSupplementalConstraintsFile()
Get a reference to a supplemental shapefile providing constraints for SVM processing.- Returns:
- if specified, a valid File instance; otherwise, a null
-
getGridFile
public File getGridFile(String extension)
Get the path to a file for writing an output file to be used for processing raster grid. The properties file is treated as containing the root name. An extension is added as appropriate.- Parameters:
extension- the file extension (including the period).- Returns:
- a valid File instance or a null if not specified.
-
isCapacityGraphEnabled
public boolean isCapacityGraphEnabled()
Indicates whether the capacity graph function is enabled- Returns:
- true if the graph is enabled; otherwise, false.
-
getCapacityGraphFile
public File getCapacityGraphFile()
Get the path to a file for writing a graph of the capacity as a function of water level. .- Returns:
- a valid File instance or a null if not specified.
-
getCapacityGraphDimensions
public Dimension getCapacityGraphDimensions()
Get the dimensions for the capacity graph image file.- Returns:
- a valid instance of non-trivial size.
-
getCapacityGraphTitle
public String getCapacityGraphTitle()
Gets the title for the capacity graph image- Returns:
- if defined, a valid non-empty string instance; if undefined, a null.
-
isDrawdownGraphEnabled
public boolean isDrawdownGraphEnabled()
Indicates whether the drawdown graph function is enabled- Returns:
- true if the graph is enabled; otherwise, false.
-
getDrawdownGraphFile
public File getDrawdownGraphFile()
Get the path to a file for writing a graph of the drawdown as a function of water level. .- Returns:
- a valid File instance or a null if not specified.
-
getDrawdownGraphDimensions
public Dimension getDrawdownGraphDimensions()
Get the dimensions for the drawdown graph image file.- Returns:
- a valid instance of non-trivial size.
-
getDrawdownGraphTitle
public String getDrawdownGraphTitle()
Gets the title for the drawdown graph image- Returns:
- if defined, a valid non-empty string instance; if undefined, a null.
-
getContourGraphFile
public File getContourGraphFile()
Get the path to a file for writing an image file showing a contour plot of the reservoir data.- Returns:
- a valid File instance or a null if not specified.
-
getContourRegionShapefile
public File getContourRegionShapefile()
Get the path to a file for writing contour region Shapefile showing a contour plot of the reservoir data.- Returns:
- a valid File instance or a null if not specified.
-
getContourLineShapefile
public File getContourLineShapefile()
Get the path to a file for writing contour region Shapefile showing a contour plot of the reservoir data.- Returns:
- a valid File instance or a null if not specified.
-
isContourShapefileShorelineEnabled
public boolean isContourShapefileShorelineEnabled()
Indicates whether the optional shoreline append operation is enabled.- Returns:
- true if the append operation is enabled; otherwise, false.
-
getContourGraphDimensions
public Dimension getContourGraphDimensions()
Get the dimensions for the contour graph image file.- Returns:
- a valid instance of non-trivial size.
-
getContourGraphLegendText
public String getContourGraphLegendText()
Gets the title for the capacity graph image- Returns:
- if defined, a valid non-empty string instance; if undefined, a null.
-
getContourGraphInterval
public double getContourGraphInterval()
Gets the contour graph interval- Returns:
- if defined, a floating point value greater than zero; if undefined, zero.
-
getAnomalyTableFile
public File getAnomalyTableFile()
Get the path to a file for writing a table reporting anomalies. This setting controls whether anomaly analysis is performed.- Returns:
- a valid File instance or a null if not specified.
-
getBathymetryModel
public SvmBathymetryModel getBathymetryModel()
Gets the bathymetry model specified for the soundings.- Returns:
- a valid instance or a null if a value was not properly specified.
-
isBathymetryModelSpecified
public boolean isBathymetryModelSpecified()
Indicates whether the source data includes a bathymetry model specification. This method does not reflect whether that specification included a valid value.- Returns:
- true if a specification was supplied; otherwise, false.
-
isGeoTiffProjectionCodeSpecified
public boolean isGeoTiffProjectionCodeSpecified()
Indicates whether the source properties includes a specification for the GeoTiff Projection code (usually an EPSG projection code).- Returns:
- true if a projection code is set; otherwise, false
-
getGeoTiffProjectionCode
public int getGeoTiffProjectionCode()
Gets the specified GeoTIFF projection code, if any.- Returns:
- if available, a valid integer; otherwise, a zero.
-
getGeoTiffNoDataCode
public float getGeoTiffNoDataCode()
Gets a string to be used for the GDAL No-Data element.- Returns:
- if specified, a valid non-blank string; otherwise, a null.
-
isGeoTiffNoDataCodeSpecified
public boolean isGeoTiffNoDataCodeSpecified()
Indicates whether the properties file specifies a no-data code.- Returns:
- true if a no-data code is specified; otherwise, false.
-
isGeoTiffDataCompressionEnabled
public boolean isGeoTiffDataCompressionEnabled()
Indicates whether data compression is enabled for GeoTIFF data.- Returns:
- true if data compression is enabled; otherwise, false.
-
isExperimentalFilterEnabled
public boolean isExperimentalFilterEnabled()
-
getExperimentalFilterFile
public File getExperimentalFilterFile()
Get the path to a file for writing the output from an experimental filter.- Returns:
- a valid File instance or a null if not specified.
-
getExperimentalFilterSlopeOfAnomaly
public double getExperimentalFilterSlopeOfAnomaly(double defaultValue)
-
getExperimentalFilterSlopeOfSupport
public double getExperimentalFilterSlopeOfSupport(double defaultValue)
-
getContourGraphSmoothingFactor
public int getContourGraphSmoothingFactor(int defaultValue)
Gets the smoothing factor for constructing contours. The smoothing factor represents the number of passes the low-pass contour smoothing algorithm will be applied. Since the smoothing is cumulative, more passes result in increased smoothing but lesser detail.- Parameters:
defaultValue- a positive whole number- Returns:
- a positive integer value, zero for no smoothing.
-
getHorizontalTransform
public ICoordinateTransform getHorizontalTransform()
Gets a horizontal coordinate scaling transform.- Returns:
- if a valid property exists, a transform instance; otherwise, a null.
-
-