Commit f39df346 authored by Poulet Camille's avatar Poulet Camille
Browse files

Error GR3D String reading

Showing with 125 additions and 122 deletions
+125 -122
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<riverBasinShpFile>data/input/northeastamerica/shape/riverbasins.shp</riverBasinShpFile> <riverBasinShpFile>data/input/northeastamerica/shape/riverbasins.shp</riverBasinShpFile>
<continentShpFile>data/input/northeastamerica/shape/nea_continent.shp</continentShpFile> <continentShpFile>data/input/northeastamerica/shape/nea_continent.shp</continentShpFile>
<riverBasinNameLabel>NAME</riverBasinNameLabel> <riverBasinNameLabel>NAME</riverBasinNameLabel>
<seaBasinNameLabel>name</seaBasinNameLabel> <seaBasinNameLabel>NAME</seaBasinNameLabel>
<continentPathName>PATH</continentPathName> <continentPathName>PATH</continentPathName>
<distanceGridFileName>data/input/northeastamerica/distanceGridNEA.csv</distanceGridFileName> <distanceGridFileName>data/input/northeastamerica/distanceGridNEA.csv</distanceGridFileName>
<temperatureCatchmentFile>data/input/northeastamerica/basins_temperatures_from_1800.csv</temperatureCatchmentFile> <temperatureCatchmentFile>data/input/northeastamerica/basins_temperatures_from_1800.csv</temperatureCatchmentFile>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -396,16 +396,19 @@ public class BasinNetworkSWithContinent extends BasinNetwork { ...@@ -396,16 +396,19 @@ public class BasinNetworkSWithContinent extends BasinNetwork {
char[] charac = { '"' }; char[] charac = { '"' };
String doublequote = new String(charac); String doublequote = new String(charac);
scanner.nextLine(); // skip the first line with headers scanner.nextLine(); // skip the first line with headers
while (scanner.hasNext()) {
scanner.next(); // skip gid while (scanner.hasNextLine()) {
name = scanner.next(); String[] fields = scanner.nextLine().split(",");
// skip gid
name = fields[1];
name = name.replaceAll(new String(doublequote), ""); name = name.replaceAll(new String(doublequote), "");
year = (long) scanner.nextInt(); year = Long.valueOf (fields[2]);
Double[] seasonalTemperature = new Double[4]; Double[] seasonalTemperature = new Double[4];
seasonalTemperature[0] = scanner.nextDouble(); seasonalTemperature[0] = Double.valueOf(fields[3]);
seasonalTemperature[1] = scanner.nextDouble(); seasonalTemperature[1] = Double.valueOf(fields[4]);
seasonalTemperature[2] = scanner.nextDouble(); seasonalTemperature[2] = Double.valueOf(fields[5]);
seasonalTemperature[3] = scanner.nextDouble(); seasonalTemperature[3] = Double.valueOf(fields[6]);
// scanner.nextLine(); // scanner.nextLine();
// store seasonal temperatures for each basin for the // store seasonal temperatures for each basin for the
......
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