Skip to content
Permalink
Browse files

Projecting a 2D point with inclination assumes 0 for Z

  • Loading branch information
m-kuhn committed Jun 14, 2017
1 parent 41892d3 commit 96cf4b7026f4fca8106bd8a3a0ec8a25d37e8bf5
Showing with 4 additions and 3 deletions.
  1. +1 −1 python/core/geometry/qgspoint.sip
  2. +2 −1 src/core/geometry/qgspoint.cpp
  3. +1 −1 src/core/geometry/qgspoint.h
@@ -269,7 +269,7 @@ class QgsPoint: QgsAbstractGeometry
M value is preserved.
\param distance distance to project
\param azimuth angle to project in X Y, clockwise in degrees starting from north
\param inclination angle to project in Z (3D)
\param inclination angle to project in Z (3D). If the point is 2D, the Z value is assumed to be 0.
:return: The point projected. If a 2D point is projected a 3D point will be returned except if
inclination is 90. A 3D point is always returned if a 3D point is projected.
Example:
@@ -546,5 +546,6 @@ QgsPoint QgsPoint::project( double distance, double azimuth, double inclination
pType = QgsWkbTypes::addM( pType );
}

return QgsPoint( mX + dx, mY + dy, mZ + dz, mM, pType );
double z = qIsNaN( mZ ) ? 0 : mZ;
return QgsPoint( mX + dx, mY + dy, z + dz, mM, pType );
}
@@ -294,7 +294,7 @@ class CORE_EXPORT QgsPoint: public QgsAbstractGeometry
* M value is preserved.
* \param distance distance to project
* \param azimuth angle to project in X Y, clockwise in degrees starting from north
* \param inclination angle to project in Z (3D)
* \param inclination angle to project in Z (3D). If the point is 2D, the Z value is assumed to be 0.
* \returns The point projected. If a 2D point is projected a 3D point will be returned except if
* inclination is 90. A 3D point is always returned if a 3D point is projected.
* Example:

0 comments on commit 96cf4b7

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