Class TinContainer
- All Implemented Interfaces:
Serializable,Cloneable
TinContainer class holds data and basic metadata for a
TIN (triangulated irregular network) as 2D vertices (pairs of
longitude/latitude or easting/northing coordinates) and the values
reported at those vertices. Each vertex also has a label, which may
be empty.
To retrieve X, Y, and value for vertex n from TinContainer tc:
X = tc.xCoords[n];
Y = tc.yCoords[n];
value = tc.value[n];
Each vertex has list of the other vertices it connects to via a
triangle edge. This is represented as an int array. No
other topological data is kept in this class. A vertex can be present
in the TIN data set, but disabled, i.e. not a part of any triangles.
In this case the vertex's connection array has only one member, with
a value of -1.
An object of this class does not know where its data came from (or is going). It does not contain any reference or connection to any database or file, but is used as an intermediate data structure for moving data to or from a database or for plot and tabulate functions.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class hec.io.DataContainer
DataContainer.VERTICAL_DATUM, DataContainer.VERTICAL_UNITS -
Field Summary
FieldsModifier and TypeFieldDescriptionint[][]Array of vertex indices that this vertex connects to via triangle edges in this TIN.static final intTIN vertex type is "DCP"static final intTIN vertex type is GRID_CELL_VERTEXString[]Array of vertex labelsdoubleMaximum value of data at the vertices, not including nulls or disabled pointsdoubledoubledoubleMean value of data at the vertices, not including nulls or disabled pointsdoubleMinimum value of data at the vertices, not including nulls or disabled pointsdoubleThe TIN bounds are expressed as {min X, min Y, max X, max Y}.doubleintNumber of vertices (including inactive ones) present in this TINstatic final intTIN vertex type is OBSERVER_GAGE_VERTEXint[]Array of vertex types as enumerated values.doubleUsed to weed out "skinny" triangles from TINGives a complete definition of the coordinate system for the TINShort name or label for coordinate systemintEnumerated value indicating the type of string used to define the coordinate system.Units for coordinate systemLabel for time zone applied to data valuesData type for values represented by TIN surface, e.g.Units for values represented by TIN surface, e.g.static final intSRS string type is unknowndouble[]Array of values at vertices.static final intSRS string type is ESRI variant of "Well Known Text"static final intSRS string type is OGC-type "Well Known Text"double[]Array of X coordinates.double[]Array of Y coordinates.Fields inherited from class hec.io.DataContainer
coordinateID, coordinateSystem, CURRENT_VERTICAL_DATUM_HEADER, CURRENT_VERTICAL_DATUM_KEY, dataType, fileLastWriteTimeMillis, fileName, fullName, horizontalDatum, horizontalUnits, lastWriteTimeMillis, location, locationTimezone, modified, otherInfo, storedAsdoubles, subVersion, supplementalInfo, version, VERTICAL_DATUM_INFO_HEADER, VERTICAL_DATUM_INFO_KEY, verticalDatum, verticalUnits, watershed, xOrdinate, yOrdinate, zOrdinate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclone(TinContainer tc) double[]ForcesupdateStatisticsaction ifminXCoordinate(or any of the other bounding coordinates) is equal toUNDEFINED_FLOAT.doubleForcesupdateStatisticsaction if statistics are undefined.doubleForcesupdateStatisticsaction if statistics are undefined.doubleForcesupdateStatisticsaction if statistics are undefined.booleangetTimeWindow(HecTime startTime, HecTime endTime) Gets the time window for the data, from thefullnameattribute inherited fromdataContainer.protected static StringpointToString(TinContainer c, int i) toString()voidComputesminValue, meanValue, maxValueand the bounds (minXCoordinateetc.) of the TIN.Methods inherited from class hec.io.DataContainer
clone, extractVerticalDatum, getFullName, getHorizontalDatum, getLatLong, getName, getStoreAsDoubles, getSupplementalInfo, getVerticalDatum, getVerticalUnits, insertVerticalDatum, setFullName, setHorizontalDatum, setLatLong, setName, setStoreAsDoubles, setSupplementalInfo, setVerticalDatum, setVerticalDatum, setVerticalUnits, setVerticalUnits
-
Field Details
-
SpatialReferenceSystem
Gives a complete definition of the coordinate system for the TIN -
SRSType
public int SRSTypeEnumerated value indicating the type of string used to define the coordinate system. -
UNKNOWN_SRS_DEFINITION_TYPE
public static final int UNKNOWN_SRS_DEFINITION_TYPESRS string type is unknown- See Also:
-
WKT_ESRI_SRS_DEFINITION_TYPE
public static final int WKT_ESRI_SRS_DEFINITION_TYPESRS string type is ESRI variant of "Well Known Text"- See Also:
-
WKT_OGC_SRS_DEFINITION_TYPE
public static final int WKT_OGC_SRS_DEFINITION_TYPESRS string type is OGC-type "Well Known Text"- See Also:
-
SRSName
Short name or label for coordinate system -
SRSUnits
Units for coordinate system -
units
Units for values represented by TIN surface, e.g. "mm" for precipitation -
type
Data type for values represented by TIN surface, e.g. "PER-CUM", "INST-VAL", etc. -
timeZoneName
Label for time zone applied to data values -
numberPoints
public int numberPointsNumber of vertices (including inactive ones) present in this TIN -
slendernessRatio
public double slendernessRatioUsed to weed out "skinny" triangles from TIN -
xCoordinate
public double[] xCoordinateArray of X coordinates. Vertex n's X coordinate isxCoordinate[n] -
yCoordinate
public double[] yCoordinateArray of Y coordinates. Vertex n's Y coordinate isyCoordinate[n] -
value
public double[] valueArray of values at vertices. Vertex n's value isxCoordinate[n] -
pointType
public int[] pointTypeArray of vertex types as enumerated values. -
DCP_VERTEX
public static final int DCP_VERTEXTIN vertex type is "DCP"- See Also:
-
OBSERVER_GAGE_VERTEX
public static final int OBSERVER_GAGE_VERTEXTIN vertex type is OBSERVER_GAGE_VERTEX- See Also:
-
GRID_CELL_VERTEX
public static final int GRID_CELL_VERTEXTIN vertex type is GRID_CELL_VERTEX- See Also:
-
connection
public int[][] connectionArray of vertex indices that this vertex connects to via triangle edges in this TIN. In a TIN composed of one triangle, vertices 0, 1, and 2 will connect as shown:
Array length of 1 (value = -1) for disabled vertices; i.e. if vertexconnection[0] = {1, 2}; connection[1] = {0, 2}; connection[2] = {0, 1};nis disabled,connection[n] = {-1}; -
label
Array of vertex labels -
minXCoordinate
public double minXCoordinateThe TIN bounds are expressed as {min X, min Y, max X, max Y}. -
minYCoordinate
public double minYCoordinate -
maxXCoordinate
public double maxXCoordinate -
maxYCoordinate
public double maxYCoordinate -
minValue
public double minValueMinimum value of data at the vertices, not including nulls or disabled points -
maxValue
public double maxValueMaximum value of data at the vertices, not including nulls or disabled points -
meanValue
public double meanValueMean value of data at the vertices, not including nulls or disabled points
-
-
Constructor Details
-
TinContainer
public TinContainer() -
TinContainer
public TinContainer(double[] xs, double[] ys, double[] vs)
-
-
Method Details
-
clone
-
getBounds
public double[] getBounds()ForcesupdateStatisticsaction ifminXCoordinate(or any of the other bounding coordinates) is equal toUNDEFINED_FLOAT.- Returns:
- -- Bounds array as
double[]{minimum X, minimum Y, maximum X, maximum Y}
-
getTimeWindow
Gets the time window for the data, from thefullnameattribute inherited fromdataContainer. Returns true if instantaneous, false if period value or undefined (check startTime to see if undefined)- Parameters:
startTime- -- anHecTimeobject to be set to the TIN's start timeendTime- -- anHecTimeobject to be set to the TIN's end time- Returns:
- -- True if the TIN is an
INST-type and the start time is defined False if the TIN is aPER-type or if the start time is undefined
-
getMaxValue
public double getMaxValue()ForcesupdateStatisticsaction if statistics are undefined.- Returns:
- --
maxVaue
-
getMinValue
public double getMinValue()ForcesupdateStatisticsaction if statistics are undefined.- Returns:
- --
minVaue
-
getMeanValue
public double getMeanValue()ForcesupdateStatisticsaction if statistics are undefined.- Returns:
- --
meanVaue
-
updateStatistics
public void updateStatistics()ComputesminValue, meanValue, maxValueand the bounds (minXCoordinateetc.) of the TIN.Locations of disabled points are included in the computation of the TIN bounds, but the values at disabled points are not included in min, mean, max computations.
-
pointToString
-
toString
- Overrides:
toStringin classDataContainer
-