Skip to content
Permalink
Browse files

QgsCoordinateTransform::transformCoords(): do not convert elevations …

…to radians

Fixes #14702
  • Loading branch information
rouault committed Jun 27, 2016
1 parent 0b502c9 commit 0de1bfaf58e6ab9c03712021a081b4f37d2651b6
Showing with 3 additions and 5 deletions.
  1. +0 −2 src/core/qgscoordinatetransform.cpp
  2. +3 −3 tests/src/core/testqgsgeometry.cpp
@@ -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;
}

}
@@ -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
@@ -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 ) );
@@ -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

0 comments on commit 0de1bfa

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