Class CsvIdCoordinateSource

java.lang.Object
edu.ie3.datamodel.io.source.csv.CsvDataSource
edu.ie3.datamodel.io.source.csv.CsvIdCoordinateSource
All Implemented Interfaces:
DataSource, IdCoordinateSource

public class CsvIdCoordinateSource extends CsvDataSource implements IdCoordinateSource
Implementation of IdCoordinateSource to read the mapping between coordinate id and actual coordinate from csv file and build a mapping from it.
  • Constructor Details

  • Method Details

    • getCoordinate

      public Optional<org.locationtech.jts.geom.Point> getCoordinate(int id)
      Description copied from interface: IdCoordinateSource
      Get the matching coordinate for the given ID
      Specified by:
      getCoordinate in interface IdCoordinateSource
      Parameters:
      id - the ID to look up
      Returns:
      matching coordinate
    • getCoordinates

      public Collection<org.locationtech.jts.geom.Point> getCoordinates(int... ids)
      Description copied from interface: IdCoordinateSource
      Get the matching coordinates for the given IDs
      Specified by:
      getCoordinates in interface IdCoordinateSource
      Parameters:
      ids - the IDs to look up
      Returns:
      the matching coordinates
    • getId

      public Optional<Integer> getId(org.locationtech.jts.geom.Point coordinate)
      Description copied from interface: IdCoordinateSource
      Get the ID for the coordinate point
      Specified by:
      getId in interface IdCoordinateSource
      Parameters:
      coordinate - the coordinate to look up
      Returns:
      the matching ID
    • getAllCoordinates

      public Collection<org.locationtech.jts.geom.Point> getAllCoordinates()
      Description copied from interface: IdCoordinateSource
      Returns all the coordinates of this source
      Specified by:
      getAllCoordinates in interface IdCoordinateSource
      Returns:
      all available coordinates
    • getCoordinateCount

      public int getCoordinateCount()
    • buildStreamWithFieldsToAttributesMap

      protected Stream<Map<String,String>> buildStreamWithFieldsToAttributesMap()
      Build a stream with mappings from field identifiers to attributes
      Returns:
      Stream with mappings from field identifiers to attributes