Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SimAquaLife
GR3D
Commits
c0d107ce
Commit
c0d107ce
authored
Aug 10, 2020
by
patrick.lambert
Browse files
with message about correspondace bteween fields and headers
parent
c2484d03
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/environment/RIOBasinNetworkWithContinent.java
View file @
c0d107ce
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment