com.ibm.geolib.geom

Interface Geometry

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Object clone() 
      boolean contains(Geometry geometry)
      Check if this geometry contains the given geometry
      boolean equals(Geometry geometry, double tolerance)
      Test if this is equal to the geometry up to the tolerance threshold value
      double getArea(AreaUnit units)
      Compute the area of this geometry using the exact mode
      double getArea(AreaUnit units, boolean isExactComputation)
      Compute the area of this geometry.
      BBox getBoundingBox()
      Get the minimal bounding box that contains this geometry
      <T extends Geometry> 
      java.util.Collection<T>
      getContained(java.util.Collection<T> geometries)
      Find geometries that are contained in this geometry.
      <T extends Geometry> 
      java.util.Collection<T>
      getContainers(java.util.Collection<T> geometries)
      Find geometries that are containing this geometry.
      CoordinateReferenceSystem getCoordinateReferenceSystem()
      Get coordinate reference system used to represents this geometry
      double getDistance(Geometry geometry, LengthUnit units)
      Compute the distance between this geometry and the given geometry.
      double getHeading()
      Heading in degrees from north - North is 0°, east is 90°, south is 180°, and west is 270°
      <T extends Geometry> 
      java.util.List<T>
      getKNearestNeighbors(java.util.Collection<T> geometries, int k)
      Find the k nearest neighbors of this geometry among a specified collection of geometries
      Geometry getNearestNeighbor(java.util.Collection<? extends Geometry> geometries)
      Find the nearest neighbor of this geometry among a specified collection of geometries
      Point getReferencePoint()
      Get the reference point for this geometry.
      double getSqrDistance(Geometry geometry, LengthUnit units)
      Compute the distance between this geometry and the given geometry.
      <T extends Geometry> 
      java.util.List<T>
      getWithinDistance(java.util.Collection<T> geometries, double maxDistance, LengthUnit units)
      Find geometries located within the specified distance from this geometry
      boolean intersects(Geometry geometry)
      Check if this geometry intersects the given geometry
      void setHeading(double heading) 
      void setReferencePoint(Point refPoint) 
      java.lang.String toString()
      String representation of the geometry
      java.lang.String toString(boolean printHeader)
      Get the string representation of the geometry
    • Method Detail

      • toString

        java.lang.String toString(boolean printHeader)
        Get the string representation of the geometry
        Parameters:
        printHeader - : whether to print the geometry type
        Returns:
        coordinate reference system
      • getCoordinateReferenceSystem

        CoordinateReferenceSystem getCoordinateReferenceSystem()
        Get coordinate reference system used to represents this geometry
        Returns:
        coordinate reference system
      • intersects

        boolean intersects(Geometry geometry)
        Check if this geometry intersects the given geometry
        Parameters:
        geometry -
        Returns:
        true - if this geometry intersects with the given 'geometry', otherwise - false
      • contains

        boolean contains(Geometry geometry)
        Check if this geometry contains the given geometry
        Parameters:
        geometry -
        Returns:
        true - if this geometry contains the given 'geometry', otherwise - false
      • getNearestNeighbor

        Geometry getNearestNeighbor(java.util.Collection<? extends Geometry> geometries)
        Find the nearest neighbor of this geometry among a specified collection of geometries
        Parameters:
        geometries - - a collection of geometries to look for the nearest neighbor
        Returns:
        a geometry nearest to this geometry out of the 'geometries' collection
      • getKNearestNeighbors

        <T extends Geometry> java.util.List<T> getKNearestNeighbors(java.util.Collection<T> geometries,
                                                                  int k)
        Find the k nearest neighbors of this geometry among a specified collection of geometries
        Parameters:
        geometries - - a collection of geometries to look for the k nearest neighbors
        k - - the number of geometries to find
        Returns:
        a list of k nearest geometries to this geometry out of the 'geometries' collection
      • getDistance

        double getDistance(Geometry geometry,
                         LengthUnit units)
        Compute the distance between this geometry and the given geometry.
        Parameters:
        geometry -
        units - specifies unit for measuring distance.
        Returns:
        the distance between this geometry and the given 'geometry' in the specified length units.
      • getSqrDistance

        double getSqrDistance(Geometry geometry,
                            LengthUnit units)
        Compute the distance between this geometry and the given geometry.
        Parameters:
        geometry -
        units - specifies unit for measuring distance.
        Returns:
        the distance between this geometry and the given 'geometry' in the specified length units.
      • getContained

        <T extends Geometry> java.util.Collection<T> getContained(java.util.Collection<T> geometries)
        Find geometries that are contained in this geometry.
        Parameters:
        geometries - - all possible contained geometries
        Returns:
        A collection of geometries from the 'geometries' parameter that are contained in this geometry.
      • getContainers

        <T extends Geometry> java.util.Collection<T> getContainers(java.util.Collection<T> geometries)
        Find geometries that are containing this geometry.
        Parameters:
        geometries - - a collection of all possible containing geometries
        Returns:
        A collection of geometries from the given 'geometries' collection that contain this geometry
      • getArea

        double getArea(AreaUnit units)
        Compute the area of this geometry using the exact mode
        Parameters:
        units - of area
        Returns:
        the computed area of this geometry in the given area units
      • getArea

        double getArea(AreaUnit units,
                     boolean isExactComputation)
        Compute the area of this geometry.
        Parameters:
        units - of area
        isExactComputation - - whether to use an exact but non-robust method or to use planar robust computation
        Returns:
        the computed area of this geometry in the given area units
      • clone

        java.lang.Object clone()
        Returns:
        a cloned instance of this geometry
      • equals

        boolean equals(Geometry geometry,
                     double tolerance)
        Test if this is equal to the geometry up to the tolerance threshold value
        Parameters:
        geometry - - geometry to test for equality
        tolerance - - a threshold for the distance between the coordinates
        Returns:
        true if the corresponding coordinates are within the tolerance distance, false - otherwise
      • getWithinDistance

        <T extends Geometry> java.util.List<T> getWithinDistance(java.util.Collection<T> geometries,
                                                               double maxDistance,
                                                               LengthUnit units)
        Find geometries located within the specified distance from this geometry
        Parameters:
        geometries - a collection of geometries to filter based on the proximity to this geometry
        maxDistance - - maximal distance at which a returned geometry must be
        units - - distance units
        Returns:
        a list of geometries from the 'geometries' collection that are within 'maxDistance' proximity to this geometry, calculated in 'units' of length, sorted by proximity (in ascending order)
      • getBoundingBox

        BBox getBoundingBox()
        Get the minimal bounding box that contains this geometry
        Returns:
        the minimal bounding box that contains this geometry
      • toString

        java.lang.String toString()
        String representation of the geometry
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of the geometry
      • getReferencePoint

        Point getReferencePoint()
        Get the reference point for this geometry. In case of rotation, the reference point defines the rotation axis.
        Returns:
        the reference point object, or null if reference point not set
      • getHeading

        double getHeading()
        Heading in degrees from north - North is 0°, east is 90°, south is 180°, and west is 270°
        Returns:
      • setReferencePoint

        void setReferencePoint(Point refPoint)
      • setHeading

        void setHeading(double heading)

© Copyright IBM 2017