Represents all kinds of geometrical shape. The Geometry class is inherited by the specialist geometry classes Point, Multipoint, Polygon, Polyline, Envelope and Multipatch.

Namespace:  ESRI.ArcGISExplorer.Geometry

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public class Geometry
Visual Basic (Declaration)
Public Class Geometry

Remarks

A geometry is an object defining a geometric shape. It provides access to properties and methods shared by all geometric objects; for example the center of the shape (GetCenter()()()), the bounding box of the shape (GetEnvelope()()()), and also the CoordinateSystem associated with the geometry which helps locate it exactly on the earth.

The Geometry class is a superclass for all classes representing different types of geometrical shapes in ArcGIS Explorer; Point, Multipoint, Polygon, Polyline, Envelope, and Multipatch.

A Geometry is returned from various members which can store different types of geometrical shape, for example Row.Geometry, Filter.Geometry, and Graphic.Geometry. Use the GeometryType property to determine which type of geometry is referenced (or alternatively try casting).

Examples

The example below summarizes the number of FeatureLayers in the current Map which have different types of geometry, using the GeometryType property of the FeatureLayer class.
CopyC#
// Get all of the FeatureLayers in the Map.
ESRI.ArcGISExplorer.Mapping.MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay;
System.Collections.ObjectModel.ReadOnlyCollection<FeatureLayer> flyrs = disp.Map.GetMapItems<FeatureLayer>();

// Count each type of feature layer geometry.
int ptLyrs = 0;
int mptLyrs = 0;
int plineLyrs = 0;
int pgonLyrs = 0;
int mpchLyrs = 0;
foreach (FeatureLayer lyr in flyrs)
{
  switch (lyr.GeometryType)
  {
    case GeometryType.Multipatch:
      mpchLyrs++;
      break;
    case GeometryType.Multipoint:
      mptLyrs++;
      break;
    case GeometryType.Point:
      ptLyrs++;
      break;
    case GeometryType.Polygon:
      pgonLyrs++;
      break;
    case GeometryType.Polyline:
      plineLyrs++;
      break;
    default:
      break;
  }

  System.Diagnostics.Debug.WriteLine("Point Layers: " + ptLyrs.ToString());
  System.Diagnostics.Debug.WriteLine("Multipoint Layers: " + mptLyrs.ToString());
  System.Diagnostics.Debug.WriteLine("Polyline Layers: " + plineLyrs.ToString());
  System.Diagnostics.Debug.WriteLine("Polygon Layers: " + pgonLyrs.ToString());
  System.Diagnostics.Debug.WriteLine("Multipatch Layers: " + mpchLyrs.ToString());
}
CopyVB.NET
' Get all of the FeatureLayers in the Map.
Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay
Dim flyrs As System.Collections.ObjectModel.ReadOnlyCollection(Of FeatureLayer) = disp.Map.GetMapItems(Of FeatureLayer)()

' Count each type of feature layer geometry.
Dim ptLyrs As Integer = 0
Dim mptLyrs As Integer = 0
Dim plineLyrs As Integer = 0
Dim pgonLyrs As Integer = 0
Dim mpchLyrs As Integer = 0
Dim lyr As FeatureLayer
For Each lyr In flyrs
  Select Case lyr.GeometryType
    Case GeometryType.Multipatch
      mpchLyrs += 1
    Case GeometryType.Multipoint
      mptLyrs += 1
    Case GeometryType.Point
      ptLyrs += 1
    Case GeometryType.Polygon
      pgonLyrs += 1
    Case GeometryType.Polyline
      plineLyrs += 1
    Case Else
  End Select

  System.Diagnostics.Debug.WriteLine(("Point Layers: " + ptLyrs.ToString()))
  System.Diagnostics.Debug.WriteLine(("Multipoint Layers: " + mptLyrs.ToString()))
  System.Diagnostics.Debug.WriteLine(("Polyline Layers: " + plineLyrs.ToString()))
  System.Diagnostics.Debug.WriteLine(("Polygon Layers: " + pgonLyrs.ToString()))
  System.Diagnostics.Debug.WriteLine(("Multipatch Layers: " + mpchLyrs.ToString()))
Next lyr

Inheritance Hierarchy

See Also