Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
8fccae99
Commit
8fccae99
authored
Aug 04, 2018
by
Don Gagne
Browse files
Use NaN to signal lower level error
parent
dd3e9bf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Terrain/TerrainQuery.cc
View file @
8fccae99
...
...
@@ -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 @
8fccae99
...
...
@@ -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
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment