1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-23 19:25:54 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2024-11-01 09:16:32 +01:00
parent 244a7670e7
commit b721a829b2

View File

@ -139,30 +139,6 @@ DEM::Entry *DEM::loadTile(const Tile &tile)
}
}
double DEM::elevation(const Coordinates &c)
{
if (_dir.isEmpty())
return NAN;
Tile tile(floor(c.lon()), floor(c.lat()));
_lock.lock();
Entry *e = _data.object(tile);
double ele;
if (!e) {
e = loadTile(tile);
ele = height(c, e);
_data.insert(tile, e, e->data().size() / 1024);
} else
ele = height(c, e);
_lock.unlock();
return ele;
}
double DEM::elevationLockFree(const Coordinates &c)
{
Tile tile(floor(c.lon()), floor(c.lat()));
@ -179,6 +155,18 @@ double DEM::elevationLockFree(const Coordinates &c)
return ele;
}
double DEM::elevation(const Coordinates &c)
{
if (_dir.isEmpty())
return NAN;
_lock.lock();
double ele = elevationLockFree(c);
_lock.unlock();
return ele;
}
MatrixD DEM::elevation(const MatrixC &m)
{
if (_dir.isEmpty())