Interface Multipoint

Namespace
ESRI.ArcGIS.Geometry
Assembly
ESRI.Server.Geometry.dll

An ordered collection of points; optionally has measure, height and ID attributes.

[Guid("DE08A214-4FC2-11D1-834E-0000F8775BE9")]
public interface Multipoint : IPointCollection
Inherited Members

Remarks

Note: The order of the points and their number can be modified by ITopologicalOperator::Simplify. Simplify sorts the points by X and Y and removes duplicate.

[C#]

 

        private static object _missing = Type.Missing;

 

        public static IGeometry GetMultipointGeometry()

        {

               const double MultipointPointCount = 25;

               IPointCollection pointCollection = new MultipointClass();

 

               for (int i = 0; i < MultipointPointCount; i++)

               {

                      pointCollection.AddPoint(GetPoint(), ref _missing, ref _missing);

               }

 

MakeZAware(pointCollection as IGeometry);

 

               return pointCollection as IGeometry;

        }

        private static IPoint GetPoint()

        {

            const double Min = -10;

            const double Max = 10;

 

            Random random = new Random();

 

            double x = Min + (Max - Min) * random.NextDouble();

            double y = Min + (Max - Min) * random.NextDouble();

            double z = Min + (Max - Min) * random.NextDouble();

 

            return ConstructPoint3D(x, y, z);

        }

 

        private static IPoint ConstructPoint3D(double x, double y, double z)

        {

            IPoint point = ConstructPoint2D(x, y);

            point.Z = z;

           

return point;

        }




        private static IPoint ConstructPoint2D(double x, double y)

        {

            IPoint point = new PointClass();

            point.PutCoords(x, y);
 

            return point;

        }

        private static void MakeZAware(IGeometry geometry)

        {

            IZAware zAware = geometry as IZAware;

            zAware.ZAware = true;

        }