Skip to content
Permalink
Browse files

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 586e14cbe69705284fe65d42822aedccbbf9f29f
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/app/gps/qgsgpsinformationwidget.cpp
@@ -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 );

0 comments on commit 586e14c

Please sign in to comment.
You can’t perform that action at this time.