Represents a single location in space.
Namespace:
ESRI.ArcGISExplorer.GeometryAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public sealed class Point : Geometry, IXmlSerializable |
Visual Basic (Declaration) |
---|
Public NotInheritable Class Point _ Inherits Geometry _ Implements IXmlSerializable |
Remarks
A Point represents a single location in space, defined by a set of X, Y and Z coordinates.
Point objects are creatable. Points are also used frequently throughout the ArcGIS Explorer namespaces for many purposes, for example:
- The Row.Geometry property may return a Point object if the spatial table contains points.
- The MapDisplay.TrackPoint method allows the user to click on the map and create a new point at the clicked location.
- The shape of Polygon, Polyline and Multipoint geometries is defined by individual points.
- A Viewpoint can be created from two Point objects, representing an observer and target which define the viewing extent of the MapDisplay when in 3D.
In geographical coordinate systems, the X coordinate is equivalent to the longitude, and the Y coordinate is equivalent to the longitude. See the [O:ESRI.ArcGISExplorer.Geometry.Point.CreateFromLatitudeLongitude] and GetLatitudeLongitude(Double%, Double%) methods.
Examples
The code below demonstrates the creation of a Point object using a parameterized constructor to set the coordinates and CoordinateSystem
of the Point. The Point is then added as a Note to the current map in the application, and the overridden ToString method is used to
add information about the Point to the Popup of the new Note.
The Point variable is declared using the full namespace, to avoid clashes with the System.Drawing.Point class.
CopyC#
// Create a new Multipoint, using the British National Grid CoordinateSystem. ESRI.ArcGISExplorer.Geometry.Point benNevis = new ESRI.ArcGISExplorer.Geometry.Point(-5.004, 56.797, CoordinateSystem.ProjectedCoordinateSystems.NationalGrids.Europe.BritishNationalGrid); // Create a Note using the Point geometry. Note benNevisNote = new Note("Ben Nevis", benNevis, Symbol.Marker.Recreation.Mountain); // Populate the Note popup with information about the Point geometry using the ToString method. StringBuilder info = new StringBuilder(@"<p><a href=""http://en.wikipedia.org/wiki/Ben_Nevis"">Ben Nevis</a></p>"); info.AppendLine(@"<p>" + benNevis.ToString() + @"</p>"); MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay; benNevisNote.Popup.Content = info.ToString(); // Add the Note to the current Map. disp.Map.ChildItems.Add(benNevisNote);
CopyVB.NET
' Create a new Multipoint, using the British National Grid CoordinateSystem. Dim benNevis As ESRI.ArcGISExplorer.Geometry.Point = New ESRI.ArcGISExplorer.Geometry.Point(-5.004, 56.797, CoordinateSystem.ProjectedCoordinateSystems.NationalGrids.Europe.BritishNationalGrid) ' Create a Note using the Point geometry. Dim benNevisNote As Note = New Note("Ben Nevis", benNevis, Symbol.Marker.Recreation.Mountain) ' Populate the Note popup with information about the Point geometry using the ToString method. Dim info As StringBuilder = New StringBuilder("<p><a href=""http://en.wikipedia.org/wiki/Ben_Nevis"">Ben Nevis</a></p>") info.AppendLine("<p>" + benNevis.ToString() + "</p>") Dim disp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay benNevisNote.Popup.Content = info.ToString() ' Add the Note to the current Map. disp.Map.ChildItems.Add(benNevisNote)