BufferedReader reader = new BufferedReader(new FileReader(path));
CsvEntityReader csvEntityReader = new CsvEntityReader();
csvEntityReader.addEntityHandler(new EntityHandler() {
@Override
public void handleEntity(Object bean) {
StationLocation stationLocation = (StationLocation) bean;
Point2D.Double xy = ProjectionSupport.convertFromLatLon(
stationLocation.getLat(), stationLocation.getLon());
stationLocation.setX(xy.x);
stationLocation.setY(xy.y);
_stationLocationsByTiploc.put(stationLocation.getTiploc(),
stationLocation);
}
});
csvEntityReader.readEntities(StationLocation.class, reader);
reader.close();