WSL/SLF GitLab Repository

Commit ef432faf authored by Mathias Bavay's avatar Mathias Bavay
Browse files

Using the new Coords constructor and making the list of STATIONS in GRIBIO...

Using the new Coords constructor and making the list of STATIONS in GRIBIO support discontinuous numbering
parent ca875488
......@@ -173,48 +173,16 @@ void GRIBIO::setOptions()
void GRIBIO::readStations(std::vector<Coords> &vecPoints)
cfg.getValue("METEOPATH", "Input", meteopath_in);
size_t current_stationnr = 1;
string current_station;
do {
ostringstream ss;
ss << "STATION" << current_stationnr;
cfg.getValue(ss.str(), "Input", current_station, IOUtils::nothrow);
if (!current_station.empty()) {
addStation(current_station, vecPoints);
std::cerr << "\tRead virtual station " << vecPoints.back().printLatLon() << "\n";
} while (!current_station.empty());
std::vector<std::string> vecStation;
cfg.getValues("STATION", "INPUT", vecStation);
for(size_t ii=0; ii<vecStation.size(); ii++) {
Coords tmp(coordin, coordinparam, vecStation[ii]);
vecPoints.push_back( tmp );
void GRIBIO::addStation(const std::string& coord_spec, std::vector<Coords> &vecPoints)
std::istringstream iss(coord_spec);
double coord1=IOUtils::nodata, coord2=IOUtils::nodata;
int epsg=IOUtils::inodata;
iss >> std::skipws >> coord1;
iss >> std::skipws >> coord2;
iss >> std::skipws >> epsg;
if(coord1!=IOUtils::nodata && coord2!=IOUtils::nodata && epsg!=IOUtils::inodata) {
Coords point;
point.setXY(coord1, coord2, IOUtils::nodata);
if(coord1!=IOUtils::nodata && coord2!=IOUtils::nodata) {
Coords point(coordin, coordinparam);
point.setLatLon(coord1, coord2, IOUtils::nodata);
std::cerr << "\tRead virtual station " << vecPoints.back().printLatLon() << "\n";
throw InvalidArgumentException("Coordinate specification \""+coord_spec+"\" is invalid!", AT);
void GRIBIO::listKeys(grib_handle** h, const std::string& filename)
......@@ -71,7 +71,6 @@ class GRIBIO : public IOInterface {
void read2DGrid(const std::string& filename, Grid2DObject& grid_out, const MeteoGrids::Parameters& parameter, const Date& date);
void readWind(const std::string& filename, const Date& date);
void indexFile(const std::string& filename);
void addStation(const std::string& coord_spec, std::vector<Coords> &vecPoints);
void readStations(std::vector<Coords> &vecPoints);
void listKeys(grib_handle** h, const std::string& filename);
void scanMeteoPath();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment