Skip to content

Commit

Permalink
QgsCoordinateTransform::transformCoords(): do not convert elevations …
Browse files Browse the repository at this point in the history
…to radians

Fixes #14702
  • Loading branch information
rouault committed Jun 28, 2016
1 parent 0b502c9 commit 0de1bfa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/core/qgscoordinatetransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ void QgsCoordinateTransform::transformCoords( int numPoints, double *x, double *
{
x[i] *= DEG_TO_RAD;
y[i] *= DEG_TO_RAD;
z[i] *= DEG_TO_RAD;
}

}
Expand Down Expand Up @@ -736,7 +735,6 @@ void QgsCoordinateTransform::transformCoords( int numPoints, double *x, double *
{
x[i] *= RAD_TO_DEG;
y[i] *= RAD_TO_DEG;
z[i] *= RAD_TO_DEG;
}
}
#ifdef COORDINATE_TRANSFORM_VERBOSE
Expand Down
6 changes: 3 additions & 3 deletions tests/src/core/testqgsgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ void TestQgsGeometry::pointV2()
p16.transform( tr, QgsCoordinateTransform::ForwardTransform );
QVERIFY( qgsDoubleNear( p16.x(), 175.771, 0.001 ) );
QVERIFY( qgsDoubleNear( p16.y(), -39.722, 0.001 ) );
QVERIFY( qgsDoubleNear( p16.z(), 57.2958, 0.001 ) );
QVERIFY( qgsDoubleNear( p16.z(), 1.0, 0.001 ) );
QCOMPARE( p16.m(), 2.0 );
p16.transform( tr, QgsCoordinateTransform::ReverseTransform );
QVERIFY( qgsDoubleNear( p16.x(), 6374985, 1 ) );
Expand Down Expand Up @@ -1489,11 +1489,11 @@ void TestQgsGeometry::lineStringV2()
l22.transform( tr, QgsCoordinateTransform::ForwardTransform );
QVERIFY( qgsDoubleNear( l22.pointN( 0 ).x(), 175.771, 0.001 ) );
QVERIFY( qgsDoubleNear( l22.pointN( 0 ).y(), -39.722, 0.001 ) );
QVERIFY( qgsDoubleNear( l22.pointN( 0 ).z(), 57.2958, 0.001 ) );
QVERIFY( qgsDoubleNear( l22.pointN( 0 ).z(), 1.0, 0.001 ) );
QCOMPARE( l22.pointN( 0 ).m(), 2.0 );
QVERIFY( qgsDoubleNear( l22.pointN( 1 ).x(), 176.959, 0.001 ) );
QVERIFY( qgsDoubleNear( l22.pointN( 1 ).y(), -38.798, 0.001 ) );
QVERIFY( qgsDoubleNear( l22.pointN( 1 ).z(), 171.887, 0.001 ) );
QVERIFY( qgsDoubleNear( l22.pointN( 1 ).z(), 3.0, 0.001 ) );
QCOMPARE( l22.pointN( 1 ).m(), 4.0 );

//reverse transform
Expand Down

0 comments on commit 0de1bfa

Please sign in to comment.