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
05452469
Commit
05452469
authored
Aug 02, 2018
by
Don Gagne
Browse files
Use qCWarning for internal errors
parent
0b049457
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/TerrainTile.cc
View file @
05452469
...
...
@@ -134,7 +134,7 @@ TerrainTile::TerrainTile(QByteArray byteArray)
bool
TerrainTile
::
isIn
(
const
QGeoCoordinate
&
coordinate
)
const
{
if
(
!
_isValid
)
{
qC
Debu
g
(
TerrainTileLog
)
<<
"isIn requested, but tile not valid"
;
qC
Warnin
g
(
TerrainTileLog
)
<<
"isIn requested, but tile not valid"
;
return
false
;
}
bool
ret
=
coordinate
.
latitude
()
>=
_southWest
.
latitude
()
&&
coordinate
.
longitude
()
>=
_southWest
.
longitude
()
&&
...
...
@@ -157,7 +157,7 @@ double TerrainTile::elevation(const QGeoCoordinate& coordinate) const
qCDebug
(
TerrainTileLog
)
<<
"indexLat:indexLon"
<<
indexLat
<<
indexLon
<<
"elevation"
<<
_data
[
indexLat
][
indexLon
];
return
static_cast
<
double
>
(
_data
[
indexLat
][
indexLon
]);
}
else
{
qC
Debu
g
(
TerrainTileLog
)
<<
"Asking for elevation, but no valid data."
;
qC
Warnin
g
(
TerrainTileLog
)
<<
"Asking for elevation, but no valid data."
;
return
-
1.0
;
}
}
...
...
@@ -284,6 +284,7 @@ int TerrainTile::_latToDataIndex(double latitude) const
if
(
isValid
()
&&
_southWest
.
isValid
()
&&
_northEast
.
isValid
())
{
return
qRound
((
latitude
-
_southWest
.
latitude
())
/
(
_northEast
.
latitude
()
-
_southWest
.
latitude
())
*
(
_gridSizeLat
-
1
));
}
else
{
qCWarning
(
TerrainTileLog
)
<<
"TerrainTile::_latToDataIndex internal error"
<<
isValid
()
<<
_southWest
.
isValid
()
<<
_northEast
.
isValid
();
return
-
1
;
}
}
...
...
@@ -293,6 +294,7 @@ int TerrainTile::_lonToDataIndex(double longitude) const
if
(
isValid
()
&&
_southWest
.
isValid
()
&&
_northEast
.
isValid
())
{
return
qRound
((
longitude
-
_southWest
.
longitude
())
/
(
_northEast
.
longitude
()
-
_southWest
.
longitude
())
*
(
_gridSizeLon
-
1
));
}
else
{
qCWarning
(
TerrainTileLog
)
<<
"TerrainTile::_lonToDataIndex internal error"
<<
isValid
()
<<
_southWest
.
isValid
()
<<
_northEast
.
isValid
();
return
-
1
;
}
}
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