mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-03 15:43:09 +00:00
MainTab location coordinates displayed in ISO6709 format
changes the location coordinates display in the main tab to use ISO6709(2008) Annex D suggested format. Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
41876f974e
commit
65eb86f854
1 changed files with 9 additions and 6 deletions
|
@ -974,7 +974,8 @@ void MainTab::editWeightWidget(const QModelIndex& index)
|
||||||
QString MainTab::printGPSCoords(int lat, int lon)
|
QString MainTab::printGPSCoords(int lat, int lon)
|
||||||
{
|
{
|
||||||
unsigned int latdeg, londeg;
|
unsigned int latdeg, londeg;
|
||||||
unsigned int ilatmin, ilonmin;
|
unsigned int latmin, lonmin;
|
||||||
|
double latsec, lonsec;
|
||||||
QString lath, lonh, result;
|
QString lath, lonh, result;
|
||||||
|
|
||||||
if (!lat && !lon)
|
if (!lat && !lon)
|
||||||
|
@ -986,11 +987,13 @@ QString MainTab::printGPSCoords(int lat, int lon)
|
||||||
lon = abs(lon);
|
lon = abs(lon);
|
||||||
latdeg = lat / 1000000;
|
latdeg = lat / 1000000;
|
||||||
londeg = lon / 1000000;
|
londeg = lon / 1000000;
|
||||||
ilatmin = (lat % 1000000) * 60;
|
latmin = (lat % 1000000) * 60;
|
||||||
ilonmin = (lon % 1000000) * 60;
|
lonmin = (lon % 1000000) * 60;
|
||||||
result.sprintf("%s%u%s %2d.%05d\' , %s%u%s %2d.%05d\'",
|
latsec = (latmin % 1000000) * 60;
|
||||||
lath.toUtf8().data(), latdeg, UTF8_DEGREE, ilatmin / 1000000, (ilatmin % 1000000) / 10,
|
lonsec = (lonmin % 1000000) * 60;
|
||||||
lonh.toUtf8().data(), londeg, UTF8_DEGREE, ilonmin / 1000000, (ilonmin % 1000000) / 10);
|
result.sprintf("%u%s%02d\'%06.3f\"%s %u%s%02d\'%06.3f\"%s",
|
||||||
|
latdeg, UTF8_DEGREE, latmin / 1000000, latsec / 1000000, lath.toUtf8().data(),
|
||||||
|
londeg, UTF8_DEGREE, lonmin / 1000000, lonsec / 1000000, lonh.toUtf8().data());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue