Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix recording of points for live GPS tracking (fixes #14996)
(cherry picked from commit 1cb4adc)
  • Loading branch information
wonder-sk committed Jul 5, 2016
1 parent cd35952 commit 586e14c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/app/gps/qgsgpsinformationwidget.cpp
Expand Up @@ -817,19 +817,16 @@ void QgsGPSInformationWidget::on_mBtnCloseFeature_clicked()
{
QgsFeature* f = new QgsFeature( 0 );

int size = 0;
int wkbtype = 0;

QgsCoordinateTransform t( mWgs84CRS, vlayer->crs() );
QgsPoint myPoint = t.transform( mLastGpsPosition );
double x = myPoint.x();
double y = myPoint.y();

size = 1 + sizeof( int ) + 2 * sizeof( double );
int size = 1 + sizeof( int ) + 2 * sizeof( double );
unsigned char *buf = new unsigned char[size];

QgsWkbPtr wkbPtr( buf, size );
wkbPtr << ( char ) QgsApplication::endian() << wkbtype << x << y;
wkbPtr << ( char ) QgsApplication::endian() << QGis::WKBPoint << x << y;

QgsGeometry *g = new QgsGeometry();
g->fromWkb( buf, size );
Expand Down

0 comments on commit 586e14c

Please sign in to comment.