Class MapGeometry

java.lang.Object
com.esri.core.geometry.MapGeometry
All Implemented Interfaces:
Serializable

public class MapGeometry extends Object implements Serializable
The MapGeometry class bundles the geometry with its spatial reference together. To work with a geometry object in a map it is necessary to have a spatial reference defined for this geometry.
See Also:
  • Field Details

  • Constructor Details

    • MapGeometry

      public MapGeometry(Geometry g, SpatialReference _sr)
      Construct a MapGeometry instance using the specified geometry instance and its corresponding spatial reference.
      Parameters:
      g - The geometry to construct the new MapGeometry object.
      _sr - The spatial reference of the geometry.
  • Method Details

    • getGeometry

      public Geometry getGeometry()
      Gets the only geometry without the spatial reference from the MapGeometry.
    • setGeometry

      public void setGeometry(Geometry geometry)
      Sets the geometry for this MapGeometry.
      Parameters:
      geometry - The geometry.
    • setSpatialReference

      public void setSpatialReference(SpatialReference sr)
      Sets the spatial reference for this MapGeometry.
      Parameters:
      sr - The spatial reference.
    • getSpatialReference

      public SpatialReference getSpatialReference()
      Gets the spatial reference for this MapGeometry.
    • toString

      public String toString()
      The output of this method can be only used for debugging. It is subject to change without notice.
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • estimateMemorySize

      public long estimateMemorySize()
      Returns an estimate of this object size in bytes.

      This estimate doesn't include the size of the SpatialReference object because instances of SpatialReference are expected to be shared among geometry objects.

      Returns:
      Returns an estimate of this object size in bytes.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object