Skip to content

Commit

Permalink
Add new field for geoid-ellipsoid diff
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored and nyalldawson committed Jan 12, 2021
1 parent 1656ef2 commit 74d0532
Show file tree
Hide file tree
Showing 5 changed files with 182 additions and 159 deletions.
2 changes: 2 additions & 0 deletions python/core/auto_generated/gps/qgsgpsconnection.sip.in
Expand Up @@ -64,6 +64,8 @@ Encapsulates information relating to a GPS position fix.

double elevation;

double elevation_diff;

double speed;


Expand Down
1 change: 1 addition & 0 deletions src/app/gps/qgsgpsinformationwidget.cpp
Expand Up @@ -908,6 +908,7 @@ void QgsGpsInformationWidget::displayGPSInformation( const QgsGpsInformation &in
mTxtLatitude->setText( QString::number( info.latitude, 'f', 8 ) );
mTxtLongitude->setText( QString::number( info.longitude, 'f', 8 ) );
mTxtAltitude->setText( tr( "%1 m" ).arg( info.elevation, 0, 'f', 3 ) );
mTxtAltitudeDiff->setText( tr( "%1 m" ).arg( info.elevation_diff, 0, 'f', 3 ) );

if ( mDateTimeFormat.isEmpty() )
{
Expand Down
6 changes: 6 additions & 0 deletions src/core/gps/qgsgpsconnection.h
Expand Up @@ -128,6 +128,12 @@ class CORE_EXPORT QgsGpsInformation
*/
double elevation = 0;

/**
* Geoidal separation (Diff. between WGS-84 earth ellipsoid and
* mean sea level. -=geoid is below WGS-84 ellipsoid)
*/
double elevation_diff = 0;

/**
* Ground speed, in km/h.
*/
Expand Down
1 change: 1 addition & 0 deletions src/core/gps/qgsnmeaconnection.cpp
Expand Up @@ -188,6 +188,7 @@ void QgsNmeaConnection::processGgaSentence( const char *data, int len )
mLastGPSInformation.longitude = nmea_ndeg2degree( longitude );
mLastGPSInformation.latitude = nmea_ndeg2degree( latitude );
mLastGPSInformation.elevation = result.elv;
mLastGPSInformation.elevation_diff = result.diff;
mLastGPSInformation.quality = result.sig;
mLastGPSInformation.satellitesUsed = result.satinuse;
}
Expand Down

0 comments on commit 74d0532

Please sign in to comment.