Assembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public sealed class Multipoint : Geometry, IXmlSerializable |
Visual Basic (Declaration) |
---|
Public NotInheritable Class Multipoint _ Inherits Geometry _ Implements IXmlSerializable |
Remarks
A Multipoint geometry represents an unordered collection of single locations in space, and can be used to represent geographical features which have multiple single locations but which represent a single geographical feature, for example the multiple entrances to a single rabbit warren. Often a geographical feature may be modeled as either multiple Point features with the same attribute, or a single Multipoint feature. Multipoints may be found as the Geometry in a spatially-enabled Table, or as the Geometry of a Graphic.
A Multipoint geometry comprises multiple Point objects; Point objects are used to build up or change a Multipoint geometry (for example by using the AddPoint, InsertPoint, RemovePointAt, or SetPoint methods), or to retrieve information about the Multipoint (GetPoint). Unlike the Polygon and Polyline classes, which also comprise multiple Points, a Multipoint is composed of a single set of Points.
The Points of a Multipoint are retrieved and set by value.
Examples
// Create a new Multipoint, allowing the default CoordinateSystem of WGS84. Multipoint mpt = new Multipoint(); // Add a series of points to the Multipoint (overloads are available to add multiple Points). mpt.AddPoint(new ESRI.ArcGISExplorer.Geometry.Point(-5.004, 56.797)); mpt.AddPoint(new ESRI.ArcGISExplorer.Geometry.Point(-5.016, 56.802)); mpt.AddPoint(new ESRI.ArcGISExplorer.Geometry.Point(-5.021, 56.786)); // Create a Note using the Multipoint shape. Note cuillins = new Note("Ben Nevis", mpt, Symbol.Marker.Recreation.Mountain); // Populate the Note popup information using information about the Multipoint. StringBuilder info = new StringBuilder(@"<p><a href=""http://en.wikipedia.org/wiki/Ben_Nevis"">Ben Nevis Tops</a></p>"); info.AppendLine(@"<p>Ben Nevis has a main peak and two separate tops, located at:</p>"); for (int i = 0; i < mpt.PointCount; i++) { ESRI.ArcGISExplorer.Geometry.Point pt = mpt.GetPoint(i); info.AppendLine(@"<p>" + i.ToString() + ": " + pt.ToString() + @"</p>"); } MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay; cuillins.Popup.Content = info.ToString(); // Add the Note to the current Map. disp.Map.ChildItems.Add(cuillins);
' Create a new Multipoint, allowing the default CoordinateSystem of WGS84. Dim mpt As New Multipoint() ' Add a series of points to the Multipoint (overloads are available to add multiple Points). mpt.AddPoint(New ESRI.ArcGISExplorer.Geometry.Point(-5.004, 56.797)) mpt.AddPoint(New ESRI.ArcGISExplorer.Geometry.Point(-5.016, 56.802)) mpt.AddPoint(New ESRI.ArcGISExplorer.Geometry.Point(-5.021, 56.786)) ' Create a Note using the Multipoint shape. Dim cuillins As New Note("Ben Nevis", mpt, Symbol.Marker.Recreation.Mountain) ' Populate the Note popup information using information about the Multipoint. Dim info As New StringBuilder("<p><a href=""http://en.wikipedia.org/wiki/Ben_Nevis"">Ben Nevis Tops</a></p>") info.AppendLine("<p>Ben Nevis has a main peak and two separate tops, located at:</p>") Dim i As Integer = 0 While i < mpt.PointCount Dim pt As ESRI.ArcGISExplorer.Geometry.Point = mpt.GetPoint(i) info.AppendLine("<p>" + i.ToString() + ": " + pt.ToString() + "</p>") System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1) End While Dim disp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay cuillins.Popup.Content = info.ToString() ' Add the Note to the current Map. disp.Map.ChildItems.Add(cuillins)
Inheritance Hierarchy
ESRI.ArcGISExplorer.Geometry..::.Geometry
ESRI.ArcGISExplorer.Geometry..::.Multipoint