Class SvmBathymetryData


  • public class SvmBathymetryData
    extends Object
    A class for loading bathymetry and shoreline data to be used for estimating lake volume.
    • Field Detail

      • BATHYMETRY_SOURCE

        public static final int BATHYMETRY_SOURCE
        Used to set an auxiliary value for a vertex indicating that it is original data from a bathymetry data source.
        See Also:
        Constant Field Values
      • SUPPLEMENTAL_SOURCE

        public static final int SUPPLEMENTAL_SOURCE
        Used to set an auxiliary value for a vertex indicating that it is data obtained from a supplemental source.
        See Also:
        Constant Field Values
      • FLAT_ADJUSTMENT

        public static final int FLAT_ADJUSTMENT
        Used to set an auxiliary value for a vertex indicating that it is a modeled data point used to adjust flat areas.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SvmBathymetryData

        public SvmBathymetryData​(SvmBathymetryModel model)
        Constructs an instance to load and store bathymetry data.
        Parameters:
        model - a valid bathymetry model specification
    • Method Detail

      • loadSamples

        public void loadSamples​(File inputSoundingsFile,
                                String dbfBathymetryField,
                                IVerticalCoordinateTransform verticalTransform,
                                ICoordinateTransform horizontalTransform)
                         throws IOException
        Load main set of soundings from a file. This process is incremental and any new soundings will be added to the list of those already loaded.
        Parameters:
        inputSoundingsFile - the input file giving soundings.
        dbfBathymetryField - the optional string giving the name of the DBF field to be used to extracting data from the input file (used for Shapefiles).
        verticalTransform - the optional transform used to map vertical coordinates to a new value; or null if no transform is to be applied.
        horizontalTransform - the optional transform used to map horizontal coordinates to new values; or null if no transform is to be applied.
        Throws:
        IOException - in the event of an unrecoverable I/O condition
      • loadSupplement

        public void loadSupplement​(File inputSupplementFile,
                                   String dbfBathymetryField,
                                   IVerticalCoordinateTransform verticalTransform,
                                   ICoordinateTransform horizontalTransform)
                            throws IOException
        Load supplemental soundings from a file. This process is incremental and any new soundings will be added to the list of those already loaded.
        Parameters:
        inputSupplementFile - the input file giving soundings.
        dbfBathymetryField - the optional string giving the name of the DBF field to be used to extracting data.
        verticalTransform - the optional\transform used to map vertical coordinates to a new value; or null if no transform is to be applied.
        horizontalTransform - the optional transform used to map horizontal coordinates to new values; or null if no transform is to be applied.
        Throws:
        IOException - in the event of an unrecoverable I/O condition
      • loadBoundaryConstraints

        public void loadBoundaryConstraints​(File inputBoundaryFile,
                                            String dbfFieldForZ,
                                            IVerticalCoordinateTransform verticalTransform,
                                            ICoordinateTransform horizontalTransform)
                                     throws IOException
        Load main set of polygon constraints defining the boundary of the body of water. This process is incremental and any new constraints will be added to the list of those already loaded.
        Parameters:
        inputBoundaryFile - the input file giving constraints.
        dbfFieldForZ - the optional string giving the name of the DBF field to be used to extracting data from the input file (used for Shapefiles).
        verticalTransform - the optional\transform used to map vertical coordinates to a new value; or null if no transform is to be applied.
        Throws:
        IOException - in the event of an unrecoverable I/O condition
      • getMinZ

        public double getMinZ()
        Get the minimum sounding value in the source data
        Returns:
        the minimum sounding value
      • getMaxZ

        public double getMaxZ()
        Get the maximum sounding value in the source data
        Returns:
        the maximum sounding value
      • getMeanZ

        public double getMeanZ()
        Get the mean of the sounding values in the source data
        Returns:
        the mean sounding value
      • getNominalPointSpacing

        public double getNominalPointSpacing()
        Gets the nominal spacing for the data set.
        Returns:
        a positive floating point value
      • getSoundings

        public List<Vertex> getSoundings()
        Get a list of the soundings. The result includes the main set of soundings, but does not include any supplemental soundings that may have been loaded.
        Returns:
        the soundings
      • addSoundings

        public void addSoundings​(List<Vertex> extraSoundings)
        Append additional soundings to the soundings collection.
        Parameters:
        extraSoundings - a valid list of soundings.
      • getSoundingsAndSupplements

        public List<Vertex> getSoundingsAndSupplements()
        Gets all bathymetry sounding data, including both the main soundings list and any supplemental data that was loaded.
        Returns:
        a valid list of vertices.
      • getReducedListOfSoundings

        public List<Vertex> getReducedListOfSoundings​(int nTarget)
        Get a reduced list of the soundings. Intended for diagnostic and rendering purposes.
        Parameters:
        nTarget - the target number of soundings for the list
        Returns:
        the soundings
      • getSoundingBounds

        public Rectangle2D getSoundingBounds()
        Get the bounds of the sounding data
        Returns:
        a safe copy of a valid, non-empty rectangle.
      • getBounds

        public Rectangle2D getBounds()
        Get the overall bounds of the sounding and constraint data
        Returns:
        a safe copy of a valid, non-empty rectangle.
      • getShoreReferenceElevation

        public double getShoreReferenceElevation()
        Get the reference elevation for the shoreline (conservation pool elevation)
        Returns:
        a valid floating point value greater than the vertical coordinate of the set of bathymetry samples to be used for analysis.
      • getBoundaryConstraints

        public List<PolygonConstraint> getBoundaryConstraints()
        Gets a list of constraints defining the boundary of the body of water to be analyzed.
        Returns:
        a valid, potentially empty list
      • getTimeToLoadData

        public long getTimeToLoadData()
        Gets the time required to load the input data
        Returns:
        a valid time in nanoseconds\
      • printSummary

        public void printSummary​(PrintStream ps)
        Print a summary of the input data.
        Parameters:
        ps - a valid print stream such as system output.
      • getLakeConstraints

        public List<PolygonConstraint> getLakeConstraints()
        Gets a list of those constraints which enclose the data area
        Returns:
        A valid, potentially empty list of polygon constraints oriented in anticlockwise order.
      • getIslandConstraints

        public List<PolygonConstraint> getIslandConstraints()
        Gets a list of those constraints which enclose island areas (non data areas)
        Returns:
        A valid, potentially empty list of polygon constraints oriented in clockwise order.
      • getSupplements

        public List<Vertex> getSupplements()
        Gets a list of supplementary samples.
        Returns:
        A valid, potentially list
      • getShapefilePrjContent

        public String getShapefilePrjContent()
        Gets the content of the PRJ file associated with the input. This value will be non-null only if the input comes from a Shapefile (rather than a CSV or text file) and a matching PRJ file is provided.
        Returns:
        if available, a valid String; otherwise, a null.
      • getBathymetryModel

        public SvmBathymetryModel getBathymetryModel()
        Gets the bathymetry defined for the soundings in this instances.
        Returns:
        a valid enumeration value.
      • setSurveyPerimeter

        public void setSurveyPerimeter​(List<Vertex> perimeterVertices)
        Provides a means for the model to attach the perimeter of the triangulation (its convex hull) to the data collection. Intended as a way of propagating the initial collection perimeter into other modules once the data is initially triangulated.
        Parameters:
        perimeterVertices - a valid list of vertices
      • getSurveyPerimeter

        public List<Vertex> getSurveyPerimeter()
        Gets the survey perimeter.
        Returns:
        if the perimeter is set, a valid list; otherwise, a null.