Package edu.ie3.datamodel.io.source.csv
Class CsvIdCoordinateSource
java.lang.Object
edu.ie3.datamodel.io.source.csv.CsvDataSource
edu.ie3.datamodel.io.source.csv.CsvIdCoordinateSource
- All Implemented Interfaces:
DataSource
,IdCoordinateSource
Implementation of
IdCoordinateSource
to read the mapping between coordinate id and actual
coordinate from csv file and build a mapping from it.-
Field Summary
Fields inherited from class edu.ie3.datamodel.io.source.csv.CsvDataSource
connector, csvSep, FIELDS_TO_VALUES_MAP, log, NODE, NODE_A, NODE_B, OPERATOR, TYPE
-
Constructor Summary
ConstructorDescriptionCsvIdCoordinateSource
(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy, IdCoordinateFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionBuild a stream with mappings from field identifiers to attributesCollection<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 IDint
Collection<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 pointMethods inherited from class edu.ie3.datamodel.io.source.csv.CsvDataSource
assetInputEntityDataStream, assetInputEntityDataStream, buildStreamWithFieldsToAttributesMap, buildStreamWithFieldsToAttributesMap, csvRowFieldValueMapping, distinctRowsWithLog, findFirstEntityByUuid, getAssetType, isPresentCollectIfNot, logSkippingWarning, nodeAssetEntityStream, nodeAssetInputEntityDataStream, parseCsvRow, printInvalidElementInformation, saveMapGet, simpleEntityDataStream
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.ie3.datamodel.io.source.IdCoordinateSource
getNearestCoordinates, getNearestCoordinates
-
Constructor Details
-
CsvIdCoordinateSource
public CsvIdCoordinateSource(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy, IdCoordinateFactory factory)
-
-
Method Details
-
getCoordinate
Description copied from interface:IdCoordinateSource
Get the matching coordinate for the given ID- Specified by:
getCoordinate
in interfaceIdCoordinateSource
- Parameters:
id
- the ID to look up- Returns:
- matching coordinate
-
getCoordinates
Description copied from interface:IdCoordinateSource
Get the matching coordinates for the given IDs- Specified by:
getCoordinates
in interfaceIdCoordinateSource
- Parameters:
ids
- the IDs to look up- Returns:
- the matching coordinates
-
getId
Description copied from interface:IdCoordinateSource
Get the ID for the coordinate point- Specified by:
getId
in interfaceIdCoordinateSource
- Parameters:
coordinate
- the coordinate to look up- Returns:
- the matching ID
-
getAllCoordinates
Description copied from interface:IdCoordinateSource
Returns all the coordinates of this source- Specified by:
getAllCoordinates
in interfaceIdCoordinateSource
- Returns:
- all available coordinates
-
getCoordinateCount
public int getCoordinateCount() -
buildStreamWithFieldsToAttributesMap
Build a stream with mappings from field identifiers to attributes- Returns:
- Stream with mappings from field identifiers to attributes
-