Interface IdCoordinateSource

All Superinterfaces:
DataSource
All Known Implementing Classes:
CsvIdCoordinateSource

public interface IdCoordinateSource extends DataSource
This class serves mapping purposes between the ID of a coordinate and the actual coordinate with latitude and longitude values, which is especially needed for data source that don't offer combined primary or foreign keys.
  • Method Summary

    Modifier and Type
    Method
    Description
    Collection<org.locationtech.jts.geom.Point>
    Returns all the coordinates of this source
    Optional<org.locationtech.jts.geom.Point>
    getCoordinate(int id)
    Get the matching coordinate for the given ID
    Collection<org.locationtech.jts.geom.Point>
    getCoordinates(int... ids)
    Get the matching coordinates for the given IDs
    getId(org.locationtech.jts.geom.Point coordinate)
    Get the ID for the coordinate point
    default List<edu.ie3.util.geo.CoordinateDistance>
    getNearestCoordinates(org.locationtech.jts.geom.Point coordinate, int n)
    Returns the nearest n coordinate points to the given coordinate from a collection of all available points
    default List<edu.ie3.util.geo.CoordinateDistance>
    getNearestCoordinates(org.locationtech.jts.geom.Point coordinate, int n, Collection<org.locationtech.jts.geom.Point> coordinates)
    Returns the nearest n coordinate points to the given coordinate from a given collection of points.
  • Method Details

    • getCoordinate

      Optional<org.locationtech.jts.geom.Point> getCoordinate(int id)
      Get the matching coordinate for the given ID
      Parameters:
      id - the ID to look up
      Returns:
      matching coordinate
    • getCoordinates

      Collection<org.locationtech.jts.geom.Point> getCoordinates(int... ids)
      Get the matching coordinates for the given IDs
      Parameters:
      ids - the IDs to look up
      Returns:
      the matching coordinates
    • getId

      Optional<Integer> getId(org.locationtech.jts.geom.Point coordinate)
      Get the ID for the coordinate point
      Parameters:
      coordinate - the coordinate to look up
      Returns:
      the matching ID
    • getAllCoordinates

      Collection<org.locationtech.jts.geom.Point> getAllCoordinates()
      Returns all the coordinates of this source
      Returns:
      all available coordinates
    • getNearestCoordinates

      default List<edu.ie3.util.geo.CoordinateDistance> getNearestCoordinates(org.locationtech.jts.geom.Point coordinate, int n)
      Returns the nearest n coordinate points to the given coordinate from a collection of all available points
      Parameters:
      coordinate - the coordinate to look up the nearest neighbours for
      n - how many neighbours to look up
      Returns:
      the n nearest coordinates to the given point
    • getNearestCoordinates

      default List<edu.ie3.util.geo.CoordinateDistance> getNearestCoordinates(org.locationtech.jts.geom.Point coordinate, int n, Collection<org.locationtech.jts.geom.Point> coordinates)
      Returns the nearest n coordinate points to the given coordinate from a given collection of points. If the set is empty or null we look through all coordinates.
      Parameters:
      coordinate - the coordinate to look up the nearest neighbours for
      n - how many neighbours to look up
      coordinates - the collection of points
      Returns:
      the n nearest coordinates to the given point