Package mil.nga.sf

Class Geometry

    • Constructor Detail

      • Geometry

        protected Geometry​(GeometryType geometryType,
                           boolean hasZ,
                           boolean hasM)
        Constructor
        Parameters:
        geometryType - geometry type
        hasZ - has z
        hasM - has m
    • Method Detail

      • getGeometryType

        public GeometryType getGeometryType()
        Get the geometry type
        Returns:
        geometry type
      • hasZ

        public boolean hasZ()
        Does the geometry have z coordinates
        Returns:
        true if has z coordinates
      • setHasZ

        public void setHasZ​(boolean hasZ)
        Set if the geometry has z coordinates
        Parameters:
        hasZ - true if has z coordinates
        Since:
        2.0.3
      • is3D

        public boolean is3D()
        Does the geometry have z coordinates
        Returns:
        true if has z coordinates
        See Also:
        hasZ()
      • hasM

        public boolean hasM()
        Does the geometry have m coordinates
        Returns:
        true if has m coordinates
      • setHasM

        public void setHasM​(boolean hasM)
        Set if the geometry has m coordinates
        Parameters:
        hasM - true if has m coordinates
        Since:
        2.0.3
      • updateZM

        protected void updateZM​(Geometry geometry)
        Update currently false hasZ and hasM values using the provided geometry
        Parameters:
        geometry - geometry
        Since:
        2.0.3
      • isMeasured

        public boolean isMeasured()
        Does the geometry have m coordinates.
        Returns:
        true if has m coordinates
        See Also:
        hasM()
      • getEnvelope

        public GeometryEnvelope getEnvelope()
        Get the minimum bounding box for this Geometry
        Returns:
        geometry envelope
      • expandEnvelope

        public void expandEnvelope​(GeometryEnvelope envelope)
        Expand the envelope with the minimum bounding box for this Geometry
        Parameters:
        envelope - geometry envelope to expand
        Since:
        2.0.5
      • getDimension

        public int getDimension()
        Get the inherent dimension (0, 1, or 2) for this Geometry
        Returns:
        dimension
      • getCentroid

        public Point getCentroid()
        Get the mathematical centroid point of a 2 dimensional representation of the Geometry (balancing point of a 2d cutout of the geometry). Only the x and y coordinate of the resulting point are calculated and populated. The resulting Point.getZ() and Point.getM() methods will always return null.
        Returns:
        centroid point
      • getDegreesCentroid

        public Point getDegreesCentroid()
        Get the geographic centroid point of a 2 dimensional representation of the degree unit Geometry. Only the x and y coordinate of the resulting point are calculated and populated. The resulting Point.getZ() and Point.getM() methods will always return null.
        Returns:
        centroid point
        Since:
        2.0.5
      • copy

        public abstract Geometry copy()
        Copy the geometry
        Returns:
        geometry copy
      • isEmpty

        public abstract boolean isEmpty()
        Is the Geometry empty
        Returns:
        true if empty
      • isSimple

        public abstract boolean isSimple()
        Determine if this Geometry has no anomalous geometric points, such as self intersection or self tangency
        Returns:
        true if simple
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object