Class PointClass

Namespace
ESRI.ArcGIS.Geometry
Assembly
ESRI.Server.Geometry.dll
[Guid("00A5CB41-52DA-11D0-A8F2-00608C85EDE5")]
[ClassInterface(ClassInterfaceType.None)]
public class PointClass : Point, IPoint, IMAware, IZAware, IPointIDAware, IGeometry5, IGeometry4, IGeometry3, IGeometry2, IGeometry, ITransform2D, ITransform3D, IConstructPoint2, IConstructPoint, IRelationalOperator2, IRelationalOperator, IProximityOperator, ITopologicalOperator, ITopologicalOperator6, IHitTest, IHitTest3D, ISupportErrorInfo, IPersistStream, IPersist, IClone, IXMLSerialize, IConversionNotation, IConversionMGRS, IMSnap, IProximityOperator3D, IRelationalOperator3D2, IRelationalOperator3D, IGeodeticMeasurement, IZ2, IZ, IZCollection
Inheritance
PointClass
Implements
Inherited Members

Constructors

PointClass()

public PointClass()

Explicit Interface Implementations

Assign(IClone)

Assigns the properties of src to the receiver.

virtual void Assign(IClone src)

Parameters

src IClone

Boundary

The boundary of this geometry. A polygon's boundary is a polyline. A polyline's boundary is a multipoint. A point or multipoint's boundary is an empty point or multipoint.

virtual IGeometry Boundary { get; }

Returns

IGeometry

Remarks

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

This method does not support GeometryBags.



 

Boundary Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

Buffer(double)

Constructs a polygon that is the locus of points at a distance less than or equal to a specified distance from this geometry.

virtual IGeometry Buffer(double distance)

Parameters

distance double

Returns

IGeometry

Remarks


The buffer distance is in the same units as the source shape that is being buffered.

A negative distance can be specified to produce a buffer inside the original polygon. This cannot be used with polyline.

ITopologicalOperator methods must be applied on top-level geometries only. Top-Level geometries are point, multipoint, polyline and polygon. To use this method with segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped with a top-level type.

A buffer distance of 0 will generate an empty polygon with the input geometry being a polyline and multipoint.  However, if the input geometry is a point, the output will be the original point.

Buffer Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods


[C#]//This example demonstrates how to use ITopologicalOperator::Buffer
private void BufferArea()
  {
  IPoint[] points = new IPoint[5];
  //The spatial reference should be set here using IGeometry::SpatialReference (Code skipped here)
  for(int i = 0; i < points.Length; i++)
  {
     points[i] = new PointClass();
  }
  points[0].PutCoords(0, 0);
  points[1].PutCoords(0, 10);
  points[2].PutCoords(10, 10);
  points[3].PutCoords(10, 0);
  points[4].PutCoords(0, 0);
  IPointCollection4 pointCollection = new PolygonClass();
  IGeometryBridge geometryBride = new GeometryEnvironmentClass();
  geometryBride.AddPoints(pointCollection, ref points);
  IArea area = pointCollection as IArea;
  System.Windows.Forms.MessageBox.Show("Area original polygon : " + area.Area);
  ITopologicalOperator topologicalOperator = pointCollection as ITopologicalOperator;
  //Outside buffer
  IPolygon polygon = topologicalOperator.Buffer(1) as IPolygon;
  area = polygon as IArea;
  System.Windows.Forms.MessageBox.Show( "Area polygon positive distance : " + area.Area);
  //Inside buffer
  polygon = topologicalOperator.Buffer(-1) as IPolygon;
  area = polygon as IArea;
  System.Windows.Forms.MessageBox.Show("Area polygon negative distance : " + area.Area);
}




























 

 

 

 

 

 

[Visual Basic .NET]

    Sub exampleITopologicalOperator_Buffer()
        Dim ptc As ESRI.ArcGIS.Geometry.IPointCollection, i As Long, pa As ESRI.ArcGIS.Geometry.IArea, ptopo As ESRI.ArcGIS.Geometry.ITopologicalOperator
        ptc = New ESRI.ArcGIS.Geometry.Polygon
        Dim pt(4) As ESRI.ArcGIS.Geometry.IPoint, poutPoly As ESRI.ArcGIS.Geometry.IPolygon
        'The spatial reference should be set here using IGeometry::SpatialReference (Code skipped here)
        For i = 0 To 4

pt(i) = New ESRI.ArcGIS.Geometry.Point
Next
pt(0).PutCoords(0, 0)
pt(1).PutCoords(0, 10)
pt(2).PutCoords(10, 10)
pt(3).PutCoords(10, 0)
pt(4).PutCoords(0, 0)
Dim geometryBride As ESRI.ArcGIS.Geometry.IGeometryBridge
geometryBride = New ESRI.ArcGIS.Geometry.GeometryEnvironmentClass()

geometryBride.AddPoints(ptc, pt)
pa = ptc
Debug.Print("Area original polygon : " & pa.Area)
ptopo = ptc
poutPoly = ptopo.Buffer(1) 'Outside buffer
pa = poutPoly
Debug.Print("Area polygon positive distance : " & pa.Area)
poutPoly = ptopo.Buffer(-1) 'Inside buffer
pa = poutPoly
Debug.Print("Area polygon negative distance : " & pa.Area)
End Sub

























 

CalculateGeodeticDistanceAndAzimuth(IPoint, esriGeodeticType, out double, out double, out double)

Calculates distance(in meters) and azimuths(in radians) on the Spheroid between this and otherPoint using given geodetic curve type.

virtual void CalculateGeodeticDistanceAndAzimuth(IPoint otherPoint, esriGeodeticType curveType, out double distanceMeters, out double azimuth12Radians, out double azimuth21Radians)

Parameters

otherPoint IPoint
curveType esriGeodeticType
distanceMeters double
azimuth12Radians double
azimuth21Radians double

CalculateNonSimpleZs()

virtual void CalculateNonSimpleZs()

CentroidEx

The center of gravity (centroid).

virtual IPoint CentroidEx { get; }

Returns

IPoint

Changed

Indicates if a geometry has been changed (edited, projected, etc).

virtual bool Changed { get; set; }

Returns

bool

Clip(IEnvelope)

Constructs the intersection of this geometry and the specified envelope.

virtual void Clip(IEnvelope clipperEnvelope)

Parameters

clipperEnvelope IEnvelope

Remarks

Use QueryClipped or QueryClippedDense methods to send the results to a different polygon.

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

ITopologicalOperator Clip Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

ClipDense(IEnvelope, double)

Constructs the intersection of this geometry and the specified envelope; densifies lines in output contributed by the clipping envelope.

virtual void ClipDense(IEnvelope clipperEnvelope, double denseDistance)

Parameters

clipperEnvelope IEnvelope
denseDistance double

Remarks

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

This method does not support GeometryBags.

Clone()

Clones the receiver and assigns the result to *clone.

virtual IClone Clone()

Returns

IClone

Compare(IPoint)

Compares X, Y, M, Z, ID of this point (in that order) with that of the other point. Returns -1 if this point's value is less, 1 if greater, and 0 otherwise. Useful for sorting a group of points.

virtual int Compare(IPoint otherPoint)

Parameters

otherPoint IPoint

Returns

int

Remarks

The method should not be used in order to determine equality of two points. Use IRelationalOperator::Equals or IClone::IsEqual. At 9.2, this method uses the resolution property of the point's spatial reference in order to determine (x,y) coordinate ordering. At 9.1, an untoleranced (exact) comparison was performed.

ConstrainAngle(double, IPoint, bool)

Projects this point to the point on the infinite line defined by anchor and angle (in radians). If allowOpposite is true, then the point can also snap to angle + pi radians.

virtual void ConstrainAngle(double constraintAngle, IPoint anchor, bool allowOpposite)

Parameters

constraintAngle double
anchor IPoint
allowOpposite bool

Remarks

ContrainAngle

[C#]

//Finds the closes point to line from (0,0) with angles

//defined by steps of pi/4 (Note all angles in radians)

private void ConstrainAngle()
{
  IPoint point = new PointClass();
  point.PutCoords(0, 0);



  IPoint newPoint = new PointClass();
  newPoint.PutCoords(1,0);


  for (int i = 0; i < 8; i++)
  {
    newPoint.ConstrainAngle(i * Math.PI / 4, point, true);


    System.Windows.Forms.MessageBox.Show(newPoint.X + ", " + newPoint.Y);
  }
}


[Visual Basic .NET]

    'Finds the closes point to line from (0,0) with angles
    'defined by steps of pi/4 (Note all angles in radians)
    '
    Sub TestConstrainAngle()
        Dim pApoint As ESRI.ArcGIS.Geometry.IPoint
        Dim pNpoint As ESRI.ArcGIS.Geometry.IPoint
        Dim pi As Double
        Dim dAngle As Double
        Dim i As Long







        pApoint = New ESRI.ArcGIS.Geometry.Point
        pi = 4 * Math.Atan(1)
        dAngle = 0
        pApoint.PutCoords(0, 0)


        pNpoint = New ESRI.ArcGIS.Geometry.Point

        For i = 0 To 7

pNpoint.PutCoords(1, 0)

dAngle = i * pi / 4

pNpoint.ConstrainAngle(dAngle, pApoint, True)

MsgBox("angle = " & i & "*pi/4" & vbCrLf & pNpoint.X & "," & pNpoint.Y)
Next i
End Sub






ConstrainDistance(double, IPoint)

Projects this point to the perimeter of the circle defined by radius and anchor.

virtual void ConstrainDistance(double constraintRadius, IPoint anchor)

Parameters

constraintRadius double
anchor IPoint

Remarks

ConstrainDistance

[C#]
private void ConstrainDistance()
{
  IPoint point = new PointClass();
  point.PutCoords(0, 0);
  IPoint newPoint = new PointClass();
  newPoint.PutCoords(2,2);
  newPoint.ConstrainDistance(Math.PI, point);
  System.Windows.Forms.MessageBox.Show(newPoint.X + ", " + newPoint.Y);
}
[Visual Basic .NET]

    Public Sub ConstrainDistanceTest()
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
        Dim pNPoint As ESRI.ArcGIS.Geometry.IPoint
        Dim dRadius As Double


        pPoint = New ESRI.ArcGIS.Geometry.Point
        pPoint.PutCoords(0, 0)

        pNPoint = New ESRI.ArcGIS.Geometry.Point
        pNPoint.PutCoords(2, 2)
        dRadius = 1.4142135623731

        pNPoint.ConstrainDistance(dRadius, pPoint)

        MsgBox("Radius = " & dRadius & " x,y = " & pNPoint.X & "," & pNPoint.Y)

    End Sub

ConstructAlong(ICurve, esriSegmentExtension, double, bool)

Constructs a point distance units along the input curve.

virtual void ConstructAlong(ICurve curve, esriSegmentExtension extension, double distance, bool asRatio)

Parameters

curve ICurve
extension esriSegmentExtension
distance double
asRatio bool

Remarks

If the Distance parameter is less than zero, or greater than the length of the curve (when asRatio is false), or greater than one (when asRatio is true), then the value of the Extension parameter is used to determine the coordinates of the constructed point.  In these cases, the point can be placed somewhere along an embedding geometry, or somewhere along a tangent geometry.

The embedding geometry of a straight line segment is a straight line extending infinitely in both directions.  The embedding geometry of a circular arc is a complete circle.  The embedding geometry of an elliptic arc is a complete ellipse.  A bezier curve has no embedding geometry.

A tangent geometry is always a ray (a straight line extending infinitely in one direction) tangent to the input curve at either its from (start) or to (end) points.

Possible values for the Extension parameter are: 
-------------------------------------------------

esriNoExtension                      The constructed point will always be on the input curve.  A distance < 0 will pin the constructed point to the location of the input curve's from point. A distance > the curve length (or > 1 when asRatio is true) will pin the location to the curve's to point.

esriExtendTangentAtFrom        If the distance parameter is < 0 then the point is constructed along a ray tangent to the start point of the curve, in a direction away from the curve.

esriExtendTangentAtTo            If the distance parameter is greater than the length of the input curve (or > 1 when asRatio is true), then the constructed point is placed along a ray tangent to the end point of the curve, in a direction away from the curve.

esriExtendEmbeddedAtFrom   Similar to the tangent option, but uses the embedding geometry instead of the tangent lines.

esriExtendEmbeddedAtTo        Similar to the tangent option, but uses the embedding geometry instead of the tangent lines.

esriExtendEmbedded               The point is constructed based on either the start or end points of the curve.

esriExtendTangents                  The point is tangential extended from the start or endpoint of the curve.

These values can be combined using the VB Or operator, or the C++ bitwise OR operator.

Example 1: 

esriExtendTangentAtFrom Or
esriExtendTangentAtTo

Instead of using

esriExtendTangents
 you could use
esriExtendTangentAtFrom Or
esriExtendTangentAtTo.
This would allow the point to be constructed anywhere along infinte straight lines, beginning from either the start or end of the curve, regardless of whether the distance parameter was less than 0, or greater than the length of the input curve (or > 1 when asRatio is true).


ConstructPoint ConstructAlong Example



[C#]

        //Select a polyline in ArcMap and calculate a point along the line
        // at 100 distance units from the start point.
        public void ConstructPointAlongLine(IPolyline pl)
        {

ICurve polyLine = pl;

IPoint point1 = ConstructPointAlong(100, polyLine, esriSegmentExtension.esriNoExtension, false);

System.Windows.Forms.MessageBox.Show("x,y = " + point1.X + "," + point1.Y);

IPoint point2 = ConstructPointAlong(0.5, polyLine, esriSegmentExtension.esriNoExtension, true);

System.Windows.Forms.MessageBox.Show("x,y = " + point2.X + "," + point2.Y);
}









        public IPoint ConstructPointAlong(double distance, ICurve curve, esriSegmentExtension extension, bool asRatio)
        {

IConstructPoint contructionPoint = new PointClass();

contructionPoint.ConstructAlong(curve, extension, distance, asRatio);

return contructionPoint as IPoint;
}






[Visual Basic .NET]

    '+++ Calculate a point along a polyline
    '+++ at 100 distance units from the start point.

    Public Sub t_ConstructAlong(ByRef pPolyLine As ESRI.ArcGIS.Geometry.IPolyline)
        On Error GoTo Errorhandler
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint

        Dim pCrv As ESRI.ArcGIS.Geometry.ICurve
        pCrv = pPolyLine
        pPoint = PtConstructAlong(100, pCrv, ESRI.ArcGIS.Geometry.esriSegmentExtension.esriNoExtension, False)
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)


        pPoint = PtConstructAlong(0.5, pPolyLine, ESRI.ArcGIS.Geometry.esriSegmentExtension.esriNoExtension, True) ' Midpoint
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)

        Exit Sub

Errorhandler:
        MsgBox(Err.Number & "..." & Err.Description)
        Exit Sub

    End Sub

    Public Function PtConstructAlong(ByVal dDist As Double, ByVal pCurve As ESRI.ArcGIS.Geometry.ICurve, ByVal extension As ESRI.ArcGIS.Geometry.esriSegmentExtension, ByVal asRatio As Boolean) As ESRI.ArcGIS.Geometry.IPoint
        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        pCPoint = New ESRI.ArcGIS.Geometry.Point

pCPoint.ConstructAlong(pCurve, extension, dDist, asRatio)
PtConstructAlong = pCPoint
End Function





ConstructAngleBisector(IPoint, IPoint, IPoint, double, bool)

Constructs a point on the bisector of the angle (from, through, to). When useAcuteAngle is false, the sign of distance will select a point right or left of (from, through, to). Otherwise, the sign of distance will select the acute/obtuse point.

virtual void ConstructAngleBisector(IPoint from, IPoint through, IPoint to, double distance, bool useAcuteAngle)

Parameters

from IPoint
through IPoint
to IPoint
distance double
useAcuteAngle bool

Remarks


The method uses a vector geometry to calculate the point. The Smaller Angle is the angle less than PI.

If From , To and Through points are all on a straight line , the point is calculated perpendicular (to the right) of the line.



Construct Angle Bisector

[C#]

        private void ConstructAngleBisector()
        {
            IPoint fromPoint = new PointClass();
            fromPoint.PutCoords(0, 0);
            IPoint throughPoint = new PointClass();
            throughPoint.PutCoords(10, 0);
            IPoint toPoint = new PointClass();
            toPoint.PutCoords(0, 10);
            IConstructPoint constructionPoint = new PointClass();
            constructionPoint.ConstructAngleBisector(fromPoint, throughPoint, toPoint, 10, true);
            IPoint outPutPoint = constructionPoint as IPoint;
            System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint.X + " , " + outPutPoint.Y);
        }












[Visual Basic .NET]

   Public Sub ConstructAngleBisector()
        Dim ptTr As ESRI.ArcGIS.Geometry.IPoint
        Dim ptTo As ESRI.ArcGIS.Geometry.IPoint
        Dim ptFrom As ESRI.ArcGIS.Geometry.IPoint
        Dim pConstructLine As ESRI.ArcGIS.Geometry.IConstructLine
        Dim pOutPutLine As ESRI.ArcGIS.Geometry.ILine
        Dim Pi As Double
        Pi = 4 * Math.Atan(1)
        ptTr = New ESRI.ArcGIS.Geometry.Point
        ptTo = New ESRI.ArcGIS.Geometry.Point
        ptFrom = New ESRI.ArcGIS.Geometry.Point
        pConstructLine = New ESRI.ArcGIS.Geometry.Line
        ptTr.PutCoords(0, 0)
        ptTo.PutCoords(0, 10)
        ptFrom.PutCoords(10, 0)
        pConstructLine.ConstructAngleBisector(ptFrom, ptTr, ptTo, 10, True)
        pOutPutLine = pConstructLine 'QI
        Debug.Print(pOutPutLine.Length)
        'Angle from the XAxis
        Debug.Print((180 * pOutPutLine.Angle) / Pi)
    End Sub




















ConstructAngleDistance(IPoint, double, double)

Constructs a point at a specified angle (in radians) from the horizontal axis and a specified distance away from the input point.

virtual void ConstructAngleDistance(IPoint p, double inAngle, double distance)

Parameters

p IPoint
inAngle double
distance double

Remarks

Angle in radians and distance in map units. The angle is measured counter-clockwise from the horizontal line and can be negative. If the distance is negative then the opposite direction is assumed (same as angle + PI). 

[C#]

        // select a point in ArcMap and calculate a new point with the
        // angle of 45 degrees and distance on 250 map units.
        public void ConstructAngleDistance()
        {
            IMxDocument mxDocument = m_application.Document as IMxDocument;
            IMap map = mxDocument.FocusMap;
            ISelection featureSelection = map.FeatureSelection;
            IEnumFeature featureEnumerator = featureSelection as IEnumFeature;
            featureEnumerator.Reset();
            IFeature currentFeature = featureEnumerator.Next();
            double distance = 250;
            double angle = 45;
            while (currentFeature != null)
            {
                if (currentFeature.Shape.GeometryType == esriGeometryType.esriGeometryPoint)
                {
                    IPoint startPoint = currentFeature.Shape as IPoint;
                    System.Windows.Forms.MessageBox.Show("Start Point: " + startPoint.X + ", " + startPoint.Y + "\n" +
                               "Angle: " + angle + "\n" + "Distance: " + distance);
                    IPoint point = _ConstructAngleDistance(startPoint, angle, distance);
                    System.Windows.Forms.MessageBox.Show("x,y = " + point.X + "," + point.Y);



















                }
                currentFeature = featureEnumerator.Next();
            }
        }


        private IPoint _ConstructAngleDistance(IPoint point, double angle, double distance)
        {
            //Convert the angle degrees to radians
            double angleRad = angle * 2 * Math.PI / 360;
            IConstructPoint construcionPoint = new PointClass();
            construcionPoint.ConstructAngleDistance(point, angleRad, distance);
            return construcionPoint as IPoint;
        }







[Visual Basic .NET]

    '+++ select a point in ArcMap and calculate a new point with the
    '+++ angle of 45 degrees and distance on 100 map units.

    Public Sub t_ConstructAngleDistance(ByRef pMXDoc As ESRI.ArcGIS.ArcMapUI.IMxDocument)
        On Error GoTo Errorhandler
        Dim pEnumFeat As ESRI.ArcGIS.Geodatabase.IEnumFeature
        Dim pFeature As ESRI.ArcGIS.Geodatabase.IFeature
        Dim pSelection As ESRI.ArcGIS.Carto.ISelection
        Dim pMap As ESRI.ArcGIS.Carto.IMap
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
        Dim pStart As ESRI.ArcGIS.Geometry.IPoint
        Dim dDist As Long
        Dim dAngle As Long








        pMap = pMXDoc.FocusMap

        pSelection = pMap.FeatureSelection
        pEnumFeat = pSelection

        pEnumFeat.Reset()
        pFeature = pEnumFeat.Next

        dDist = 250
        dAngle = 45

        While Not pFeature Is Nothing
            If pFeature.Shape.GeometryType = ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint Then
                pStart = pFeature.Shape
                Debug.Print(1, "Start Point:" & pStart.X & "," & pStart.Y & vbCrLf & _
                   "Angle:" & dAngle & vbCrLf & "Distance:" & dDist)



                pPoint = PtConstructAngleDistance(pStart, dAngle, dDist)
                Debug.Print(1, "x,y = " & pPoint.X & "," & pPoint.Y & vbCrLf)

            End If
            pFeature = pEnumFeat.Next
        End While
        Exit Sub


Errorhandler:
        MsgBox(Err.Number & "..." & Err.Description)
        Exit Sub

    End Sub

    Public Function PtConstructAngleDistance(ByVal pPoint As ESRI.ArcGIS.Geometry.IPoint, ByVal dAngle As Long, ByVal dDist As Long) As ESRI.ArcGIS.Geometry.IPoint
        Const PI = 3.14159265358979
        Dim dAngleRad As Double
        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        pCPoint = New ESRI.ArcGIS.Geometry.Point



        dAngleRad = dAngle * 2 * PI / 360 'Convert the angle degrees to radians

        pCPoint.ConstructAngleDistance(pPoint, dAngleRad, dDist)
        PtConstructAngleDistance = pCPoint
    End Function


ConstructAngleIntersection(IPoint, double, IPoint, double)

Constructs the point of intersection between two lines defined by the input points and angles (in radians).

virtual void ConstructAngleIntersection(IPoint p1, double angle1, IPoint p2, double angle2)

Parameters

p1 IPoint
angle1 double
p2 IPoint
angle2 double

Remarks


Angles are specified as geometric angles measured counterclockwise from the positive x axis of the Cartesian coordinate system. All angles are specified in radians .

ConstructAngleIntersection Example


[C#]

        //This method constructs a new point as intersection of 2 lines
        public void ConstructAngleIntersection()
        {
            IPoint fromPoint = new PointClass();
            fromPoint.PutCoords(0, 0);
            IPoint toPoint = new PointClass();
            toPoint.PutCoords(100, 0);
            double angle1Rad = 45 * 2 * Math.PI / 360;
            double angle2Rad = 135 * 2 * Math.PI / 360;
            IConstructPoint constructionPoint = new PointClass();
            constructionPoint.ConstructAngleIntersection(fromPoint, angle1Rad, toPoint, angle2Rad);
            IPoint outPutPoint = constructionPoint as IPoint;
            System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint.X + " , " + outPutPoint.Y);
        }













[Visual Basic .NET]

    '+++ Construct a new point as intersection of 2 lines

    Public Sub t_ConstructAngleIntersection()
        On Error GoTo Errorhandler
        Dim pPoint1 As ESRI.ArcGIS.Geometry.IPoint
        Dim pPoint2 As ESRI.ArcGIS.Geometry.IPoint
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
        Dim dAngle1 As Long
        Dim dAngle2 As Long





        pPoint1 = New ESRI.ArcGIS.Geometry.Point
        pPoint2 = New ESRI.ArcGIS.Geometry.Point

        pPoint1.PutCoords(0, 0)
        pPoint2.PutCoords(100, 0)

        dAngle1 = 45
        dAngle2 = 135

        pPoint = ptConstructAngleIntersection(pPoint1, dAngle1, pPoint2, dAngle2)
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)
        Exit Sub

Errorhandler:
        MsgBox(Err.Number & "..." & Err.Description)
        Exit Sub

    End Sub

    Public Function ptConstructAngleIntersection(ByVal pPt1 As ESRI.ArcGIS.Geometry.IPoint, ByVal dAngle1 As Long, ByVal pPt2 As ESRI.ArcGIS.Geometry.IPoint, ByVal dAngle2 As Long) As ESRI.ArcGIS.Geometry.IPoint
        Const PI As Double = 3.14159265358979
        Dim dAngleRad1 As Double
        Dim dAngleRad2 As Double


        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        pCPoint = New ESRI.ArcGIS.Geometry.Point

        dAngleRad1 = dAngle1 * 2 * PI / 360 ' Conversion degrees to radians
        dAngleRad2 = dAngle2 * 2 * PI / 360

        pCPoint.ConstructAngleIntersection(pPt1, dAngleRad1, pPt2, dAngleRad2)
        ptConstructAngleIntersection = pCPoint
    End Function


ConstructAverage(IPointCollection, esriGeometryAttributes)

Constructs the geometric average of the input point collection. Optionally uses the specified attribute as a source of weights on the locations of the points.

virtual void ConstructAverage(IPointCollection Points, esriGeometryAttributes attributeType)

Parameters

Points IPointCollection
attributeType esriGeometryAttributes

Remarks

If attributeType is esriAttributeNone then the average point location is computed; otherwise the attribute specified by attributeType serves as a weight. Points whose weight attribute is NaN are ignored (a weight of 0 has a similar affect). The resulting point will have the (weighted) average for all their attributes. However this does not apply to ID's; no average is calculated for them in any case; but thay can be used as weight.

Only the following attributeType values are permitted: esriAttributeNone, esriAttributeZ, esriAttributeM, esriAttributeID.

[C#]

//This example demonstrates how to use the ConstructAverage method
private void ConstructAverage_Example()
{
    IPointCollection4 pointCollection = new MultipointClass();
    object Missing = Type.Missing;
    //Create a MAware and a ZAware multipoint
    IPoint[] points = new IPoint[4];
    for(int i = 0; i < 4; i++)
    {
        points[i]= new PointClass();
    }
    points[0].PutCoords(0, 0);
    points[0].Z = 10;
    points[0].M = 10;
    points[1].PutCoords(0, 5);
    points[1].Z = 10;
    points[1].M = 10;
    points[2].PutCoords(5, 5);
    points[2].Z = 20;
    points[2].M = 20;
    points[3].PutCoords(5, 0);
    points[3].Z = 10;
    points[3].M = 20;
    IGeometryBridge geomBridge = new GeometryEnvironmentClass();
    geomBridge.AddPoints(pointCollection, ref points);
    IZAware zAwareCollection = pointCollection as IZAware;
    zAwareCollection.ZAware = true;
    IMAware mAwareCollection = pointCollection as IMAware;
    mAwareCollection.MAware = true;
    IConstructPoint2 constructionPoint = new PointClass();
    //Construct the average point with esriAttributeM
    constructionPoint.ConstructAverage(pointCollection, esriGeometryAttributes.esriAttributeM);
    IPoint outPutPoint1 = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("Output point with esriAttributeM: " + outPutPoint1.X + " , " + outPutPoint1.Y + " , " + outPutPoint1.M);
    //Construct the average point with esriAttributeZ
    constructionPoint.ConstructAverage(pointCollection, esriGeometryAttributes.esriAttributeZ);
    IPoint outPutPoint2 = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("Output point with esriAttributeZ: " + outPutPoint2.X + " , " + outPutPoint2.Y + " , " + outPutPoint2.Z);
}






































[Visual Basic .NET]

    'This example demonstrates how to use the ConstructAverage method
    Sub ConstructAverage_Example()
        Dim pPoints(0 To 3) As IPoint, pPointcol As IPointCollection4
        Dim pZawareCol As IZAware, pMawareCol As IMAware
        Dim pPoint As IPoint, pconstpoint2 As IConstructPoint2
        'Create a MAware and a ZAware multipoint
        pPoints(0) = New Point
        pPoints(1) = New Point
        pPoints(2) = New Point
        pPoints(3) = New Point
        pPoints(0).PutCoords(0, 0)
        pPoints(1).PutCoords(0, 5)
        pPoints(2).PutCoords(5, 5)
        pPoints(3).PutCoords(5, 0)
        pPoints(0).Z = 10
        pPoints(1).Z = 10
        pPoints(2).Z = 20
        pPoints(3).Z = 10
        pPoints(0).M = 10
        pPoints(1).M = 10
        pPoints(2).M = 20
        pPoints(3).M = 10
        pPointcol = New Multipoint
        Dim pGeometryBridge As IGeometryBridge
        pGeometryBridge = New GeometryEnvironment
        pGeometryBridge.AddPoints(pPointcol, pPoints)
        pZawareCol = pPointcol
        pZawareCol.ZAware = True
        pMawareCol = pPointcol
        pMawareCol.MAware = True
        pconstpoint2 = New Point
        '** Construct the average point with esriAttributeM
        pconstpoint2.ConstructAverage(pPointcol, esriGeometryAttributes.esriAttributeM)
        pPoint = pconstpoint2
        Debug.Print("***** esriAttributeM *****")
        Debug.Print(pPoint.X & " , " & pPoint.Y & " , " & pPoint.M)
        '** Construct the average point with esriAttributeZ
        pconstpoint2 = New Point
        pconstpoint2.ConstructAverage(pPointcol, esriGeometryAttributes.esriAttributeZ)
        pPoint = pconstpoint2
        Debug.Print("***** esriAttributeZ *****")
        Debug.Print(pPoint.X & " , " & pPoint.Y & " , " & pPoint.Z)
    End Sub









































ConstructDeflection(ILine, double, double)

Constructs a point in the polar coordinate system defined by baseLine and its 'from' point. The angle is in radians.

virtual void ConstructDeflection(ILine baseLine, double distance, double inAngle)

Parameters

baseLine ILine
distance double
inAngle double

Remarks

The point is constructed from the baseline start point using the deflection angle (the angle from the baseline to the point) and the distance. The deflection angle is given in radians the distance in map units. When distance is > 0, a positive value for angle rotates the constructed point counter-clockwise about the start point of baseline, and a negative value for angle rotates it the other way. Vice versa when distance is < 0.
ConstructDeflection Example
[C#]

//Constructs a point from the baseline from (0,0) to (1,1)
// with the deflection angle of 45 degrees (PI/4 radians).

public void ConstructDeflection()
{
    IPoint fromPoint = new PointClass();
    fromPoint.PutCoords(0, 0);
    IPoint toPoint = new PointClass();
    toPoint.PutCoords(1, 1);
    ILine line = new LineClass();
    line.PutCoords(fromPoint, toPoint);
    double distance = 1.4142135623731;
    double angle = Math.PI / 4;
    IConstructPoint constructionPoint = new PointClass();
    constructionPoint.ConstructDeflection(line, distance, angle);
    IPoint point = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("x,y = " + point.X + ", " + point.Y);
}













[Visual Basic .NET]

    '+++ Constructs a point from the baseline from (0,0) to (1,1)
    '+++ with the deflection angle of 45 degrees (PI/4 radians).
    Public Sub t_ConstructDeflection()
        On Error GoTo Errorhandler
        Dim pPointFrom As IPoint
        Dim pPointTo As IPoint
        Dim pLine As ILine
        Dim pPoint As IPoint
        Dim pCPoint As IConstructPoint
        Dim dDist As Double
        Dim dAngle As Double
        Dim pi As Double










        pPointFrom = New Point
        pPointTo = New Point
        pCPoint = New Point
        pPoint = New Point
        pLine = New Line



        pPointFrom.PutCoords(0, 0)
        pPointTo.PutCoords(1, 1)
        pLine.PutCoords(pPointFrom, pPointTo)

        dDist = 1.4142135623731
        pi = 4 * Math.Atan(1)
        dAngle = pi / 4
        pCPoint.ConstructDeflection(pLine, dDist, dAngle)
        pPoint = pCPoint
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)
        Exit Sub





Errorhandler:
        MsgBox(Err.Number & "..." & Err.Description)
        Exit Sub
    End Sub


ConstructDeflectionIntersection(ILine, double, double, bool)

Constructs the point of intersection of two rays with origins at the endpoints of the base line and the specified angles (in radians). If onRightSide is true, this work will be done to the right of the base line, otherwise to the left.

virtual void ConstructDeflectionIntersection(ILine baseLine, double startAngle, double endAngle, bool OnRightSide)

Parameters

baseLine ILine
startAngle double
endAngle double
OnRightSide bool

Remarks


the bRightSide flag can be used to always force the constructed point to be on the right side of the baseline.

The startAngle is the angle (in radians) from the baseline's startpoint of the line to the constructed point. The endAngle is the angle (in radians) from the baseline's endpoint to the constructed point.

Both angles have to be > 0 and < 2 PI radians. Their sum must also be less than PI radians.

ConstructDeflectionIntersection Example






[C#]
//Constructs a point from the baseline from (0,0) to (1,1)
//with the deflection angle of 45 degrees (PI/4 radians).
public void ConstructDeflectionIntersection()
{
  IPoint fromPoint = new PointClass();
  fromPoint.PutCoords(0, 0);
  IPoint toPoint = new PointClass();
  toPoint.PutCoords(1, 1);
  ILine line = new LineClass();
  line.PutCoords(fromPoint, toPoint);
  double startAngle = Math.PI / 4;
  double endAngle = Math.PI / 4;
  IConstructPoint constructionPoint = new PointClass();
  constructionPoint.ConstructDeflectionIntersection(line, startAngle, endAngle, false);
  IPoint point = constructionPoint as IPoint;
  System.Windows.Forms.MessageBox.Show("x,y = " + point.X + ", " + point.Y);

}
[Visual Basic .NET]

    '+++ Constructs a point as the intersection of 2 lines with angles
    '+++ dStartAngle (from the startpoint of the line) and dEndAngle.
    '+++ The flag to force the line to the right side is turned off.

    Public Sub t_ConstructDeflectionIntersection()
        Dim pPointFrom As ESRI.ArcGIS.Geometry.IPoint
        Dim pPointTo As ESRI.ArcGIS.Geometry.IPoint
        Dim pLine As ESRI.ArcGIS.Geometry.ILine
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        Dim dStartAngle As Double
        Dim dEndAngle As Double
        Dim pi As Double







        pPointFrom = New ESRI.ArcGIS.Geometry.Point
        pPointTo = New ESRI.ArcGIS.Geometry.Point
        pCPoint = New ESRI.ArcGIS.Geometry.Point
        pPoint = New ESRI.ArcGIS.Geometry.Point
        pLine = New ESRI.ArcGIS.Geometry.Line



        pPointFrom.PutCoords(0, 0)
        pPointTo.PutCoords(1, 0)

pLine.PutCoords(pPointFrom, pPointTo)

        pi = 4 * Math.Atan(1)
        dStartAngle = pi / 4
        dEndAngle = pi / 4

        pCPoint.ConstructDeflectionIntersection(pLine, dStartAngle, dEndAngle, False)
        pPoint = pCPoint
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)

    End Sub

ConstructOffset(ICurve, esriSegmentExtension, double, bool, double)

Constructs a point distance units along the input curve and offset units perpendicularly away from it.

virtual void ConstructOffset(ICurve curve, esriSegmentExtension extension, double distance, bool asRatio, double Offset)

Parameters

curve ICurve
extension esriSegmentExtension
distance double
asRatio bool
Offset double

Remarks

A positive Offset distance will create a point on the right side of the curve and a negative offset will create a point on the left side of the curve.

ConstructPoint ConstructOffset Example

Set the asRatio flag to be True if you want the distance to be a ratio of the curve length. If set to True, then a distance of 0.5 will be equal to half of the curve length (i.e. 50%).






[C#]

//This example demonstrates how to use IConstructPoint.ConstructOffset method
private void ConstructOffset()
{
    IPoint[] points = new IPoint[4];
    for (int i = 0; i < 4; i++)
    {
        points[i] = new PointClass();
    }
    points[0].PutCoords(0, 0);
    points[1].PutCoords(10, 0);
    points[2].PutCoords(20, 0);
    points[3].PutCoords(30, 0);
    IPointCollection polyline = new Polyline();
    //helper class to solve C-Style Array usage in COM classes
    IGeometryBridge geometryBride = new GeometryEnvironmentClass();
    geometryBride.AddPoints(polyline as IPointCollection4, ref points);














    IConstructPoint constructionPoint = new PointClass();
    //The spatial reference should be set on the new point here (Code skipped)

    //Example 1: Distance No ratio, Positive offset
    constructionPoint.ConstructOffset(polyline as ICurve, esriSegmentExtension.esriNoExtension, 15, false, 5);
    IPoint outPutPoint1 = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint1.X + " , " + outPutPoint1.Y);
    //Output point : 15 , -5 
    //*********************************************
    //Example 2: Distance as ratio, Positive offset
    constructionPoint.ConstructOffset(polyline as ICurve, esriSegmentExtension.esriNoExtension, 0.5, true, 5);
    IPoint outPutPoint2 = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint2.X + " , " + outPutPoint2.Y);
    //Output point : 15 , -5 
    //*********************************************
    //Example 3: Distance No ratio, Negative offset
    constructionPoint.ConstructOffset(polyline as ICurve, esriSegmentExtension.esriNoExtension, 15, false, -5);
    IPoint outPutPoint3 = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint3.X + " , " + outPutPoint3.Y);
    //Output point : 15 , 5
}
















[Visual Basic .NET]

   'This example demonstrates how to use IConstructPoint::ConstructOffset
    Sub ConstructOffset()
        Dim ptc As IPointCollection, pt(3) As IPoint, i As Long
        Dim pconsPoint As IConstructPoint, ptout As IPoint
        ptc = New Polyline
        'The spatial reference should be set on the polyline here (Code skipped)
        For i = 0 To 3
            pt(i) = New Point
        Next
        pt(0).PutCoords(0, 0)
        pt(1).PutCoords(10, 0)
        pt(2).PutCoords(20, 0)
        pt(3).PutCoords(30, 0)
        ptc.AddPoints(4, pt(0))
        'The spatial reference should be set on the new point here (Code skipped)
        '*********************************************
        'Example 1: Distance No ratio, Positive offset
        pconsPoint = New Point
        pconsPoint.ConstructOffset(ptc, esriSegmentExtension.esriNoExtension, 15, False, 5)
        ptout = pconsPoint
        Debug.Print("Output point : " & ptout.X & " , " & ptout.Y)
        'Output point : 15 , -5
        '*********************************************
        'Example 2: Distance as ratio, Positive offset
        pconsPoint = New Point
        pconsPoint.ConstructOffset(ptc, esriSegmentExtension.esriNoExtension, 0.5, True, 5)
        ptout = pconsPoint
        Debug.Print("Output point : " & ptout.X & " , " & ptout.Y)
        'Output point : 15 , -5
        '*********************************************
        'Example 3: Distance No ratio, Negative offset
        pconsPoint = New Point
        pconsPoint.ConstructOffset(ptc, esriSegmentExtension.esriNoExtension, 15, False, -5)
        ptout = pconsPoint
        Debug.Print("Output point : " & ptout.X & " , " & ptout.Y)
        'Output point : 15 , 5
    End Sub



































ConstructParallel(ISegment, esriSegmentExtension, IPoint, double)

Constructs a point distance units from start, parallel to the tangent at the point nearest to start on the (extended) segment.

virtual void ConstructParallel(ISegment Segment, esriSegmentExtension extension, IPoint start, double distance)

Parameters

Segment ISegment
extension esriSegmentExtension
start IPoint
distance double

Remarks

 

ConstructPoint ConstructParallel Example

[C#]

//The example shows how to construct a point parallel to the first segment
//of a selected polyline. Use ArcMap and the Object Editor to select the
//polyline.
public void ConstructPointParallelToLine(IMxDocument mxDocument)
{



    IMap map = mxDocument.FocusMap;
    IEnumFeature selectedFeatures = map.FeatureSelection as IEnumFeature;
    selectedFeatures.Reset();
    IFeature currentFeature = selectedFeatures.Next();
    IConstructPoint constructionPoint = new PointClass();
    while (currentFeature != null)
    {
        if (currentFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolyline)
        {
            IGeometryCollection geometryCollection = currentFeature.Shape as IGeometryCollection;
            ISegmentCollection segmentCollection = geometryCollection.get_Geometry(0) as ISegmentCollection;
            ISegment segment = segmentCollection.get_Segment(0);
            IPoint fromPoint = new PointClass();
            segment.QueryFromPoint(fromPoint);
            //add 10 to the x coordinate in order to get a diffrent point for this example
            fromPoint.X = fromPoint.X + 10;














            constructionPoint.ConstructParallel(segment, esriSegmentExtension.esriNoExtension, fromPoint, segment.Length / 2);
            IPoint outPutPoint = constructionPoint as IPoint;
            System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint.X + " , " + outPutPoint.Y);
        }
        currentFeature = selectedFeatures.Next();
    }
}





[Visual Basic .NET]

    ' The example shows how to construct a point parallel to the first segment
    ' of a selected polyline. Use ArcMap and the Object Editor to select the
    ' polyline.

    Public Sub t_constructParallel(ByVal pApp As ESRI.ArcGIS.Framework.IApplication)
        Dim pID As New ESRI.ArcGIS.esriSystem.UID
        pID = "esriEditor.editor"
        Dim pEditor As ESRI.ArcGIS.Editor.IEditor
        pEditor = pApp.FindExtensionByCLSID(pID)



        If pEditor.SelectionCount > 1 Then
            MsgBox("select one polyline")
            Exit Sub
        End If


        Dim pEnumFeat As ESRI.ArcGIS.Geodatabase.IEnumFeature
        Dim pFeature As ESRI.ArcGIS.Geodatabase.IFeature
        Dim i As Long

        pEnumFeat = pEditor.EditSelection

        Dim pSeg As ESRI.ArcGIS.Geometry.ISegment
        Dim pGeoColl As ESRI.ArcGIS.Geometry.IGeometryCollection
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
        pPoint = New ESRI.ArcGIS.Geometry.Point
        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        pCPoint = New ESRI.ArcGIS.Geometry.Point
        Dim pThroughPoint As ESRI.ArcGIS.Geometry.IPoint
        pThroughPoint = New ESRI.ArcGIS.Geometry.Point






        pFeature = pEnumFeat.Next

        While Not pFeature Is Nothing
            If pFeature.Shape.GeometryType = ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline Then
                pGeoColl = pFeature.Shape
                Dim pSegColl As ESRI.ArcGIS.Geometry.ISegmentCollection
                pSegColl = pGeoColl.Geometry(0)
                pSeg = pSegColl.Segment(0)
                pSeg.QueryFromPoint(pThroughPoint)
                pThroughPoint.X = pThroughPoint.X + 10






                pCPoint.ConstructParallel(pSeg, ESRI.ArcGIS.Geometry.esriSegmentExtension.esriNoExtension, pThroughPoint, pSeg.Length / 2)
                pPoint = pCPoint
                MsgBox(pPoint.X & "," & pPoint.Y)
            End If
            pFeature = pEnumFeat.Next
        End While
    End Sub






ConstructPerpendicular(ISegment, esriSegmentExtension, IPoint, double, bool)

Constructs a point 'distance' units from p and lying along the line normal to base and passing through p.

virtual void ConstructPerpendicular(ISegment @base, esriSegmentExtension extension, IPoint p, double distance, bool bUseLineOrientation)

Parameters

base ISegment
extension esriSegmentExtension
p IPoint
distance double
bUseLineOrientation bool

Remarks

 

ConstructPoint ConstructPerpendicular Example

ConstructThreePointResection(IPoint, double, IPoint, double, IPoint, out double)

Constructs the point of observation from which two signed angles between three points were measured; returns an angle which can help establish the confidence of the observation location: A small angle indicates greater uncertainty in the location.

virtual void ConstructThreePointResection(IPoint point1, double angleP1P2, IPoint point2, double angleP2P3, IPoint point3, out double arcAngle)

Parameters

point1 IPoint
angleP1P2 double
point2 IPoint
angleP2P3 double
point3 IPoint
arcAngle double

Remarks

Given three points and two angles measured from the constructed point.



Note that there is no unique solution if all three points are on the same circle.



[Visual Basic .NET]

Private Shared Sub t_ConstructThreePointResection()

     On Error GoTo Errorhandler

     Dim pPoint As IPoint

     Dim pCPoint As IConstructPoint

     Dim pPoint1 As IPoint

     Dim pPoint2 As IPoint

     Dim pPoint3 As IPoint

     Dim dAngle1 As Double

     Dim dAngle2 As Double

 

     pCPoint = New Point

     pPoint = New Point

     pPoint1 = New Point

     pPoint2 = New Point

     pPoint3 = New Point

 

     pPoint1.PutCoords(0, 1)

     pPoint2.PutCoords(2, 2)

     pPoint3.PutCoords(1, 0)

 

     dAngle1 = Math.PI / 4

     dAngle2 = Math.PI / 4

 

     pCPoint.ConstructThreePointResection(pPoint1, dAngle1, pPoint2, dAngle2, pPoint3, Math.PI / 2)

     pPoint = pCPoint

 

     MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)

     Exit Sub

Errorhandler:

     MsgBox(Err.Number & "..." & Err.Description)

     Exit Sub

End Sub

ConstructUnion(IEnumGeometry)

Defines this geometry to be the union of the inputs. More efficient for unioning multiple geometries than calling Union repeatedly.

virtual void ConstructUnion(IEnumGeometry geometries)

Parameters

geometries IEnumGeometry

Remarks

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

This method does not support GeometryBags.

Temproray files might be created.  If environment variable "ARCTMPDIR" exists, then the files are written to the path, otherwise written to current directory or system temp directory.

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

ConstructUnionEx(IEnumGeometry, bool)

Defines this geometry to be the union of the inputs, with the option for non-planary result.

virtual void ConstructUnionEx(IEnumGeometry pEnum, bool bNonPlanar)

Parameters

pEnum IEnumGeometry
bNonPlanar bool

Contains(IGeometry)

Indicates if this geometry contains the other geometry.

virtual bool Contains(IGeometry other)

Parameters

other IGeometry

Returns

bool

Remarks

Only geometries that support the IRelationalOperator interface can be used as input geometries.

If geometry1 Contains geometry2, then geometry2 is Within geometry1.

An empty geometry does not contain another geometry.  On the other hand, an empty geometry is contained in another geometry, unless the other geometry is empty.

Contains examples. Only "true" relationships are showed in this picture.

ContainsEx(IGeometry, esriSpatialRelationExEnum)

Indicates if this geometry contains the other geometry, optionally using Celementini's definition.

virtual bool ContainsEx(IGeometry pOther, esriSpatialRelationExEnum Relation)

Parameters

pOther IGeometry
Relation esriSpatialRelationExEnum

Returns

bool

ConvexHull()

Constructs the convex hull of this geometry.

virtual IGeometry ConvexHull()

Returns

IGeometry

Remarks

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

This method does not support GeometryBags. 

ConvexHull method does not deal with Z attribute now.

ConvexHull Example

CreateMGRS(int, bool, esriMGRSModeEnum)

Returns the MGRS/USNG description of a point.

virtual string CreateMGRS(int numDigits, bool round, esriMGRSModeEnum mode)

Parameters

numDigits int
round bool
mode esriMGRSModeEnum

Returns

string

Crosses(IGeometry)

Indicates if the two geometries intersect in a geometry of lesser dimension.

virtual bool Crosses(IGeometry other)

Parameters

other IGeometry

Returns

bool

Remarks

Only geometries that support the IRelationalOperator interface can be used as input geometries.

Cross only applies to polyline/polyline, polyline/polygon, or polygon/polyline relations.

If either one of the geometries is empty, the geometries do not cross.

Crosses examples. Only "true" relationships are showed in this picture.

Cut(IPolyline, out IGeometry, out IGeometry)

Splits this geometry into a part left of the cutting polyline, and a part right of it.

virtual void Cut(IPolyline cutter, out IGeometry leftGeom, out IGeometry rightGeom)

Parameters

cutter IPolyline
leftGeom IGeometry
rightGeom IGeometry

Remarks

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

When a polyline/polygon is cut, it is split where it intersects the cutter polyline. Each piece is classified as ‘left of’ or ‘right of’ the cutter. This classification is based on the orientation of the cutter line. Parts of the target polyline that do not intersect the cutting polyline are returned as part of the ‘right of’ result for that input polyline.  If a geometry is not cut, the left geometry will be empty.

When using a multi-part polyline to cut a single ring of a polyline, the orientation of the polyline paths is important. The cut piece of the ring must be on the same side of each cutting path as defined by the orientation of each path.

This method does not support GeometryBags.

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

Deserialize(IXMLSerializeData)

Deserializes an object from XML.

virtual void Deserialize(IXMLSerializeData data)

Parameters

data IXMLSerializeData

Difference(IGeometry)

Constructs the geometry containing points from this geometry but not the other geometry.

virtual IGeometry Difference(IGeometry other)

Parameters

other IGeometry

Returns

IGeometry

Remarks

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

This method does not support GeometryBags.

ITopologicalOperator Differenece Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

DifferenceEx(IGeometry, bool)

defined for (multi)points and polylines.

virtual IGeometry DifferenceEx(IGeometry other, bool bNonPlanar)

Parameters

other IGeometry
bNonPlanar bool

Returns

IGeometry

Dimension

virtual esriGeometryDimension Dimension { get; }

Returns

esriGeometryDimension

Disjoint(IGeometry)

Indicates if the two geometries share no points in common. Negate this result to compute the Intersect relation.

virtual bool Disjoint(IGeometry other)

Parameters

other IGeometry

Returns

bool

Remarks

Only geometries that support the IRelationalOperator interface can be used as input geometries.

Two geometries are disjoint if either one is empty.

Disjoint example. Only "true" relationships are showed in this picture.

Disjoint3D(IGeometry)

Indicates if the two geometries share no points in common. Negate this result to compute the Intersect relation.

virtual bool Disjoint3D(IGeometry pOther)

Parameters

pOther IGeometry

Returns

bool

DropMs()

Sets all the M values to a non-valid number (NaN).

virtual void DropMs()

DropPointIDs()

Unsets all PointID values without changing awareness. Only works if geometry is aware of PointIDs.

virtual void DropPointIDs()

DropZs()

Sets all the Z values to a non-valid number (NaN).

virtual void DropZs()

Envelope

virtual IEnvelope Envelope { get; }

Returns

IEnvelope

Equals(IGeometry)

Indicates if the two geometries are of the same type and define the same set of points in the plane.

virtual bool Equals(IGeometry other)

Parameters

other IGeometry

Returns

bool

Remarks

Only geometries that support the IRelationalOperator interface can be used as input geometries. GeometryBags are not supported. IRelationalOperator::Equals delegates to ITopologicalOperatorSymmetricDifference and returns true when that method returns an empty geometry; M's and Z's are ignored. Please use IClone::IsEqual if M's and Z's need to be compared.

IClone::IsEqual simply iterates over each segment in each geometry, in index order, and compares their types and coordinates (but using the spatial reference's cluster tolerances to determine equality of coordinates).

Only "true" relationships are showed in this picture.

[C#]

The RCW for the IRelationalOperator inherits from System.Object, as do all reference types in .NET. The System.Object type has a method called Equals, which results in the IRelationalOperator RCW having two overloaded versions of the Equals method. Ensure that you are not using the Equals method inherited from the System.Object class by mistake, by making sure you pass in an IGeometry reference to the Equals method. For example, the following extract of code from a C# console application demonstrates calling Equals correctly.

ESRI.ArcGIS.Geometry.IPoint pt1 = new ESRI.ArcGIS.Geometry.PointClass();
pt1.PutCoords(5, 5);

ESRI.ArcGIS.Geometry.IPoint pt2 = new ESRI.ArcGIS.Geometry.PointClass(); pt2.PutCoords(5, 5);

ESRI.ArcGIS.Geometry.IRelationalOperator rel1 = pt1 as ESRI.ArcGIS.Geometry.IRelationalOperator; ESRI.ArcGIS.Geometry.IGeometry geom2 = pt2 as ESRI.ArcGIS.Geometry.IGeometry;

bool relEqual = rel1.Equals(pt2); //calling IRelationalOperator::Equals Console.WriteLine("Equal: " + relEqual.ToString()); bool netEqual = rel1.Equals(pt2 as object); //calling Object::Equals Console.WriteLine("Equal: " + netEqual.ToString());

GeoNormalize()

virtual void GeoNormalize()

GeoNormalizeFromLongitude(double)

virtual void GeoNormalizeFromLongitude(double Longitude)

Parameters

Longitude double

GeometryType

virtual esriGeometryType GeometryType { get; }

Returns

esriGeometryType

GetClassID(out Guid)

virtual void GetClassID(out Guid pClassID)

Parameters

pClassID Guid

GetDDFromCoords(int)

Returns the decimal degrees description of a point.

virtual string GetDDFromCoords(int precision)

Parameters

precision int

Returns

string

GetDDMFromCoords(int)

Returns the degrees decimal minutes description of a point.

virtual string GetDDMFromCoords(int precision)

Parameters

precision int

Returns

string

GetDMSFromCoords(int)

Returns the degrees/minutes/seconds description of a point.

virtual string GetDMSFromCoords(int precision)

Parameters

precision int

Returns

string

GetGARSFromCoords()

Returns the GARS description of a point.

virtual string GetGARSFromCoords()

Returns

string

GetGeoRefFromCoords(int, bool)

Returns the GeoRef description of a point.

virtual string GetGeoRefFromCoords(int numDigits, bool numericRounding)

Parameters

numDigits int
numericRounding bool

Returns

string

GetSizeMax(out _ULARGE_INTEGER)

virtual void GetSizeMax(out _ULARGE_INTEGER pcbSize)

Parameters

pcbSize _ULARGE_INTEGER

GetUSNGFromCoords(int, bool, bool)

Returns the USNG description of a point.

virtual string GetUSNGFromCoords(int numDigits, bool numericRounding, bool addSpaces)

Parameters

numDigits int
numericRounding bool
addSpaces bool

Returns

string

GetUTMFromCoords(esriUTMConversionOptionsEnum)

Returns the UTM description of a point.

virtual string GetUTMFromCoords(esriUTMConversionOptionsEnum utmOptions)

Parameters

utmOptions esriUTMConversionOptionsEnum

Returns

string

HitTest(IPoint, double, esriGeometryHitPartType, IPoint, ref double, ref int, ref int, ref bool)

Locates a part of a geometry closest to a query point. Any located part must be within searchRadius units from the query point.

virtual bool HitTest(IPoint QueryPoint, double searchRadius, esriGeometryHitPartType geometryPart, IPoint hitPoint, ref double hitDistance, ref int hitPartIndex, ref int hitSegmentIndex, ref bool bRightSide)

Parameters

QueryPoint IPoint
searchRadius double
geometryPart esriGeometryHitPartType
hitPoint IPoint
hitDistance double
hitPartIndex int
hitSegmentIndex int
bRightSide bool

Returns

bool

Remarks

The segment index returned has different meanings depending on the esriGeometryHitPartType used (Please see the example for more details).


EsriGeometryPartVertex: returns a vertex index


EsriGeometryPartBoundary, esriGeometryPartMidpoint and esriGeometryPartEndpoint: return a segment index


EsriGeometryPartCentroid: Always returns 0 for the part index and the segment index.

 

brightside: Indicates if the input point is on the right side of the input geometry

 

Note: The distance units use in this method are the units of the input geometry. No conversion is performed. esriGeometryHitPartType parameter cannot be a combination of several esriGeometryHitPartTypes.

HitTest3D(IPoint, double, esriGeometryHitPartType, IPoint, ref double, ref int, ref int)

Locates a part of a geometry closest to a query point. Any located part must be within searchRadius units from the query point.

virtual bool HitTest3D(IPoint QueryPoint, double searchRadius, esriGeometryHitPartType geometryPart, IPoint hitPoint, ref double hitDistance, ref int hitPartIndex, ref int hitSegmentIndex)

Parameters

QueryPoint IPoint
searchRadius double
geometryPart esriGeometryHitPartType
hitPoint IPoint
hitDistance double
hitPartIndex int
hitSegmentIndex int

Returns

bool

HitTestCone(IRay, double, esriGeometryHitPartType, IPoint, ref double, ref int, ref int)

Locates a part of a geometry closest to a query ray.

virtual bool HitTestCone(IRay pQueryRay, double minAngle, esriGeometryHitPartType geometryPart, IPoint pHitPoint, ref double pHitDistance, ref int pHitPartIndex, ref int pHitSegmentIndex)

Parameters

pQueryRay IRay
minAngle double
geometryPart esriGeometryHitPartType
pHitPoint IPoint
pHitDistance double
pHitPartIndex int
pHitSegmentIndex int

Returns

bool

IConstructPoint2_ConstructAlong(ICurve, esriSegmentExtension, double, bool)

virtual void IConstructPoint2_ConstructAlong(ICurve curve, esriSegmentExtension extension, double distance, bool asRatio)

Parameters

curve ICurve
extension esriSegmentExtension
distance double
asRatio bool

IConstructPoint2_ConstructAngleBisector(IPoint, IPoint, IPoint, double, bool)

virtual void IConstructPoint2_ConstructAngleBisector(IPoint from, IPoint through, IPoint to, double distance, bool useAcuteAngle)

Parameters

from IPoint
through IPoint
to IPoint
distance double
useAcuteAngle bool

IConstructPoint2_ConstructAngleDistance(IPoint, double, double)

virtual void IConstructPoint2_ConstructAngleDistance(IPoint p, double inAngle, double distance)

Parameters

p IPoint
inAngle double
distance double

IConstructPoint2_ConstructAngleIntersection(IPoint, double, IPoint, double)

virtual void IConstructPoint2_ConstructAngleIntersection(IPoint p1, double angle1, IPoint p2, double angle2)

Parameters

p1 IPoint
angle1 double
p2 IPoint
angle2 double

IConstructPoint2_ConstructDeflection(ILine, double, double)

virtual void IConstructPoint2_ConstructDeflection(ILine baseLine, double distance, double inAngle)

Parameters

baseLine ILine
distance double
inAngle double

IConstructPoint2_ConstructDeflectionIntersection(ILine, double, double, bool)

virtual void IConstructPoint2_ConstructDeflectionIntersection(ILine baseLine, double startAngle, double endAngle, bool OnRightSide)

Parameters

baseLine ILine
startAngle double
endAngle double
OnRightSide bool

IConstructPoint2_ConstructOffset(ICurve, esriSegmentExtension, double, bool, double)

virtual void IConstructPoint2_ConstructOffset(ICurve curve, esriSegmentExtension extension, double distance, bool asRatio, double Offset)

Parameters

curve ICurve
extension esriSegmentExtension
distance double
asRatio bool
Offset double

IConstructPoint2_ConstructParallel(ISegment, esriSegmentExtension, IPoint, double)

virtual void IConstructPoint2_ConstructParallel(ISegment Segment, esriSegmentExtension extension, IPoint start, double distance)

Parameters

Segment ISegment
extension esriSegmentExtension
start IPoint
distance double

IConstructPoint2_ConstructPerpendicular(ISegment, esriSegmentExtension, IPoint, double, bool)

virtual void IConstructPoint2_ConstructPerpendicular(ISegment @base, esriSegmentExtension extension, IPoint p, double distance, bool bUseLineOrientation)

Parameters

base ISegment
extension esriSegmentExtension
p IPoint
distance double
bUseLineOrientation bool

IConstructPoint2_ConstructThreePointResection(IPoint, double, IPoint, double, IPoint, out double)

virtual void IConstructPoint2_ConstructThreePointResection(IPoint point1, double angleP1P2, IPoint point2, double angleP2P3, IPoint point3, out double arcAngle)

Parameters

point1 IPoint
angleP1P2 double
point2 IPoint
angleP2P3 double
point3 IPoint
arcAngle double

IConversionNotation_CreateMGRS(int, bool, esriMGRSModeEnum)

virtual string IConversionNotation_CreateMGRS(int numDigits, bool round, esriMGRSModeEnum mode)

Parameters

numDigits int
round bool
mode esriMGRSModeEnum

Returns

string

IConversionNotation_PutCoordsFromMGRS(string, esriMGRSModeEnum)

virtual void IConversionNotation_PutCoordsFromMGRS(string mgrs, esriMGRSModeEnum mode)

Parameters

mgrs string
mode esriMGRSModeEnum

ID

The Point ID attribute.

virtual int ID { get; set; }

Returns

int

Remarks

To set the ID value for a point you need to define it to be ID aware.
[C#]

The following C# code explains how to do it:    

IPoint pnt = new PointClass();

pnt.PutCoords(100, 100);

 

IPointIDAware pntIDA = pnt as IPointIDAware;

pntIDA.PointIDAware = true;

pnt.ID = 10;

IGeometry2_Dimension

virtual esriGeometryDimension IGeometry2_Dimension { get; }

Returns

esriGeometryDimension

IGeometry2_Envelope

virtual IEnvelope IGeometry2_Envelope { get; }

Returns

IEnvelope

IGeometry2_GeoNormalize()

virtual void IGeometry2_GeoNormalize()

IGeometry2_GeoNormalizeFromLongitude(double)

virtual void IGeometry2_GeoNormalizeFromLongitude(double Longitude)

Parameters

Longitude double

IGeometry2_GeometryType

virtual esriGeometryType IGeometry2_GeometryType { get; }

Returns

esriGeometryType

IGeometry2_IsEmpty

virtual bool IGeometry2_IsEmpty { get; }

Returns

bool

IGeometry2_Project(ISpatialReference)

virtual void IGeometry2_Project(ISpatialReference newReferenceSystem)

Parameters

newReferenceSystem ISpatialReference

IGeometry2_QueryEnvelope(IEnvelope)

virtual void IGeometry2_QueryEnvelope(IEnvelope outEnvelope)

Parameters

outEnvelope IEnvelope

IGeometry2_SetEmpty()

virtual void IGeometry2_SetEmpty()

IGeometry2_SnapToSpatialReference()

virtual void IGeometry2_SnapToSpatialReference()

IGeometry2_SpatialReference

virtual ISpatialReference IGeometry2_SpatialReference { get; set; }

Returns

ISpatialReference

IGeometry3_Dimension

virtual esriGeometryDimension IGeometry3_Dimension { get; }

Returns

esriGeometryDimension

IGeometry3_Envelope

virtual IEnvelope IGeometry3_Envelope { get; }

Returns

IEnvelope

IGeometry3_GeoNormalize()

virtual void IGeometry3_GeoNormalize()

IGeometry3_GeoNormalizeFromLongitude(double)

virtual void IGeometry3_GeoNormalizeFromLongitude(double Longitude)

Parameters

Longitude double

IGeometry3_GeometryType

virtual esriGeometryType IGeometry3_GeometryType { get; }

Returns

esriGeometryType

IGeometry3_IsEmpty

virtual bool IGeometry3_IsEmpty { get; }

Returns

bool

IGeometry3_Project(ISpatialReference)

virtual void IGeometry3_Project(ISpatialReference newReferenceSystem)

Parameters

newReferenceSystem ISpatialReference

IGeometry3_ProjectEx(ISpatialReference, esriTransformDirection, IGeoTransformation, bool, double, double)

virtual void IGeometry3_ProjectEx(ISpatialReference newReferenceSystem, esriTransformDirection Direction, IGeoTransformation GeoTransformation, bool bAngularDensify, double maxSegmentLength, double maxDeviation)

Parameters

newReferenceSystem ISpatialReference
Direction esriTransformDirection
GeoTransformation IGeoTransformation
bAngularDensify bool
maxSegmentLength double
maxDeviation double

IGeometry3_QueryEnvelope(IEnvelope)

virtual void IGeometry3_QueryEnvelope(IEnvelope outEnvelope)

Parameters

outEnvelope IEnvelope

IGeometry3_SetEmpty()

virtual void IGeometry3_SetEmpty()

IGeometry3_SnapToSpatialReference()

virtual void IGeometry3_SnapToSpatialReference()

IGeometry3_SpatialReference

virtual ISpatialReference IGeometry3_SpatialReference { get; set; }

Returns

ISpatialReference

IGeometry4_Dimension

virtual esriGeometryDimension IGeometry4_Dimension { get; }

Returns

esriGeometryDimension

IGeometry4_Envelope

virtual IEnvelope IGeometry4_Envelope { get; }

Returns

IEnvelope

IGeometry4_GeoNormalize()

virtual void IGeometry4_GeoNormalize()

IGeometry4_GeoNormalizeFromLongitude(double)

virtual void IGeometry4_GeoNormalizeFromLongitude(double Longitude)

Parameters

Longitude double

IGeometry4_GeometryType

virtual esriGeometryType IGeometry4_GeometryType { get; }

Returns

esriGeometryType

IGeometry4_IsEmpty

virtual bool IGeometry4_IsEmpty { get; }

Returns

bool

IGeometry4_Project(ISpatialReference)

virtual void IGeometry4_Project(ISpatialReference newReferenceSystem)

Parameters

newReferenceSystem ISpatialReference

IGeometry4_ProjectEx(ISpatialReference, esriTransformDirection, IGeoTransformation, bool, double, double)

virtual void IGeometry4_ProjectEx(ISpatialReference newReferenceSystem, esriTransformDirection Direction, IGeoTransformation GeoTransformation, bool bAngularDensify, double maxSegmentLength, double maxDeviation)

Parameters

newReferenceSystem ISpatialReference
Direction esriTransformDirection
GeoTransformation IGeoTransformation
bAngularDensify bool
maxSegmentLength double
maxDeviation double

IGeometry4_QueryEnvelope(IEnvelope)

virtual void IGeometry4_QueryEnvelope(IEnvelope outEnvelope)

Parameters

outEnvelope IEnvelope

IGeometry4_QueryWKSEnvelope(out WKSEnvelope)

virtual void IGeometry4_QueryWKSEnvelope(out WKSEnvelope e)

Parameters

e WKSEnvelope

IGeometry4_SetEmpty()

virtual void IGeometry4_SetEmpty()

IGeometry4_SnapToSpatialReference()

virtual void IGeometry4_SnapToSpatialReference()

IGeometry4_SpatialReference

virtual ISpatialReference IGeometry4_SpatialReference { get; set; }

Returns

ISpatialReference

IGeometry5_Changed

virtual bool IGeometry5_Changed { get; set; }

Returns

bool

IGeometry5_Dimension

virtual esriGeometryDimension IGeometry5_Dimension { get; }

Returns

esriGeometryDimension

IGeometry5_Envelope

virtual IEnvelope IGeometry5_Envelope { get; }

Returns

IEnvelope

IGeometry5_GeoNormalize()

virtual void IGeometry5_GeoNormalize()

IGeometry5_GeoNormalizeFromLongitude(double)

virtual void IGeometry5_GeoNormalizeFromLongitude(double Longitude)

Parameters

Longitude double

IGeometry5_GeometryType

virtual esriGeometryType IGeometry5_GeometryType { get; }

Returns

esriGeometryType

IGeometry5_IsEmpty

virtual bool IGeometry5_IsEmpty { get; }

Returns

bool

IGeometry5_Project(ISpatialReference)

virtual void IGeometry5_Project(ISpatialReference newReferenceSystem)

Parameters

newReferenceSystem ISpatialReference

IGeometry5_ProjectEx(ISpatialReference, esriTransformDirection, IGeoTransformation, bool, double, double)

virtual void IGeometry5_ProjectEx(ISpatialReference newReferenceSystem, esriTransformDirection Direction, IGeoTransformation GeoTransformation, bool bAngularDensify, double maxSegmentLength, double maxDeviation)

Parameters

newReferenceSystem ISpatialReference
Direction esriTransformDirection
GeoTransformation IGeoTransformation
bAngularDensify bool
maxSegmentLength double
maxDeviation double

IGeometry5_QueryEnvelope(IEnvelope)

virtual void IGeometry5_QueryEnvelope(IEnvelope outEnvelope)

Parameters

outEnvelope IEnvelope

IGeometry5_QueryWKSEnvelope(out WKSEnvelope)

virtual void IGeometry5_QueryWKSEnvelope(out WKSEnvelope e)

Parameters

e WKSEnvelope

IGeometry5_SetEmpty()

virtual void IGeometry5_SetEmpty()

IGeometry5_SnapToSpatialReference()

virtual void IGeometry5_SnapToSpatialReference()

IGeometry5_SpatialReference

virtual ISpatialReference IGeometry5_SpatialReference { get; set; }

Returns

ISpatialReference

IGeometry_Dimension

The topological dimension of this geometry.

virtual esriGeometryDimension IGeometry_Dimension { get; }

Returns

esriGeometryDimension

Remarks


Note: At 9.0, Multipatches are now considered as two dimensional geometry. esriGeometry3Dimension will be used for an upcoming new geometry type.
Supported esriGeometryDimensions:

-1    esriGeometryNoDimension
1    esriGeometry0Dimension
2    esriGeometry1Dimension
4    esriGeometry2Dimension
5    esriGeometry25Dimension
6    esriGeometry3Dimension






Dimension Example





IGeometry_Envelope

Creates a copy of this geometry's envelope and returns it.

virtual IEnvelope IGeometry_Envelope { get; }

Returns

IEnvelope

Examples

Sample Snippet

<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
<img src="./bitmaps/envelope.gif" align=
"baseline"></span></span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
 </p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
       </span> <span style=
"COLOR: blue">public</span> <span style="COLOR: blue">static</span>
<span style="COLOR: teal">IGeometry</span>
GetEnvelopeGeometry()</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
       </span> {</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">const</span> <span style=
"COLOR: blue">double</span> DeltaX = 2.5;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">const</span> <span style=
"COLOR: blue">double</span> DeltaY = 2.5;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">const</span> <span style=
"COLOR: blue">double</span> DeltaZ = 2.5;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: teal">IPoint</span> centerPoint =
GetPoint();</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: teal">IEnvelope</span> envelope = <span style=
"COLOR: blue">new</span> <span style=
"COLOR: teal">EnvelopeClass</span>();</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
envelope.XMin = centerPoint.X - DeltaX;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
envelope.XMax = centerPoint.X + DeltaX;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
envelope.YMin = centerPoint.Y - DeltaY;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
envelope.YMax = centerPoint.Y + DeltaY;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
envelope.ZMin = centerPoint.Z - DeltaZ;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
envelope.ZMax = centerPoint.Z + DeltaZ;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
MakeZAware(envelope <span style="COLOR: blue">as</span>
<span style="COLOR: teal">IGeometry</span>);</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">return</span> envelope <span style=
"COLOR: blue">as</span> <span style=
"COLOR: teal">IGeometry</span>;</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt"><span style=
"FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
<span style=
"mso-spacerun: yes">       </span>
}</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
       </span> <span style=
"COLOR: blue">private</span> <span style=
"COLOR: blue">static</span> <span style="COLOR: teal">IPoint</span>
GetPoint()</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
       </span> {</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">const</span> <span style=
"COLOR: blue">double</span> Min = -10;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">const</span> <span style=
"COLOR: blue">double</span> Max = 10;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: teal">Random</span> random = <span style=
"COLOR: blue">new</span> <span style=
"COLOR: teal">Random</span>();</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">double</span> x = Min + (Max - Min) *
random.NextDouble();</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">double</span> y = Min + (Max - Min) *
random.NextDouble();</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">double</span> z = Min + (Max - Min) *
random.NextDouble();</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: blue">return</span> ConstructPoint3D(x, y,
z);</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
       </span> }</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">       </span></span>
<span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
private</span> <span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
static</span> <span style=
"FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
IPoint</span> <span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
ConstructPoint3D(</span><span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">double</span>
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
x,</span> <span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
double</span> <span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
y,</span> <span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
double</span> <span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
z)</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">       </span>
{</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">           </span></span>
<span style=
"FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
IPoint</span> <span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
point = ConstructPoint2D(x, y);</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">           </span>
point.Z = z;<br>
<br>
<span style=
"mso-spacerun: yes">           </span></span>
<span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
return</span> <span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
point;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">       </span>
}<br>
<br style="mso-special-character: line-break">
<br style="mso-special-character: line-break"></span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">       </span></span>
<span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
private</span> <span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
static</span> <span style=
"FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
IPoint</span> <span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
ConstructPoint2D(</span><span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">double</span>
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
x,</span> <span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
double</span> <span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
y)</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">       </span>
{</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">           </span></span>
<span style=
"FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
IPoint</span> <span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
point =</span> <span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
new</span> <span style=
"FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
PointClass</span><span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">();</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">           </span>
point.PutCoords(x, y);<br>
<span style="mso-spacerun: yes"> </span></span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">           </span></span>
<span style=
"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
return</span> <span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
point;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"><span style=
"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'">
<span style=
"mso-spacerun: yes">       </span>
}</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
       </span> <span style=
"COLOR: blue">private</span> <span style=
"COLOR: blue">static</span> <span style="COLOR: blue">void</span>
MakeZAware(<span style="COLOR: teal">IGeometry</span>
geometry)</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
       </span> {</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
<span style="COLOR: teal">IZAware</span> zAware = geometry
<span style="COLOR: blue">as</span> <span style=
"COLOR: teal">IZAware</span>;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
           </span>
zAware.ZAware = <span style="COLOR: blue">true</span>;</span></p>
<p class="MsoNormal" style=
"MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
<span style=
"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><span style="mso-spacerun: yes">
       </span> }</span></p>

Remarks

 

Envelope Example

IGeometry_GeoNormalize()

Shifts longitudes, if need be, into a continuous range of 360 degrees.

virtual void IGeometry_GeoNormalize()

Remarks

GeoNormalize acts on geometries whose geographic system coordinates are below -180 degrees longitude or over +180 degrees longitude or on geometries that span the +-180 degrees longitude.
 
This method requires the geometry to have a valid spatial reference (geographic or projected coordinate system).
 
This method is used internally as part of the projection process for polygons and polylines.  It is typically not used by itself.
 

IGeometry_GeoNormalizeFromLongitude(double)

Normalizes longitudes into a continuous range containing the longitude. This method is obsolete.

virtual void IGeometry_GeoNormalizeFromLongitude(double Longitude)

Parameters

Longitude double

Remarks

This method is obsolete.  Use IGeometry::GeoNormalize instead.
 
This method requires the geometry to have a valid spatial reference (geographic or projected coordinate system).

IGeometry_GeometryType

The type of this geometry.

virtual esriGeometryType IGeometry_GeometryType { get; }

Returns

esriGeometryType

Remarks

esriGeometryNull          = 0
esriGeometryPoint = 1
esriGeometryMultipoint = 2
esriGeometryPolyline = 3
esriGeometryPolygon = 4
esriGeometryEnvelope = 5
esriGeometryPath = 6
esriGeometryAny = 7
esriGeometryMultiPatch = 9
esriGeometryRing = 11
esriGeometryLine = 13
esriGeometryCircularArc = 14
esriGeometryBezier3Curve = 15
esriGeometryEllipticArc = 16
esriGeometryBag = 17
esriGeometryTriangleStrip = 18
esriGeometryTriangleFan = 19
esriGeometryRay = 20
esriGeometrySphere = 21

















Geometry Type Example

IGeometry_IsEmpty

Indicates whether this geometry contains any points.

virtual bool IGeometry_IsEmpty { get; }

Returns

bool

IGeometry_Project(ISpatialReference)

Projects this geometry into a new spatial reference.

virtual void IGeometry_Project(ISpatialReference newReferenceSystem)

Parameters

newReferenceSystem ISpatialReference

Remarks

Note: This method can only be called upon the top level geometries (Points, Multipoints, Polylines and Polygons).  If the from/to spatial references have different geographic coordinate systems, the Project method looks for a GeoTransformationsOperationSet. If the set of Geotransformations is present in memory, Project will use it to perform a geographic/datum Transformation. To use a specific geotransformation, use the IGeometry2::ProjectEx method.

[C#]
//Create Spatial Reference Factory
ISpatialReferenceFactory srFactory = new SpatialReferenceEnvironmentClass();
ISpatialReference sr1;
//GCS to project from 
IGeographicCoordinateSystem gcs = srFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_NAD1983);
sr1 = gcs;
sr1.SetFalseOriginAndUnits(-180, -90, 1000000);
//Projected Coordinate System to project into
IProjectedCoordinateSystem pcs = srFactory.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_NAD1983N_AmericaLambert);
pcs.SetFalseOriginAndUnits(0, 0, 1000);
ISpatialReference sr2;
sr2 = pcs;
//Point to project
IPoint point = new PointClass() as IPoint;
point.PutCoords(-117.17, 34.06);
//Geometry Interface to do actual project
IGeometry geometry;
geometry = point;
geometry.SpatialReference = sr1;
geometry.Project(sr2);
point = geometry as IPoint;
double x;
double y;
point.QueryCoords(out x, out y);
Debug.Print("X: " + x.ToString());
Debug.Print("Y: " + y.ToString());

IGeometry_QueryEnvelope(IEnvelope)

Copies this geometry's envelope properties into the specified envelope.

virtual void IGeometry_QueryEnvelope(IEnvelope outEnvelope)

Parameters

outEnvelope IEnvelope

Remarks

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

QueryEnvelope Example

IGeometry_SetEmpty()

Removes all points from this geometry.

virtual void IGeometry_SetEmpty()

Remarks


Use the SetEmpty method to clear geometries and release memory. For example, a polygon with 100 rings will have an internal array of 100 pointers to ring objects. That array will go away and Release will be called on each ring. If that polygon had the only reference on those rings, then they'll go away, which releases all their segments, which may also then go away.


[C#]     private bool EmptyGeometry(IGeometry geometry)
    {
        geometry.SetEmpty();
        return geometry.IsEmpty;
    }



IGeometry_SnapToSpatialReference()

Moves points of this geometry so that they can be represented in the precision of the geometry's associated spatial reference system.

virtual void IGeometry_SnapToSpatialReference()

Remarks

SnapToSpatialReference rounds all coordinates to the resolution defined by the geometry's spatial reference system. This has a similar effect on the geometry as storing the geometry in a Geodatabase.

IGeometry_SpatialReference

The spatial reference associated with this geometry.

virtual ISpatialReference IGeometry_SpatialReference { get; set; }

Returns

ISpatialReference

IPersistStream_GetClassID(out Guid)

virtual void IPersistStream_GetClassID(out Guid pClassID)

Parameters

pClassID Guid

IRelationalOperator2_Contains(IGeometry)

virtual bool IRelationalOperator2_Contains(IGeometry other)

Parameters

other IGeometry

Returns

bool

IRelationalOperator2_Crosses(IGeometry)

virtual bool IRelationalOperator2_Crosses(IGeometry other)

Parameters

other IGeometry

Returns

bool

IRelationalOperator2_Disjoint(IGeometry)

virtual bool IRelationalOperator2_Disjoint(IGeometry other)

Parameters

other IGeometry

Returns

bool

IRelationalOperator2_Equals(IGeometry)

virtual bool IRelationalOperator2_Equals(IGeometry other)

Parameters

other IGeometry

Returns

bool

IRelationalOperator2_Overlaps(IGeometry)

virtual bool IRelationalOperator2_Overlaps(IGeometry other)

Parameters

other IGeometry

Returns

bool

IRelationalOperator2_Relation(IGeometry, string)

virtual bool IRelationalOperator2_Relation(IGeometry other, string relationDescription)

Parameters

other IGeometry
relationDescription string

Returns

bool

IRelationalOperator2_Touches(IGeometry)

virtual bool IRelationalOperator2_Touches(IGeometry other)

Parameters

other IGeometry

Returns

bool

IRelationalOperator2_Within(IGeometry)

virtual bool IRelationalOperator2_Within(IGeometry other)

Parameters

other IGeometry

Returns

bool

IRelationalOperator3D2_Disjoint3D(IGeometry)

virtual bool IRelationalOperator3D2_Disjoint3D(IGeometry pOther)

Parameters

pOther IGeometry

Returns

bool

InterfaceSupportsErrorInfo(ref Guid)

virtual void InterfaceSupportsErrorInfo(ref Guid riid)

Parameters

riid Guid

InterpolateFromSurface(IFunctionalSurface)

virtual void InterpolateFromSurface(IFunctionalSurface interpolationSurface)

Parameters

interpolationSurface IFunctionalSurface

InterpolateZsBetween(int, int, int, int)

virtual void InterpolateZsBetween(int startPart, int startPoint, int endPart, int endPoint)

Parameters

startPart int
startPoint int
endPart int
endPoint int

Intersect(IGeometry, esriGeometryDimension)

Constructs the geometry that is the set-theoretic intersection of the input geometries. Use different resultDimension values to generate results of different dimensions.

virtual IGeometry Intersect(IGeometry other, esriGeometryDimension resultDimension)

Parameters

other IGeometry
resultDimension esriGeometryDimension

Returns

IGeometry

Remarks

Intersection is basically an AND between input geometries.

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

Note that when esriGeometryNoDimension is specified as resultDimension, the output will be in the dimension of the minimum dimension of the input geometries.

This method does not support GeometryBags.

Since ArcGIS 9.2, Intersect has a larger cost - it takes longer to run the method.  Therefore, it is a better approach to test if the two geometries are disjoint before calling Intersect.

Intersection Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

IntersectEx(IGeometry, bool, esriGeometryDimension)

Constructs the set-theoretic intersection of the inputs in the specified result dimension, , with the option for non-planary result.

virtual IGeometry IntersectEx(IGeometry other, bool bNonPlanar, esriGeometryDimension resultDimension)

Parameters

other IGeometry
bNonPlanar bool
resultDimension esriGeometryDimension

Returns

IGeometry

IntersectMultidimensionEx(IGeometry, bool)

Constructs the set-theoretic intersection of the inputs. The results are returned in a geometry bag with one element per result dimension.

virtual IGeometry IntersectMultidimensionEx(IGeometry other, bool bNonPlanar)

Parameters

other IGeometry
bNonPlanar bool

Returns

IGeometry

IsDirty()

virtual void IsDirty()

IsEmpty

virtual bool IsEmpty { get; }

Returns

bool

IsEqual(IClone)

Indicates if the receiver and other have the same properties.

virtual bool IsEqual(IClone other)

Parameters

other IClone

Returns

bool

IsIdentical(IClone)

Indicates if the receiver and other are the same object.

virtual bool IsIdentical(IClone other)

Parameters

other IClone

Returns

bool

IsKnownSimple

Indicates whether this geometry is known (or assumed) to be topologically correct.

virtual bool IsKnownSimple { get; }

Returns

bool

Remarks

Here is the status of the IsKnownSimple flag in some common situations:


IsKnownSimple = 'False'
    - A non-empty newly created geometry. For example, creating a polygon using IPointCollection sets the flag IsKnownSimple = 'false' on that geometry.
    - Geometry after projection (IGeometry::Project )
    - Geometry after generalization (IPolycurve::Generalize ) or smoothing(IPolycurve::Smooth )
    - …




 

IsKnownSimple = 'True'
    - A geometry coming directly from a feature class
    - An empty geometry
    - Output geometry of any method on ITopologicalOperator
    - …



 

 

This method does not support GeometryBags.

IsNear(IGeometry, double)

Indicates if this geometry is within distance from the other geometry.

virtual bool IsNear(IGeometry pOther, double distance)

Parameters

pOther IGeometry
distance double

Returns

bool

IsNear3D(IGeometry, double)

Indicates if this geometry is within distance from the other geometry; both geometries must have Zs.

virtual bool IsNear3D(IGeometry pOther, double distance)

Parameters

pOther IGeometry
distance double

Returns

bool

IsSimple

Indicates whether this geometry is known (or assumed) to be topologically correct, after explicitly determining this if the geometry is not already known (or assumed) to be simple.

virtual bool IsSimple { get; }

Returns

bool

Remarks

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

The xy cluster tolerance value of the geometry's associated spatial reference is used by this method. If the goal of this method is to determine if a geometry can be persisted in an sde (or other integer-based) layer without alteration, you may wish to use the minimum xy cluster tolerance value (ISpatialReferenceTolerance::SetMinimumXYTolerance) before applying this method (don't forget to set it back).

This method does not support GeometryBags.

ITopologicalOperator IsSimple SimplePolygon Example

ITopologicalOperator IsSimple SimplePolyline Example

ITopologicalOperator IsSimple SimplePoint Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

Load(IStream)

virtual void Load(IStream pstm)

Parameters

pstm IStream

M

The measure attribute.

virtual double M { get; set; }

Returns

double

Remarks





[C#]

    // The following example shows how to set the x,y,z,m properties
    // for a point. Note that you need to tell the point to be
    // M- and Z-aware.
    public void DisplayCoordinates()
    {
        IPoint point = new PointClass();
        point.PutCoords(100, 100);
        IMAware mAware = point as IMAware;
        mAware.MAware = true;
        IZAware zAware = point as IZAware;
        zAware.ZAware = true;
        point.Z = 50;
        point.M = 10;
        System.Windows.Forms.MessageBox.Show(point.X + "," + point.Y + "," + point.Z + "," + point.M);
    }













MAware

Indicates whether or not the geometry is aware of and capable of handling Ms.

virtual bool MAware { get; set; }

Returns

bool

MSimple

Indicates if all the Ms are valid numbers.

virtual bool MSimple { get; }

Returns

bool

Move(double, double)

Moves dx units horizontally and dy units vertically.

virtual void Move(double dx, double dy)

Parameters

dx double
dy double

Remarks

 

Transform2D Move Example

Move3D(double, double, double)

Moves the object by dx, dy and dz along the x, y, and z axes respectively.

virtual void Move3D(double dx, double dy, double dz)

Parameters

dx double
dy double
dz double

MovePointByGeodeticDistance(esriGeodeticType, double, double, IPoint)

Move point by given distance in meters on the Spheroid in the direction of the given azimuth(given in radians).

virtual void MovePointByGeodeticDistance(esriGeodeticType curveType, double distanceMeters, double azimuthRadians, IPoint resultPoint)

Parameters

curveType esriGeodeticType
distanceMeters double
azimuthRadians double
resultPoint IPoint

MoveVector(ILine)

Moves a direction and distance v. v can be in a different spatial reference than the geometry being moved.

virtual void MoveVector(ILine v)

Parameters

v ILine

Remarks

 

Transform2D MoveVector Example

MoveVector3D(IVector3D)

Moves the object by an offset defined by a 3D vector.

virtual void MoveVector3D(IVector3D v)

Parameters

v IVector3D

MultiplyZs(double)

virtual void MultiplyZs(double factor)

Parameters

factor double

OffsetZs(double)

virtual void OffsetZs(double Offset)

Parameters

Offset double

Overlaps(IGeometry)

Indicates if the intersection of the two geometries has the same dimension as one of the input geometries.

virtual bool Overlaps(IGeometry other)

Parameters

other IGeometry

Returns

bool

Remarks

Only geometries that support the IRelationalOperator interface can be used as input geometries.

Overlaps only applies to polyline/polyline, polygon/polygon and multipoint/multipoint relations.

Two geometries do not overlap if either one is empty.

Overlaps examples. Only "true" relationships are showed in this picture.

PointIDAware

Indicates whether or not the geometry is aware of and capable of handling PointIDs.

virtual bool PointIDAware { get; set; }

Returns

bool

PointIDSimple

Indicates if all PointID values for this geometry are well-defined. Only works if geometry is aware of PointIDs.

virtual bool PointIDSimple { get; }

Returns

bool

Project(ISpatialReference)

virtual void Project(ISpatialReference newReferenceSystem)

Parameters

newReferenceSystem ISpatialReference

Project5(ISpatialReference, int)

Same as Project, but with additional parameter projectionHint.

virtual void Project5(ISpatialReference newSpatialReference, int ProjectionHint)

Parameters

newSpatialReference ISpatialReference
ProjectionHint int

ProjectEx(ISpatialReference, esriTransformDirection, IGeoTransformation, bool, double, double)

Projects a geometry, optionally applies a GeoTransformation, and optionally densifies the geometry.

virtual void ProjectEx(ISpatialReference newReferenceSystem, esriTransformDirection Direction, IGeoTransformation GeoTransformation, bool bAngularDensify, double maxSegmentLength, double maxDeviation)

Parameters

newReferenceSystem ISpatialReference
Direction esriTransformDirection
GeoTransformation IGeoTransformation
bAngularDensify bool
maxSegmentLength double
maxDeviation double

Remarks

By default, ProjectEx will not densify geometries as they are projected. This can lead to the output geometries not reflecting the 'true' shape in the new coordinate system. A straight line in one coordinate system is not necessarily a straight line in a different coordinate system. Set the bAngularDensify parameter if you want to densify the geometries while they are projected.

[C#]

    //This example demonstrates how to use IGeometry2::ProjectEx
    public void ProjectExExample()
    {
        //Create source spatial reference
        ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
        ISpatialReference spatialReference = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
        spatialReference.SetFalseOriginAndUnits(-80.0000000232831, 39.9999999767169, 42949672.9);
        //Create envelope and define its spatial reference
        IEnvelope envelope = new EnvelopeClass();
        envelope.PutCoords(-68.6076204314651, 49.6186709634653, -68.5531907607304, 49.6530789785679);
        envelope.SpatialReference = spatialReference;
        //Destination spatial reference
        IProjectedCoordinateSystem projectedCoordinateSystem = spatialReferenceFactory.CreateProjectedCoordinateSystem((int)esriSRProjCSType.esriSRProjCS_NAD1927UTM_19N);
        //Define the XYDomain equivalent to SetFalseOriginAndUnits
        projectedCoordinateSystem.SetDomain(500000, 600000, 5300000, 5600000);
        //Create a Geotransformation (Datum transformation)
        IGeoTransformation geoTransformation = spatialReferenceFactory.CreateGeoTransformation((int)esriSRGeoTransformationType.esriSRGeoTransformation_NAD1927_To_WGS1984_12) as IGeoTransformation;















        String report = "Print envelope coordinates before projection:\n" +
        envelope.XMin + " , " + envelope.YMin + " , " + envelope.XMax + " , " + envelope.YMax + "\n\n\n";

        //Project envelope
        IGeometry2 geometry = envelope as IGeometry2;
        geometry.ProjectEx(projectedCoordinateSystem as ISpatialReference, esriTransformDirection.esriTransformReverse, geoTransformation, false, 0, 0);

        report = report + "Print envelope coordinates after projection:\n" +
        envelope.XMin + " , " + envelope.YMin + " , " + envelope.XMax + " , " + envelope.YMax;
        System.Windows.Forms.MessageBox.Show(report);
    }


ProjectEx5(ISpatialReference, esriTransformDirection, ITransformation, bool, double, double, int)

Same as ProjectEx, but with additional parameter projectionHint.

virtual void ProjectEx5(ISpatialReference newReferenceSystem, esriTransformDirection Direction, ITransformation Transformation, bool bAngularDensify, double maxSegmentLength, double maxDeviation, int ProjectionHint)

Parameters

newReferenceSystem ISpatialReference
Direction esriTransformDirection
Transformation ITransformation
bAngularDensify bool
maxSegmentLength double
maxDeviation double
ProjectionHint int

Remarks

By default, ProjectEx will not densify geometries as they are projected. This can lead to the output geometries not reflecting the 'true' shape in the new coordinate system. A straight line in one coordinate system is not necessarily a straight line in a different coordinate system. Set the bAngularDensify parameter if you want to densify the geometries while they are projected.

ProjectToPlane(IPoint, IVector3D, IVector3D)

Generates a polygon footprint for the object in an arbitrary plane. The footprint may have multiple parts.

virtual IGeometry ProjectToPlane(IPoint planarOrigin, IVector3D planarPositiveX, IVector3D planarNorm)

Parameters

planarOrigin IPoint
planarPositiveX IVector3D
planarNorm IVector3D

Returns

IGeometry

Remarks

This method can be used to get the xy-footprint of a multipatch if set all the parameters to Null.


[C#]

 

        public static void TransformMultiPatchGeometry()

        {

            //Transform3D: Cylinder Projected To XY Plane Via ProjectToPlane()

 

            //Define Origin At Which ProjectToPlane Operation Should Be Performed


            IPoint planarOriginPoint = ConstructPoint3D(0, 0, 0);

 

            //Construct A Vector3D Corresponding To The Positive X Vector

 

            IVector3D planarPositiveXVector3D = ConstructVector3D(10, 0, 0);

 

            //Construct A Vector3D Corresponding To The Normal Vector

 

            IVector3D planarNormalVector3D = ConstructVector3D(0, 0, 10);

 

            IGeometry geometry = GetMultiPatchGeometry();

 

            ITransform3D transform3D = geometry as ITransform3D;

 

IGeometry

projectedGeometry =

transform3D.ProjectToPlane(

planarOriginPoint, 

 

                          planarPositiveXVector3D,

planarNormalVector3D

                   );

        }

        private static IVector3D ConstructVector3D(double xComponent, double yComponent, double zComponent)

        {

            IVector3D vector3D = new Vector3DClass();

            vector3D.SetComponents(xComponent, yComponent, zComponent);

 

            return vector3D;

        }




PutCoords(double, double)

Sets the X and Y coordinates.

virtual void PutCoords(double X, double Y)

Parameters

X double
Y double

Remarks

Use the IPoint::PutCoords method to set the X,Y coordinates for a Point. The coordinates can also be set by updating the X and Y properties for the point.
Point PutCoords Example
[C#]     private void DefinePoint()
    {
        IPoint point = new PointClass();
        point.PutCoords(0, 0);
        System.Windows.Forms.MessageBox.Show(point.X + ", " + point.Y);
    }




PutCoordsFromDD(string)

Creates the coordinates of a point from the decimal degrees description.

virtual void PutCoordsFromDD(string DDString)

Parameters

DDString string

PutCoordsFromDDM(string)

Creates the coordinates of a point from the degrees decimal minutes description.

virtual void PutCoordsFromDDM(string DDMString)

Parameters

DDMString string

PutCoordsFromDMS(string)

Creates the coordinates of a point from the degrees/minutes/seconds description.

virtual void PutCoordsFromDMS(string DMSString)

Parameters

DMSString string

PutCoordsFromGARS(esriGARSModeEnum, string)

Creates the coordinates of a point from the GARS description.

virtual void PutCoordsFromGARS(esriGARSModeEnum mode, string GARSString)

Parameters

mode esriGARSModeEnum
GARSString string

PutCoordsFromGeoRef(string)

Creates the coordinates of a point from the GeoRef description.

virtual void PutCoordsFromGeoRef(string GeoRefString)

Parameters

GeoRefString string

PutCoordsFromMGRS(string, esriMGRSModeEnum)

Creates the coordinates of a point from the MGRS/USNG description.

virtual void PutCoordsFromMGRS(string mgrs, esriMGRSModeEnum mode)

Parameters

mgrs string
mode esriMGRSModeEnum

PutCoordsFromUSNG(string)

Creates the coordinates of a point from the USNG description.

virtual void PutCoordsFromUSNG(string USNGString)

Parameters

USNGString string

PutCoordsFromUTM(esriUTMConversionOptionsEnum, string)

Creates the coordinates of a point from the UTM description.

virtual void PutCoordsFromUTM(esriUTMConversionOptionsEnum utmOptions, string UTMString)

Parameters

utmOptions esriUTMConversionOptionsEnum
UTMString string

QueryClipped(IEnvelope, IGeometry)

Redefines clippedGeometry to be the intersection of this geometry and the clipping envelope.

virtual void QueryClipped(IEnvelope clipperEnvelope, IGeometry clippedGeometry)

Parameters

clipperEnvelope IEnvelope
clippedGeometry IGeometry

Remarks

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

The other geometry must be an high-level geometry. High-Level geometries are point, multipoint, polyline and polygon. To use it with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), path or ring they must be wrapped into high-level geometries type. The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

This method does not support GeometryBags.

QueryClipped Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

QueryClippedDense(IEnvelope, double, IGeometry)

Redefines clippedGeometry to be the intersection of this geometry and the clipping envelope; densifies lines in the output contributed by the clipping envelope.

virtual void QueryClippedDense(IEnvelope clipperEnvelope, double denseDistance, IGeometry clippedGeometry)

Parameters

clipperEnvelope IEnvelope
denseDistance double
clippedGeometry IGeometry

Remarks

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

The other geometry must be an high-level geometry. High-Level geometries are point, multipoint, polyline and polygon. To use it with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), path or ring they must be wrapped into high-level geometries type. The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

This method does not support GeometryBags.

QueryCoords(out double, out double)

Returns the X and Y coordinates.

virtual void QueryCoords(out double X, out double Y)

Parameters

X double
Y double

QueryEnvelope(IEnvelope)

virtual void QueryEnvelope(IEnvelope outEnvelope)

Parameters

outEnvelope IEnvelope

QueryNearestPoint(IPoint, esriSegmentExtension, IPoint)

Copies into 'nearest' a point on this geometry nearest to the input point.

virtual void QueryNearestPoint(IPoint p, esriSegmentExtension extension, IPoint nearest)

Parameters

p IPoint
extension esriSegmentExtension
nearest IPoint

Remarks

 

QueryNearestPoint Example

QueryNearestPoint3D(IPoint, esriSegmentExtension, IPoint)

Copies into 'nearest' a point on this geometry nearest to the input point.

virtual void QueryNearestPoint3D(IPoint pInP, esriSegmentExtension extension, IPoint pNearest)

Parameters

pInP IPoint
extension esriSegmentExtension
pNearest IPoint

Remarks

If the geometry is an Envelope and the input point is located within the bounds of the Envelope, QueryNearestPoint3D will return a point on the exterior of the Envelope nearest the input point.

[C#]

QueryNearestPoint3D graphic example.

public static void QueryNearestPoint3D()
{
  IGeometry pointGeometry = GetPointGeometry();
  IGeometry envelopeGeometry = GetEnvelopeGeometry();
  IProximityOperator3D proximityOperator3D = envelopeGeometry as IProximityOperator3D;
  IPoint nearestPoint3D = new PointClass();
  proximityOperator3D.QueryNearestPoint3D(pointGeometry as IPoint, esriSegmentExtension.esriNoExtension, nearestPoint3D);
  //nearestPoint3D = (5.393, -0.583, -6.043)
}








QueryWKSEnvelope(out WKSEnvelope)

Defines the specified wksenvelope to be the current extent of this geometry in the x-y plane.

virtual void QueryWKSEnvelope(out WKSEnvelope e)

Parameters

e WKSEnvelope

Relation(IGeometry, string)

Indicates if the defined relationship exists.

virtual bool Relation(IGeometry other, string relationDescription)

Parameters

other IGeometry
relationDescription string

Returns

bool

Remarks

Here is a VBA example of using the "RELATE" function to detect overlapping polylines. It assumes two polyline features are selected. G1 and G2 are placeholders for, in this example, the VBA variables r1 and r2.

Option Explicit

Public Sub overlapstest()
Dim ef As IEnumFeature
Dim d As IMxDocument
Set d = ThisDocument
Set ef = d.FocusMap.FeatureSelection
Dim r1 As IRelationalOperator, r2 As IRelationalOperator
Set r1 = ef.Next.Shape
Set r2 = ef.Next.Shape






Debug.Print "relation:", r1.Relation(r2, "RELATE(G1, G2, ""1********"")")

End Sub

ReturnDistance(IGeometry)

Returns the minimum distance between two geometries.

virtual double ReturnDistance(IGeometry other)

Parameters

other IGeometry

Returns

double

Remarks

 

ReturnDistance Example

The geometry combinations which can be used with ReturnDistance are:

Point: Point, MultiPoint, Envelope, Polyline, Polygon, Line, CircularArc, EllipticArc, BezierCurve.
Multipoint: Point, MultiPoint, Envelope, Polyline, Polygon.
Envelope: Point, MultiPoint, Envelope, Line, CircularArc, EllipticArc, BezierCurve, PolyLine, Polygon.
PolyLine: Point, Multipoint, Envelope, PolyLine, Polygon.
Polygon: Point, Multipoint, Envelope, PolyLine, Polygon.
Line: Point, Envelope, Line, CircularArc, EllipticArc, BezierCurve.
CircularArc: Point, Envelope, Line, CircularArc, EllipticArc (not implemented yet), BezierCurve.
EllipticArc: Point, Envelope, Line, CircularArc (not implemented yet), EllipticArc (not implemented yet), BezierCurve (not implemented yet).
BezierCurve: Point, Envelope, Line, CircularArc, EllipticArc (not implemented yet), BezierCurve.







Note: To get the distance between a segment (Line, CircularArc, EllipticArc, BezierCurve) and a MultiPoint, PolyLine or Polygon, add that segment to a PolyLine.

ReturnDistance3D(IGeometry)

Returns the minimal distance between two geometries.

virtual double ReturnDistance3D(IGeometry pOther)

Parameters

pOther IGeometry

Returns

double

ReturnNearestPoint(IPoint, esriSegmentExtension)

Creates and returns a point on this geometry nearest to the input point.

virtual IPoint ReturnNearestPoint(IPoint p, esriSegmentExtension extension)

Parameters

p IPoint
extension esriSegmentExtension

Returns

IPoint

Remarks

 

ReturnNearestPoint Example

ReturnNearestPoint3D(IPoint, esriSegmentExtension)

Creates and returns a point on this geometry nearest to the input point.

virtual IPoint ReturnNearestPoint3D(IPoint pInP, esriSegmentExtension extension)

Parameters

pInP IPoint
extension esriSegmentExtension

Returns

IPoint

Remarks

If the geometry is an Envelope and the input point is located within the bounds of the Envelope, QueryNearestPoint3D will return a point on the exterior of the Envelope nearest the input point.

[C#]

 

        public static void ReturnNearestPoint3D()

        {

IGeometry

pointGeometry = GetPointGeometry();

IGeometry envelopeGeometry = GetEnvelopeGeometry();


IProximityOperator3D

 proximityOperator3D = envelopeGeometry as IProximityOperator3D;

IPoint nearestPoint3D = proximityOperator3D.ReturnNearestPoint3D(pointGeometry as IPoint, esriSegmentExtension.esriNoExtension);


               //nearestPoint3D = (5.393, -0.583, -6.043)


        }

Rotate(IPoint, double)

Rotates about the specified origin point. The angle is in radians. The origin can be in a different spatial reference than the geometry being rotated.

virtual void Rotate(IPoint Origin, double rotationAngle)

Parameters

Origin IPoint
rotationAngle double

Remarks

An Envelope cannot be Rotated.

Transform2D Rotate Example

RotateVector3D(IVector3D, double)

Rotates the object about axis defined by the specified vector through an angle measured in radians.

virtual void RotateVector3D(IVector3D axis, double rotationAngle)

Parameters

axis IVector3D
rotationAngle double

Remarks

The angle of rotation must be in radians. To convert to radians from decimal degrees, multiply by PI/180.

[C#]

 

        public static void TransformMultiPatchGeometry()

        {

            const double DegreesOfRotation = 45;

 

            //Transform3D: Cylinder Rotated Around An Axis Via RotateVector3D()

 

            //Construct A Vector3D Corresponding To The Desired Axis Of Rotation

 

            IVector3D axisOfRotationVector3D = ConstructVector3D(0, 10, 0);

 

            //Obtain Angle Of Rotation In Radians

 

            double angleOfRotationInRadians = GetRadians(DegreesOfRotation);

 

            IGeometry geometry = GetMultiPatchGeometry();

 

            ITransform3D transform3D = geometry as ITransform3D;

            transform3D.RotateVector3D(axisOfRotationVector3D, angleOfRotationInRadians);

        }

        private static IVector3D ConstructVector3D(double xComponent, double yComponent, double zComponent)

        {

            IVector3D vector3D = new Vector3DClass();

            vector3D.SetComponents(xComponent, yComponent, zComponent);

 

            return vector3D;

        }

 

        private static double GetRadians(double decimalDegrees)

        {

            return decimalDegrees * (Math.PI / 180);

        }


Save(IStream, int)

virtual void Save(IStream pstm, int fClearDirty)

Parameters

pstm IStream
fClearDirty int

Scale(IPoint, double, double)

Scales about the specified origin using seperate horizonal and vertical scales. The origin point can be in a different spatial reference than the geometry being scaled.

virtual void Scale(IPoint Origin, double sx, double sy)

Parameters

Origin IPoint
sx double
sy double

Remarks

Note: Caution must be taken when scaling a CircularArc or a geometry containing CircularArc segments.  Unless Abs(ScaleX) = Abs(ScaleY), the resulting CircularArcs will not retain the characteristics of the original geometry (since they remain CircularArcs).

Scale Example

[C#]

            //Create Point you wish to scale
            IPoint startingPoint = new PointClass() as IPoint;
            startingPoint.PutCoords(10, 10);
            //Create a point to act as origin
            IPoint origin = new PointClass() as IPoint;
            origin.PutCoords(15, 15);
            //Cast the startingPoint into the correct Interface
            ITransform2D transformScalePoint = startingPoint as ITransform2D;
            //Perform Scale
            transformScalePoint.Scale(origin, .5, .5);
            double x;
            double y;
            startingPoint.QueryCoords(out x, out y);
            Debug.Print(x.ToString());
            Debug.Print(y.ToString());













Scale3D(IPoint, double, double, double)

Scales the object about the specified origin point. sx, sy, and sz are the scaling factors for the x, y, and z dimensions repectively.

virtual void Scale3D(IPoint Origin, double sx, double sy, double sz)

Parameters

Origin IPoint
sx double
sy double
sz double

Serialize(IXMLSerializeData)

Serializes an object to XML.

virtual void Serialize(IXMLSerializeData data)

Parameters

data IXMLSerializeData

SetConstantZ(double)

virtual void SetConstantZ(double zLevel)

Parameters

zLevel double

SetEmpty()

virtual void SetEmpty()

SetNonSimpleZs(double)

Replaces undefined (nonsimple) Z values with the specified constant value.

virtual void SetNonSimpleZs(double zLevel)

Parameters

zLevel double

Simplify()

Makes this geometry topologically correct.

virtual void Simplify()

Remarks

This method first looks at the ITopologicalOperator::IsKnownSimple flag before starting processing. If the flag is 'true' then operation is interrupted and the geometry is considered simple. If the flag is 'false' then the geometry consistency is checked and the geometry is updated as needed.

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

Simplify Polygon Example

Simplify Polyline Example

Simplify Point Example

SimplifyAsFeature()

Simplifies the geometry using the rules appropriate for this feature.

virtual void SimplifyAsFeature()

Snap()

Snaps ms to the precision of the spatial reference associated with the geometry. M snapping does not happen automatically as part of calling IGeometry::SnapToSpatialReference.

virtual void Snap()

SnapToSpatialReference()

virtual void SnapToSpatialReference()

SpatialReference

virtual ISpatialReference SpatialReference { get; set; }

Returns

ISpatialReference

SymmetricDifference(IGeometry)

Constructs the geometry that contains points from either but not both input geometries.

virtual IGeometry SymmetricDifference(IGeometry other)

Parameters

other IGeometry

Returns

IGeometry

Remarks

SymmetricDifference is basically an XOR between the input geometries.

SymmetricDifference of G1 and G2 can also be described as the Union(Difference(G1, G2), Difference(G2, G1)).

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

 This method does not support GeometryBags.

Symmetric Difference Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

SymmetricDifferenceEx(IGeometry, bool)

defined for (multi)points and polylines.

virtual IGeometry SymmetricDifferenceEx(IGeometry other, bool bNonPlanar)

Parameters

other IGeometry
bNonPlanar bool

Returns

IGeometry

TopologyCache(out long)

Provides a handle to the TopologyCache.

virtual void TopologyCache(out long topologyCacheHandle)

Parameters

topologyCacheHandle long

Touches(IGeometry)

Indicates if the boundaries of the geometries intersect.

virtual bool Touches(IGeometry other)

Parameters

other IGeometry

Returns

bool

Remarks

Only geometries that support the IRelationalOperator interface can be used as input geometries.

Touch does not apply for point/point comparison.

If either one of the two geometries is empty, the geometries are not touched.

 

Transform(esriTransformDirection, ITransformation)

Applies an arbitrary transformation. In particular, the transformation parameter can be either an affine transformation or a geographic transformation (datum shift).

virtual void Transform(esriTransformDirection Direction, ITransformation Transformation)

Parameters

Direction esriTransformDirection
Transformation ITransformation

Transform3D(esriTransformDirection, ITransformation3D)

Applies an arbitrary 3D transformation.

virtual void Transform3D(esriTransformDirection Direction, ITransformation3D Transformation)

Parameters

Direction esriTransformDirection
Transformation ITransformation3D

Union(IGeometry)

Constructs the geometry that is the set-theoretic union of the input geometries.

virtual IGeometry Union(IGeometry other)

Parameters

other IGeometry

Returns

IGeometry

Remarks

The Union is basically an OR between the input geometries.

ITopologicalOperator methods must be applied on high-level geometries only. High-Level geometries are point, multipoint, polyline and polygon. To use this method with low-level geometries such as segments (Line, Circular Arc, Elliptic Arc, Bézier Curve), paths or rings, they must be wrapped into high-level geometries types.

This method does not support GeometryBags.

Union Example

[C#]

//The following code shows to wrap a line segment into a polyline in C#

//Assume a line (line1 as ILine) is already created

object obj = Type.Missing;

ISegmentCollection segCollection = new PolylineClass() as ISegmentCollection;

segCollection.AddSegment((ISegment)line1, ref obj, ref obj);

//Set the spatial reference on the new polyline

//The spatial reference is not transfered automatically from the segments

IGeometry geom = segCollection as IGeometry;

geom.SpatialReference = spatialRef;

//Can now be used with ITopologicalOperator methods

 

UnionEx(IGeometry, bool)

Constructs the set-theoretic union of the inputs, with the option for non-planary result.

virtual IGeometry UnionEx(IGeometry other, bool bNonPlanar)

Parameters

other IGeometry
bNonPlanar bool

Returns

IGeometry

VertexAttribute[esriGeometryAttributes]

Any attribute (coordinate), except X or Y.

virtual double VertexAttribute[esriGeometryAttributes attributeType] { get; set; }

Parameters

attributeType esriGeometryAttributes

Returns

double

Within(IGeometry)

Indicates if this geometry is contained (is within) another geometry.

virtual bool Within(IGeometry other)

Parameters

other IGeometry

Returns

bool

Remarks

Only geometries that support the IRelationalOperator interface can be used as input geometries.

If geometry1 is Within geometry2, then geometry2 Contains geometry1.

An empty geometry is within another geometry, unless the other geometry is empty.

Within examples. Only "true" relationships are showed in this picture.

WithinEx(IGeometry, esriSpatialRelationExEnum)

Indicates if this geometry contains the other geometry, optionally using Celementini's definition.

virtual bool WithinEx(IGeometry pOther, esriSpatialRelationExEnum Relation)

Parameters

pOther IGeometry
Relation esriSpatialRelationExEnum

Returns

bool

X

The X coordinate.

virtual double X { get; set; }

Returns

double

Y

The Y coordinate.

virtual double Y { get; set; }

Returns

double

Remarks

 

Point Y Coord Example

[C#]

    // The following example shows how to set the x,y,z,m properties
    // for a point. Note that you need to tell the point to be
    // M- and Z-aware.
    public void DisplayCoordinates()
    {
        IPoint point = new PointClass();
        point.PutCoords(100, 100);
        IMAware mAware = point as IMAware;
        mAware.MAware = true;
        IZAware zAware = point as IZAware;
        zAware.ZAware = true;
        point.Z = 50;
        point.M = 10;
        System.Windows.Forms.MessageBox.Show(point.X + "," + point.Y + "," + point.Z + "," + point.M);
    }













Z

The Z attribute.

virtual double Z { get; set; }

Returns

double

ZAware

Indicates whether or not the geometry is aware of and capable of handling Zs.

virtual bool ZAware { get; set; }

Returns

bool

Remarks

Use ZAware = True when you want geometries to retain Z values during geometry operations.

[C#]

    private Double getZFromPoint(IPoint point)
    {
        return point.Z;
    }


ZMax

virtual double ZMax { get; }

Returns

double

ZMin

virtual double ZMin { get; }

Returns

double

ZSimple

Indicates if all the Zs are valid numbers.

virtual bool ZSimple { get; }

Returns

bool

ZVertical

virtual bool ZVertical { get; }

Returns

bool