Commit c0d107ce authored by patrick.lambert's avatar patrick.lambert
Browse files

with message about correspondace bteween fields and headers

parent c2484d03
......@@ -281,13 +281,22 @@ public class RIOBasinNetworkWithContinent extends RIOBasinNetwork {
scanner.useDelimiter(Pattern.compile("[;,\r\n]"));
// System.out.println(scanner.nextLine());
scanner.nextLine(); // skip the first line with headers
String[] headers = scanner.nextLine().split(","); // skip the first line with headers
String[] fields = { "basin_id", "name", "longitude", "latitude", "surface", "order", "pDam" };
System.out.println("\nCorrespondace between fields in " + RiverBasin.class.getSimpleName() + " and file columns in "
+ riverBasinFile);
for (int i = 0; i < headers.length; i++)
System.out.println(" " + fields[i] + " \t<-> " + headers[i]);
// while (scanner.hasNextLine()) {
// String[] values = scanner.nextLine().split(",");
while (scanner.hasNext()) {
basin_id = scanner.nextInt(); // gid
name = scanner.next();
surface = scanner.nextDouble();
longitude = scanner.nextDouble();
latitude = scanner.nextDouble();
surface = scanner.nextDouble();
order = scanner.nextInt();
if (useRealPDam == true) {
pDam = scanner.nextDouble();
......@@ -350,7 +359,7 @@ public class RIOBasinNetworkWithContinent extends RIOBasinNetwork {
}
// ================================== create offshore basins
// load features of riverBasins
// load features
String function;
List<OffshoreBasin> offshoreBasinsList = new ArrayList<OffshoreBasin>();
......@@ -364,8 +373,14 @@ public class RIOBasinNetworkWithContinent extends RIOBasinNetwork {
// separator !!!
scanner.useDelimiter(Pattern.compile("[;,\r\n]"));
// System.out.println(scanner.nextLine());
scanner.nextLine(); // skip the first line with headers
String[] headers = scanner.nextLine().split(","); // skip the first line with headers
String[] fields = { "basin_id", "name", "function" };
System.out.println("\nCorrespondace between fields in " + OffshoreBasin.class.getSimpleName()
+ " and file columns in " + riverBasinFile);
for (int i = 0; i < headers.length; i++)
System.out.println(" " + fields[i] + " \t<-> " + headers[i]);
while (scanner.hasNext()) {
basin_id = scanner.nextInt(); // gid
name = scanner.next();
......
Markdown is supported
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