Class MapGeometry

  • All Implemented Interfaces:
    java.io.Serializable

    public class MapGeometry
    extends java.lang.Object
    implements java.io.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:
    Serialized Form
    • Constructor Detail

      • 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 Detail

      • 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 java.lang.String toString()
        The output of this method can be only used for debugging. It is subject to change without notice.
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.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 java.lang.Object