Package edu.ie3.datamodel.io.source
Interface IdCoordinateSource
- All Superinterfaces:
DataSource
- All Known Implementing Classes:
CsvIdCoordinateSource
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 TypeMethodDescriptionCollection<org.locationtech.jts.geom.Point>
Returns all the coordinates of this sourceOptional<org.locationtech.jts.geom.Point>
getCoordinate
(int id) Get the matching coordinate for the given IDCollection<org.locationtech.jts.geom.Point>
getCoordinates
(int... ids) Get the matching coordinates for the given IDsgetId
(org.locationtech.jts.geom.Point coordinate) Get the ID for the coordinate pointdefault 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 pointsdefault 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
Get the matching coordinate for the given ID- Parameters:
id
- the ID to look up- Returns:
- matching coordinate
-
getCoordinates
Get the matching coordinates for the given IDs- Parameters:
ids
- the IDs to look up- Returns:
- the matching coordinates
-
getId
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 forn
- 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 forn
- how many neighbours to look upcoordinates
- the collection of points- Returns:
- the n nearest coordinates to the given point
-