Skip to content
Permalink
Browse files

run sipify for code snippets

  • Loading branch information
3nids committed Dec 19, 2017
1 parent d042304 commit 64c99e054c1bbc84e6a93742a6dd9a7a83bfa9b2
@@ -18,22 +18,6 @@ Class for parsing and evaluation of expressions (formerly called "search strings
The expressions try to follow both syntax and semantics of SQL expressions.

Usage:
\code{.cpp}
QgsExpression exp("gid*2 > 10 and type not in ('D','F')");
if (exp.hasParserError())
{
// show error message with parserErrorString() and exit
}
QVariant result = exp.evaluate(feature, fields);
if (exp.hasEvalError())
{
// show error message with evalErrorString()
}
else
{
// examine the result
}
\endcode

Three Value Logic
=================
@@ -456,9 +456,7 @@ If the gridified geometry could not be calculated a None will be returned.
It may generate an invalid geometry (in some corner cases).
It can also be thought as rounding the edges and it may be useful for removing errors.
Example:
\code
geometry->snappedToGrid(1, 1);
\endcode

In this case we use a 2D grid of 1x1 to gridify.
In this case, it can be thought like rounding the x and y of all the points/vertices to full units (remove all decimals).

@@ -297,17 +297,17 @@ M value is computed if one of this point have M.

:return: New point at middle between points pt1 and pt2.
* Example:
\code{.py}
p = :py:class:`QgsPoint`( 4, 6 ) # 2D point
pr = midpoint ( p, :py:class:`QgsPoint`( 2, 2 ) )
# pr is a 2D point: 'Point (3 4)'
pr = midpoint ( p, :py:class:`QgsPoint`( QgsWkbTypes.PointZ, 2, 2, 2 ) )
# pr is a 3D point: 'PointZ (3 4 1)'
pr = midpoint ( p, :py:class:`QgsPoint`( QgsWkbTypes.PointM, 2, 2, 0, 2 ) )
# pr is a 3D point: 'PointM (3 4 1)'
pr = midpoint ( p, :py:class:`QgsPoint`( QgsWkbTypes.PointZM, 2, 2, 2, 2 ) )
# pr is a 3D point: 'PointZM (3 4 1 1)'
\endcode
.. code-block:: python

p = QgsPoint( 4, 6 ) # 2D point
pr = midpoint ( p, QgsPoint( 2, 2 ) )
# pr is a 2D point: 'Point (3 4)'
pr = midpoint ( p, QgsPoint( QgsWkbTypes.PointZ, 2, 2, 2 ) )
# pr is a 3D point: 'PointZ (3 4 1)'
pr = midpoint ( p, QgsPoint( QgsWkbTypes.PointM, 2, 2, 0, 2 ) )
# pr is a 3D point: 'PointM (3 4 1)'
pr = midpoint ( p, QgsPoint( QgsWkbTypes.PointZM, 2, 2, 2, 2 ) )
# pr is a 3D point: 'PointZM (3 4 1 1)'

.. versionadded:: 3.0
%End
@@ -33,21 +33,21 @@ based on the following rules:
- If only x and y are specified, the type will be a 2D point.
- If any or both of the Z and M are specified, the appropriate type will be created.

\code{.py}
pt = QgsPoint(43.4, 5.3)
pt.asWkt() # Point(43.4 5.3)

pt_z = QgsPoint(120, 343, 77)
pt.asWkt() # PointZ(120 343 77)

pt_m = QgsPoint(33, 88, m=5)
pt_m.m() # 5
pt_m.wkbType() # QgsWkbTypes.PointM

pt = QgsPoint(30, 40, wkbType=QgsWkbTypes.PointZ)
pt.z() # nan
pt.wkbType() # QgsWkbTypes.PointZ
\endcode
.. code-block:: python

pt = QgsPoint(43.4, 5.3)
pt.asWkt() # Point(43.4 5.3)

pt_z = QgsPoint(120, 343, 77)
pt.asWkt() # PointZ(120 343 77)
pt_m = QgsPoint(33, 88, m=5)
pt_m.m() # 5
pt_m.wkbType() # QgsWkbTypes.PointM
pt = QgsPoint(30, 40, wkbType=QgsWkbTypes.PointZ)
pt.z() # nan
pt.wkbType() # QgsWkbTypes.PointZ
%End
%MethodCode
double z;
@@ -293,22 +293,22 @@ M value is preserved.
: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:
\code{.py}
p = QgsPoint( 1, 2 ) # 2D point
pr = p.project ( 1, 0 )
# pr is a 2D point: 'Point (1 3)'
pr = p.project ( 1, 0, 90 )
# pr is a 2D point: 'Point (1 3)'
pr = p.project (1, 0, 0 )
# pr is a 3D point: 'PointZ (1 2 1)'
p = QgsPoint( QgsWkbTypes.PointZ, 1, 2, 2 ) # 3D point
pr = p.project ( 1, 0 )
# pr is a 3D point: 'PointZ (1 3 2)'
pr = p.project ( 1, 0, 90 )
# pr is a 3D point: 'PointZ (1 3 2)'
pr = p.project (1, 0, 0 )
# pr is a 3D point: 'PointZ (1 2 3)'
\endcode
.. code-block:: python

p = QgsPoint( 1, 2 ) # 2D point
pr = p.project ( 1, 0 )
# pr is a 2D point: 'Point (1 3)'
pr = p.project ( 1, 0, 90 )
# pr is a 2D point: 'Point (1 3)'
pr = p.project (1, 0, 0 )
# pr is a 3D point: 'PointZ (1 2 1)'
p = QgsPoint( QgsWkbTypes.PointZ, 1, 2, 2 ) # 3D point
pr = p.project ( 1, 0 )
# pr is a 3D point: 'PointZ (1 3 2)'
pr = p.project ( 1, 0, 90 )
# pr is a 3D point: 'PointZ (1 3 2)'
pr = p.project (1, 0, 0 )
# pr is a 3D point: 'PointZ (1 2 3)'

.. versionadded:: 3.0
%End

0 comments on commit 64c99e0

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