Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
dda077e6
Unverified
Commit
dda077e6
authored
Aug 05, 2018
by
Don Gagne
Committed by
GitHub
Aug 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6763 from DonLakeFlyer/TerrainNaN
Terrain: Use NaN for bad elevation value
parents
dd3e9bf6
8fccae99
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
TerrainQuery.cc
src/Terrain/TerrainQuery.cc
+2
-2
TerrainTile.cc
src/TerrainTile.cc
+2
-2
No files found.
src/Terrain/TerrainQuery.cc
View file @
dda077e6
...
...
@@ -412,7 +412,7 @@ bool TerrainTileManager::_getAltitudesForCoordinates(const QList<QGeoCoordinate>
if
(
_tiles
.
contains
(
tileHash
))
{
if
(
_tiles
[
tileHash
].
isIn
(
coordinate
))
{
double
elevation
=
_tiles
[
tileHash
].
elevation
(
coordinate
);
if
(
elevation
<
0.0
)
{
if
(
qIsNaN
(
elevation
)
)
{
error
=
true
;
qCWarning
(
TerrainQueryLog
)
<<
"TerrainTileManager::_getAltitudesForCoordinates Internal Error: negative elevation in tile cache"
;
}
else
{
...
...
@@ -421,7 +421,7 @@ bool TerrainTileManager::_getAltitudesForCoordinates(const QList<QGeoCoordinate>
altitudes
.
push_back
(
elevation
);
}
else
{
qCWarning
(
TerrainQueryLog
)
<<
"TerrainTileManager::_getAltitudesForCoordinates Internal Error: coordinate not in tile region"
;
altitudes
.
push_back
(
-
1.0
);
altitudes
.
push_back
(
qQNaN
()
);
error
=
true
;
}
}
else
{
...
...
src/TerrainTile.cc
View file @
dda077e6
...
...
@@ -121,13 +121,13 @@ double TerrainTile::elevation(const QGeoCoordinate& coordinate) const
int
indexLon
=
_lonToDataIndex
(
coordinate
.
longitude
());
if
(
indexLat
==
-
1
||
indexLon
==
-
1
)
{
qCWarning
(
TerrainTileLog
)
<<
"Internal error indexLat:indexLon == -1"
<<
indexLat
<<
indexLon
;
return
-
1.0
;
return
qQNaN
()
;
}
qCDebug
(
TerrainTileLog
)
<<
"indexLat:indexLon"
<<
indexLat
<<
indexLon
<<
"elevation"
<<
_data
[
indexLat
][
indexLon
];
return
static_cast
<
double
>
(
_data
[
indexLat
][
indexLon
]);
}
else
{
qCWarning
(
TerrainTileLog
)
<<
"Asking for elevation, but no valid data."
;
return
-
1.0
;
return
qQNaN
()
;
}
}
...
...
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