public class ContourBuilderForTin extends Object
Under development. Initial implementation is finished but additional access methods are required and substantial testing still remains.
Contour left-and-right index: The left and right index elements for the contours created by this class are set to the array index of the zContour array supplied to the constructor. For example, in the case of a zContour array that specified a single contour value, the right-index of the contours would be assigned the value 0 and the left-index would be assigned the value 1. The maximum possible left-index value is always the zContour.length. The minimum possible right-index value is always zero, except in the special case of perimeter contours. Perimeter contours are those that lie on the outer edges of the TIN and represent the boundary between "data and no-data". The right index value for perimeter contours is -1.
Tinfour defines contours as specifying a boundary between two regions in a plane. The region to the left of the contour is treated as including points with vertical coordinates greater than or equal to the contour's vertical coordinate. The values to the right are treated as including points with vertical coordinates less than the contour's vertical coordinate. Thus, in an elevation set, a hill would be represented with a set of closed-loop contours taken in counterclockwise order. A valley would be represented as a set of closed-loop contours taken in clockwise order.
Constructor and Description |
---|
ContourBuilderForTin(IIncrementalTin tin,
IVertexValuator vertexValuator,
double[] zContour,
boolean buildRegions)
Creates a set of contours at the specified vertical coordinates from the
Delaunay Triangulation.
|
Modifier and Type | Method and Description |
---|---|
List<Contour> |
getContours()
Gets a list of the contours that were constructed by this class.
|
double[] |
getEnvelope()
Gets the Cartesian coordinates of the convex hull of the triangulation
that was used to construct the contours for this instance.
|
List<ContourRegion> |
getRegions()
Gets a list of the contour regions (polygon features) that were built by
the constructor, if any.
|
void |
summarize(PrintStream ps,
double areaFactor)
Provides a summary of statistics and measurements for the contour building
process and resulting data.
|
public ContourBuilderForTin(IIncrementalTin tin, IVertexValuator vertexValuator, double[] zContour, boolean buildRegions)
The constructor for this class always builds a list of contours that is maintained internally. Contours are defined as line features. If you wish, you may set the buildRegions argument to true to connect the contours into closed polygons.
The vertex-valuator argument allows you to specify an alternate method for obtaining the vertical coordinates from the vertices in the triangulation. If you wish to use the values from the vertices directly (i.e. the z coordinates of the vertices), you may do so by supplying a null reference for the valuator argument. The primary intended use of the valuator is to support the use of a smoothing filter, though many other applications are feasible.
The values in the zContour array must be unique and monotonically increasing.
tin
- a valid TIN.vertexValuator
- an optional valuator or a null reference if the
default is to be used.zContour
- a value array of contour values.buildRegions
- indicates whether the builder should produce region
(polygon) structures in addition to contours.public List<Contour> getContours()
public List<ContourRegion> getRegions()
public double[] getEnvelope()
Coordinates are stored in an array of doubles in the order { (x0,y0), (x1,y1), (x2,y2), etc. }.
public void summarize(PrintStream ps, double areaFactor)
ps
- a valid PrintStream instance, such as System.out.areaFactor
- a unit-conversion factor for scaling area valuesCopyright © 2021. All rights reserved.