Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmitri Naumov
ogs
Commits
7c58641e
Commit
7c58641e
authored
12 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
Removed hardcoded paths for soilID/soilName relations in GMS Borehole export. This fixes #74
parent
7499ce3b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
FileIO/GMSInterface.cpp
+15
-46
15 additions, 46 deletions
FileIO/GMSInterface.cpp
FileIO/GMSInterface.h
+0
-5
0 additions, 5 deletions
FileIO/GMSInterface.h
Gui/DataView/StationTreeView.cpp
+5
-8
5 additions, 8 deletions
Gui/DataView/StationTreeView.cpp
with
20 additions
and
59 deletions
FileIO/GMSInterface.cpp
+
15
−
46
View file @
7c58641e
...
...
@@ -126,8 +126,7 @@ void GMSInterface::writeBoreholesToGMS(const std::vector<GeoLib::Point*>* statio
const
std
::
string
&
filename
)
{
std
::
ofstream
out
(
filename
.
c_str
(),
std
::
ios
::
out
);
std
::
size_t
idx
=
0
;
std
::
vector
<
std
::
string
>
soilID
=
readSoilIDfromFile
(
"d:/BodeTimeline.txt"
);
//std::vector<std::string> soilID = readSoilIDfromFile("d:/BodeTimeline.txt");
// write header
out
<<
"name"
<<
"
\t
"
<<
std
::
fixed
<<
"X"
<<
"
\t
"
<<
"Y"
<<
"
\t
"
<<
"Z"
<<
"
\t
"
<<
...
...
@@ -139,62 +138,32 @@ void GMSInterface::writeBoreholesToGMS(const std::vector<GeoLib::Point*>* statio
static_cast
<
GeoLib
::
StationBorehole
*>
((
*
stations
)[
j
]);
std
::
vector
<
GeoLib
::
Point
*>
profile
=
station
->
getProfile
();
std
::
vector
<
std
::
string
>
soilNames
=
station
->
getSoilNames
();
//std::size_t idx = 0;
std
::
string
current_soil_name
(
""
);
std
::
size_t
nLayers
=
profile
.
size
();
for
(
std
::
size_t
i
=
1
;
i
<
nLayers
;
i
++
)
{
if
(
(
i
>
1
)
&&
(
soilNames
[
i
].
compare
(
soilNames
[
i
-
1
])
==
0
)
)
continue
;
idx
=
getSoilID
(
soilID
,
soilNames
[
i
]);
out
<<
station
->
getName
()
<<
"
\t
"
<<
std
::
fixed
<<
(
*
(
profile
[
i
-
1
]))[
0
]
<<
"
\t
"
<<
(
*
(
profile
[
i
-
1
]))[
1
]
<<
"
\t
"
<<
(
*
(
profile
[
i
-
1
]))[
2
]
<<
"
\t
"
<<
idx
<<
std
::
endl
;
//idx = getSoilID(soilID, soilNames[i]);
current_soil_name
=
soilNames
[
i
];
out
<<
station
->
getName
()
<<
"
\t
"
<<
std
::
fixed
<<
(
*
(
profile
[
i
-
1
]))[
0
]
<<
"
\t
"
<<
(
*
(
profile
[
i
-
1
]))[
1
]
<<
"
\t
"
<<
(
*
(
profile
[
i
-
1
]))[
2
]
<<
"
\t
"
<<
current_soil_name
/*idx*/
<<
std
::
endl
;
}
out
<<
station
->
getName
()
<<
"
\t
"
<<
std
::
fixed
<<
(
*
(
profile
[
nLayers
-
1
]))[
0
]
<<
"
\t
"
<<
(
*
(
profile
[
nLayers
-
1
]))[
1
]
<<
"
\t
"
<<
(
*
(
profile
[
nLayers
-
1
]))[
2
]
<<
"
\t
"
<<
idx
<<
std
::
endl
;
// this line marks the end of the borehole
<<
(
*
(
profile
[
nLayers
-
1
]))[
1
]
<<
"
\t
"
<<
(
*
(
profile
[
nLayers
-
1
]))[
2
]
<<
"
\t
"
<<
current_soil_name
<<
std
::
endl
;
// this line marks the end of the borehole
}
out
.
close
();
GMSInterface
::
writeSoilIDTable
(
soilID
,
"d:/SoilIDReference.txt"
);
}
int
GMSInterface
::
writeBoreholeToGMS
(
const
GeoLib
::
StationBorehole
*
station
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>
&
soilID
)
{
std
::
ofstream
out
(
filename
.
c_str
(),
std
::
ios
::
out
);
std
::
size_t
idx
=
0
;
// write header
out
<<
"name"
<<
"
\t
"
<<
std
::
fixed
<<
"X"
<<
"
\t
"
<<
"Y"
<<
"
\t
"
<<
"Z"
<<
"
\t
"
<<
"soilID"
<<
std
::
endl
;
std
::
vector
<
GeoLib
::
Point
*>
profile
=
station
->
getProfile
();
std
::
vector
<
std
::
string
>
soilNames
=
station
->
getSoilNames
();
// write table
std
::
size_t
nLayers
=
profile
.
size
();
for
(
std
::
size_t
i
=
1
;
i
<
nLayers
;
i
++
)
{
if
(
(
i
>
1
)
&&
(
soilNames
[
i
].
compare
(
soilNames
[
i
-
1
])
==
0
)
)
continue
;
idx
=
getSoilID
(
soilID
,
soilNames
[
i
]);
out
<<
station
->
getName
()
<<
"
\t
"
<<
std
::
fixed
<<
(
*
(
profile
[
i
-
1
]))[
0
]
<<
"
\t
"
<<
(
*
(
profile
[
i
-
1
]))[
1
]
<<
"
\t
"
<<
(
*
(
profile
[
i
-
1
]))[
2
]
<<
"
\t
"
<<
idx
<<
std
::
endl
;
}
out
<<
station
->
getName
()
<<
"
\t
"
<<
std
::
fixed
<<
(
*
(
profile
[
nLayers
-
1
]))[
0
]
<<
"
\t
"
<<
(
*
(
profile
[
nLayers
-
1
]))[
1
]
<<
"
\t
"
<<
(
*
(
profile
[
nLayers
-
1
]))[
2
]
<<
"
\t
"
<<
idx
<<
std
::
endl
;
// this line marks the end of the borehole
out
.
close
();
return
1
;
//GMSInterface::writeSoilIDTable(soilID, "d:/SoilIDReference.txt");
}
std
::
size_t
GMSInterface
::
getSoilID
(
std
::
vector
<
std
::
string
>
&
soilID
,
std
::
string
&
soilName
)
...
...
This diff is collapsed.
Click to expand it.
FileIO/GMSInterface.h
+
0
−
5
View file @
7c58641e
...
...
@@ -50,11 +50,6 @@ public:
static
int
readBoreholesFromGMS
(
std
::
vector
<
GeoLib
::
Point
*>*
boreholes
,
const
std
::
string
&
filename
);
/// Exports borehole data from one borehole to a file in GMS-format.
static
int
writeBoreholeToGMS
(
const
GeoLib
::
StationBorehole
*
station
,
const
std
::
string
&
filename
,
std
::
vector
<
std
::
string
>
&
soilID
);
/// Writes a file that assigns each soilID-index in the GMS export file a name.
static
int
writeSoilIDTable
(
const
std
::
vector
<
std
::
string
>
&
soilID
,
const
std
::
string
&
filename
);
...
...
This diff is collapsed.
Click to expand it.
Gui/DataView/StationTreeView.cpp
+
5
−
8
View file @
7c58641e
...
...
@@ -199,14 +199,11 @@ void StationTreeView::exportStation()
if
(
!
fileName
.
isEmpty
())
{
QString
temp_name
;
std
::
vector
<
std
::
string
>
temp_soil_names
;
temp_soil_names
.
push_back
(
""
);
// soil name vector needs to be initialised
GMSInterface
::
writeBoreholeToGMS
(
static_cast
<
GeoLib
::
StationBorehole
*>
(
static_cast
<
StationTreeModel
*>
(
model
())
->
stationFromIndex
(
index
,
temp_name
)),
fileName
.
toStdString
(),
temp_soil_names
);
std
::
vector
<
GeoLib
::
Point
*>
stations
;
stations
.
push_back
(
static_cast
<
GeoLib
::
StationBorehole
*>
(
static_cast
<
StationTreeModel
*>
(
model
())
->
stationFromIndex
(
index
,
temp_name
)));
GMSInterface
::
writeBoreholesToGMS
(
&
stations
,
fileName
.
toStdString
());
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment