Provides access to members that control TIN surfaces.
Members
Name | Description | |
---|---|---|
Extract | Extract part of the TIN. | |
GetVolumeAndArea | Returns TIN's volume/area above or below an input z value. | |
InterpolateZ | Interpolate the z-coordinate of the specified location. | |
InterpolationMethod | The elevation interpolation method. | |
Intersect | Intersect with a reference TIN. | |
ProfileWeedTolerance | The profile weeding tolerance. | |
QueryLocate | Returns the first intersection of the query ray and the TIN. | |
QueryLocateWithinDistance | Returns the intersections of the query ray and the TIN. | |
QueryTriangleNormal | Returns the vector normal to the specified triangle. |
ITinSurface3.Extract Method
Extract part of the TIN.
Public Function Extract ( _
ByVal pBoundary As IPolygon, _
ByVal boundaryEdgeType As esriTinEdgeType, _
ByVal boundaryEdgeValue As Integer, _
ByVal bConstrainedDelaunay As Boolean, _
ByVal bAllowEdgeSwapping As Boolean _
) As ITin
public ITin Extract (
IPolygon pBoundary,
esriTinEdgeType boundaryEdgeType,
int boundaryEdgeValue,
bool bConstrainedDelaunay,
bool bAllowEdgeSwapping
);
Description
Extracts a subarea from the source TIN into a new TIN.
pBoundary is a polygon that defines the area to be extracted. This polygon will be profiled using linear interpolation on the source TIN. This profiled polygon, along with the data inside it from the source TIN, will then be used to construct the output TIN. If there's no overlap between the data area of the source TIN and the polygon the result will be NULL.
boundaryEdgeType is an esriTinEdgeType used to control whether the boundary polygon is enforced using hard, soft, or regular edges.
boundaryEdgeValue is the tag value associated with the boundary edges. Set this to 0 if you're not interested in using specific edge tag values.
bConstrainedDelaunay is used to control the type of output TIN when the input is delaunay conforming. In this case you have the option of keeping the result conforming or converting it to constrained. The benefit of having it constrained is you get a best fit match between input and output surface without the need to add densification points. The drawback is the natural neighbors interpolator can't be used on a constrained TIN. If the input is already constrained this property has no effect; the result will be constrained.
bAllowEdgeSwapping is used to control the quality of fit between the input and output surfaces when both are delaunay conforming. This means the input must be delaunay and bConstrainedDelaunay is set to FALSE. If these conditions are met, setting bAllowEdgeSwapping to FALSE will force a best fit match between the surfaces at the expense of the output having nodes added where necessary to enforce that match. Setting it to TRUE will permit some differences between the input and output surfaces. Relaxing the need for an exact match has the benefit of requiring less nodes be added to the output TIN.
Notes:
- The returned TIN will be in edit mode. Use ITinEdit.SaveAs or ITinAdvanced2.SaveAsVersion followed by ITinEdit.StopEditing (with the param for SaveEdits set to False) to save the TIN to disk.
- In the above descriptions, the 'match' between the input and output surface is used to describe how the surface geometry of the input and output surfaces compare. Generally, the 2D triangulation of the best fit surface is not identical to the input, but the 3D planar surface definition, as defined by the linearly interpolated value of Z at a given XY, is the same.
ITinSurface3.GetVolumeAndArea Method
Returns TIN's volume/area above or below an input z value.
Public Sub GetVolumeAndArea ( _
ByVal pAOI As IGeometry, _
ByVal referenceHeight As Double, _
ByVal Type As esriPlaneReferenceType, _
ByRef pbIsOutsideDataArea As Boolean, _
[ByRef pVolume As Object], _
[ByRef pSurfaceArea As Object], _
[ByRef pProjectedArea As Object] _
)
public void GetVolumeAndArea (
IGeometry pAOI,
double referenceHeight,
esriPlaneReferenceType Type,
ref bool pbIsOutsideDataArea,
ref object pVolume,
ref object pSurfaceArea,
ref object pProjectedArea
);
Description
Calculates volume, area, and surface area from the TIN. Volume is the cubic area between a reference plane and the TIN. The area values are based on the portions of the TIN which are above or below a reference plane. Surface area is measured along the slope of a surface and is therefore greater than the 2D, projected area.
pAOI is the area of interest. It can be NULL, an envelope, or a polygon. If it's NULL the calculation will be based on the entire data area of the TIN. For envelopes and polygons the calculation is constrained to be inside their extent.
referenceHeight is a double that indicates the height of a horizontal plane from which calculations will be based.
esriReferencePlaneType controls on which side of the reference plane the calculation is made. If you choose to calculate volume above the plane, the cubic area of consideration is that which is above the plane and the underside of the surface. If you choose below the plane the area of consideration is below the plane and the topside of the surface. If you choose to calculate one of the area properties the returned values will be based on the those portions of the TIN which are above or below the reference plane.
pTrackCancel is a reference to a CancelTracker to support progress reporting and the ability to halt the process. To bypass this feature pass a NULL pointer.
pblsOutsideDataArea is an output boolean that will be set to TRUE if pAOI falls outside the horizontal data extent of the TIN. If TRUE the resulting volume and area are really NoData even though they will be set to 0.0. Note, it's possible for those values to be 0.0 when pAOI is inside the TIN and these are valid results. This parameter is used to distinguish between the two cases.
pVolume, pSurfaceArea, and pProjectedArea are output results. These are optional. If you're not interested in one of these parameters don't specify it and time will not be spent in its calculation.
Notes:
The TIN must not be in edit mode when calling this method. An error will be returned if it is.
ITinSurface3.InterpolateZ Method
Interpolate the z-coordinate of the specified location.
Public Function InterpolateZ ( _
ByVal X As Double, _
ByVal Y As Double _
) As Double
public double InterpolateZ (
double X,
double Y
);
Description
Interpolates a height for the given XY. The method of interpolation used is defined by the ITinSurface3.InterpolationMethod property.
ITinSurface3.InterpolationMethod Property
The elevation interpolation method.
Public Property InterpolationMethod As esriSurfaceInterpolationType
public esriSurfaceInterpolationType InterpolationMethod {get; set;}
Description
The method of interpolation used to obtain heights for points, lines, and polygons. The default is linear. Applies to ITinSurface.GetProfile as well as members prefaced by 'Interpolate' in the ITinSurface, ITinSurface2, and ITinSurface3 interfaces.
The value of this property should be saved before, and reset after, calling any of the applicable interpolation functions.
ITinSurface3.Intersect Method
Intersect with a reference TIN.
Public Sub Intersect ( _
ByVal pReferenceSurface As ITinSurface, _
ByVal pAOI As IGeometry, _
ByVal pOutFeatureClass As IFeatureClass, _
ByVal volumeFieldName As String, _
ByVal surfaceAreaFieldName As String, _
ByVal codeFieldName As String _
)
public void Intersect (
ITinSurface pReferenceSurface,
IGeometry pAOI,
IFeatureClass pOutFeatureClass,
string volumeFieldName,
string surfaceAreaFieldName,
string codeFieldName
);
Description
Calculates the difference between two TINs. Outputs 2D polygons that divide space based on whether the source surface is above, coincident to, or below the reference surface. Boundaries of the polygons represent where the two surfaces intersect in 3D space. Each polygon is assigned a numeric code to indicate its relation: -1 is assigned to polygons where the source surface is below the reference surface, 0 to polygons where it's coincident, and 1 to polygons where it's above. Volume, area, and surface area are also calculated for each polygon. Volume represents the cubic space between the two surfaces. Area is the planimetric, or projected, area. Surface area takes slope into account and is that of the source surface.
pReferenceSurface is the other TIN being used to compare the source surface against. Above, coincident, and below assessments on the source surface are made relative to the reference surface.
pOutFeatureClass is where output features will be written. It needs to be a 2D polygon feature class.
volumeFieldName is the name of the field where volume is written. The field type should be a double.
surfaceAreaFieldName is the name of the field where surface area is written. The field type should be a double.
codeFieldName is the name of the field where the verical relation code is written.
Notes:Surfaces must have some overlap in XY extent.
While this method will add fields if they don't already exist it's best to add them first. This gives you the opportunity to place the feature class into LoadOnly mode (if not a shapefile) before calling the method. It's not recommended for anything to be adding fields while in LoadOnly mode.
Both TINs must not be in edit mode when calling this method.
ITinSurface3.ProfileWeedTolerance Property
The profile weeding tolerance.
Public Property ProfileWeedTolerance As Double
public double ProfileWeedTolerance {get; set;}
Description
The ProfileWeedTolerance is used as a 2D distance filter on the vertices of output polylines and polygons from methods that perform interpolation and profiling (e.g., InterpolateShape, GetProfile, GetLineOfSight). As a result, no two consecutive vertices along the paths of the resulting geometry will be closer than this distance.
Weeding is most applicable when using linear interpolation. This because the 'natural densification' used by linear interpolation, the insertion of vertices at triangle edge intersections, can result in very closely spaced vertices at certain locations.
If the intention of setting ProfileWeedTolerance is for temporary use, then be sure to save its current value before changing it and reset it back when finished.
To turn off weeding set ProfileWeedTolerance to 0.
ITinSurface3.QueryLocate Method
Returns the first intersection of the query ray and the TIN.
Public Sub QueryLocate ( _
ByVal pRay As IRay, _
ByVal hint As Integer, _
ByVal pLocation As IPoint _
)
public void QueryLocate (
IRay pRay,
int hint,
IPoint pLocation
);
Description
Returns the intersection point between a ray and the TIN.
pRay is the input 3D ray the calculation will be based on.
hint is the index of the triangle intersected by the ray. If you don't know the triangle provide a -1 for the hint. If you know which triangle is intersected then provide its index and the method will be faster, it won't need to search for it, and will simply intersect the ray with the plane of the specified triangle.
pLocation is the point of intersection. You must provide an instantiated point object. The method will populate its coordinates. If the ray does not intersect the TIN the point will be set empty. Check for this via IGeometry.IsEmpty.
Notes:
- Consider using this method or ITinSurface3.QueryLocateWithinDistance instead of other Locate methods when inside a loop, for the sake of efficiency, because it reuses the output object each iteration whereas other methods create new ones.
ITinSurface3.QueryLocateWithinDistance Method
Returns the intersections of the query ray and the TIN.
Public Sub QueryLocateWithinDistance ( _
ByVal pRay As IRay, _
ByVal maxDistance As Double, _
ByVal pLocations As IGeometry _
)
public void QueryLocateWithinDistance (
IRay pRay,
double maxDistance,
IGeometry pLocations
);
Description
Finds the points of intersection between a ray and the surface. Can return either the first point of intersection or all intersections. The search for intersections can also be constrained by distance.
pRay is the ray for which intersections will be calculated.
maxDistance is the 3D search distance along the ray that acts as a constraint. No intersections will be returned beyond this distance. Pass a negative value to turn the constraint off and search as far as possible (i.e., to the edge of the surface).
pLocations is either a point or multipoint. This must be instantiated before calling the method. Pass a point if you want only the first intersction. Use a multipoint to collect multiple intersections. If multiple intersections are found they will be placed in sorted order from first to last in the multipoint. If there is no intersection, either because the ray does not intersect the surface or doesn't intersect within the maxDistance, the output will be set to empty.
Notes:
- It's beneficial to use a distance limit, for the sake of performance, because the method will not need to search as far as possible, thus speeding up the calculation. Specify a maxDistance if it makes sense for the application.
- Consider using this method or ITinSurface3.QueryLocate instead of other Locate methods when inside a loop, for the sake of efficiency, because it reuses the output object each iteration whereas other methods create new ones.
ITinSurface3.QueryTriangleNormal Method
Returns the vector normal to the specified triangle.
Public Sub QueryTriangleNormal ( _
ByVal Triangle As Integer, _
ByVal pNormal As IVector3D _
)
public void QueryTriangleNormal (
int Triangle,
IVector3D pNormal
);
Description
Returns the surface normal for the specified triangle. This is a vector orthogonal to the plane of the triangle.
Triangle is the triangle index.
pNormal is a vector whose component properties are to be set. It must be instantiated before calling the method. The magnitude of the result is not normalized, it is relative to the size of the triangle. If you need it normalized call IVector3D.Normalize.
Classes that implement ITinSurface3
Classes | Description |
---|---|
Tin | The Esri TIN component. |