Class Geometry<P extends Position>

    • Method Detail

      • forceToCrs

        public static <Q extends PositionGeometry<Q> forceToCrs​(Geometry<?> geometry,
                                                                  CoordinateReferenceSystem<Q> crs)
        Creates a new Geometry with the positions from the specified geometry and having the specified CoordinateReferenceSystem
        Type Parameters:
        Q - the Position type for the returned Geometry
        Parameters:
        geometry - source Geometry that supplies the Positions for the returned Geometry
        crs - the CoordinateReferenceSystem for the returned Geometry
        Returns:
        a Geometry with the positions of the specified geometry and having the specified CoordinateReferenceSystem
      • getCoordinateDimension

        public int getCoordinateDimension()
        Returns the coordinate dimension of this Geometry

        The coordinate dimension is the number of components in the coordinates of the points in this Geometry.

        Returns:
        the coordinate dimension
      • getCoordinateReferenceSystem

        public CoordinateReferenceSystem<P> getCoordinateReferenceSystem()
        Returns the coordinate reference system of this Geometry
        Returns:
        the coordinate reference system of this Geometry
      • getSRID

        public int getSRID()
        Returns the numeric identifier of the coordinate reference system of this Geometry.

        A SRID is usually interpreted as meaning the EPSG-code for the coordinate reference system. In this implementation, this is not enforced.

        Returns:
        the numeric identifier of the coordinate reference system of this Geometry.
      • isEmpty

        public boolean isEmpty()
        Tests whether this Geometry corresponds to the empty set.
        Returns:
        true if this Geometry corresponds to the empty set, false otherwise.
      • getNumPositions

        public int getNumPositions()
        Returns the number of positions in the PositionSequence of this Geometry.
        Returns:
        the number of positions in the PositionSequence of this Geometry.
      • getPositionClass

        public Class<P> getPositionClass()
      • getPositionN

        public P getPositionN​(int index)
        Returns the position at the specified index in the PositionSequence of this Geometry.
        Parameters:
        index - the position in the PositionSequence (first point is at index 0).
        Returns:
        the position at the specified index in the PositionSequence of this Geometry.
      • checkCast

        protected <Q extends Position> void checkCast​(Class<Q> castToType)
        Checks whether a cast should succeed
        Type Parameters:
        Q -
        Parameters:
        castToType -
      • getPositions

        public PositionSequence<P> getPositions()
        Returns the PositionSequence of this instance
        Returns:
        the PositionSequence of this instance
      • getEnvelope

        public Envelope<P> getEnvelope()
        Returns the Envelope of this instance.
        Returns:
        the Envelope of this instance.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getGeometryType

        public abstract GeometryType getGeometryType()
        Returns the type of this Geometry.
        Returns:
        the GeometryType of this instance.
      • toString

        public String toString()
        Returns the Well-Known Text (WKT) representation of this Geometry.
        Overrides:
        toString in class Object
        Returns:
        the Well-Known Text (WKT) representation of this Geometry.
      • getDimension

        public abstract int getDimension()
        Returns the topological dimension of this instance. In non-homogenous collections, this will return the largest topological dimension of the contained Geometries.
        Returns:
        the topological dimension of this instance
      • accept

        public abstract void accept​(GeometryVisitor<P> visitor)
        Accepts a GeometryVisitor.

        If this Geometry instance is a GeometryCollection then it will pass the visitor to its contained Geometries.

        Parameters:
        visitor -