Skip to content

Commit 64c99e0

Browse files
committed
run sipify for code snippets
1 parent d042304 commit 64c99e0

10 files changed

+207
-257
lines changed

python/core/expression/qgsexpression.sip

-16
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,6 @@ Class for parsing and evaluation of expressions (formerly called "search strings
1818
The expressions try to follow both syntax and semantics of SQL expressions.
1919

2020
Usage:
21-
\code{.cpp}
22-
QgsExpression exp("gid*2 > 10 and type not in ('D','F')");
23-
if (exp.hasParserError())
24-
{
25-
// show error message with parserErrorString() and exit
26-
}
27-
QVariant result = exp.evaluate(feature, fields);
28-
if (exp.hasEvalError())
29-
{
30-
// show error message with evalErrorString()
31-
}
32-
else
33-
{
34-
// examine the result
35-
}
36-
\endcode
3721

3822
Three Value Logic
3923
=================

python/core/geometry/qgsabstractgeometry.sip

+1-3
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,7 @@ If the gridified geometry could not be calculated a None will be returned.
456456
It may generate an invalid geometry (in some corner cases).
457457
It can also be thought as rounding the edges and it may be useful for removing errors.
458458
Example:
459-
\code
460-
geometry->snappedToGrid(1, 1);
461-
\endcode
459+
462460
In this case we use a 2D grid of 1x1 to gridify.
463461
In this case, it can be thought like rounding the x and y of all the points/vertices to full units (remove all decimals).
464462

python/core/geometry/qgsgeometryutils.sip

+11-11
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,17 @@ M value is computed if one of this point have M.
297297

298298
:return: New point at middle between points pt1 and pt2.
299299
* Example:
300-
\code{.py}
301-
p = :py:class:`QgsPoint`( 4, 6 ) # 2D point
302-
pr = midpoint ( p, :py:class:`QgsPoint`( 2, 2 ) )
303-
# pr is a 2D point: 'Point (3 4)'
304-
pr = midpoint ( p, :py:class:`QgsPoint`( QgsWkbTypes.PointZ, 2, 2, 2 ) )
305-
# pr is a 3D point: 'PointZ (3 4 1)'
306-
pr = midpoint ( p, :py:class:`QgsPoint`( QgsWkbTypes.PointM, 2, 2, 0, 2 ) )
307-
# pr is a 3D point: 'PointM (3 4 1)'
308-
pr = midpoint ( p, :py:class:`QgsPoint`( QgsWkbTypes.PointZM, 2, 2, 2, 2 ) )
309-
# pr is a 3D point: 'PointZM (3 4 1 1)'
310-
\endcode
300+
.. code-block:: python
301+
302+
p = QgsPoint( 4, 6 ) # 2D point
303+
pr = midpoint ( p, QgsPoint( 2, 2 ) )
304+
# pr is a 2D point: 'Point (3 4)'
305+
pr = midpoint ( p, QgsPoint( QgsWkbTypes.PointZ, 2, 2, 2 ) )
306+
# pr is a 3D point: 'PointZ (3 4 1)'
307+
pr = midpoint ( p, QgsPoint( QgsWkbTypes.PointM, 2, 2, 0, 2 ) )
308+
# pr is a 3D point: 'PointM (3 4 1)'
309+
pr = midpoint ( p, QgsPoint( QgsWkbTypes.PointZM, 2, 2, 2, 2 ) )
310+
# pr is a 3D point: 'PointZM (3 4 1 1)'
311311

312312
.. versionadded:: 3.0
313313
%End

python/core/geometry/qgspoint.sip

+31-31
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ based on the following rules:
3333
- If only x and y are specified, the type will be a 2D point.
3434
- If any or both of the Z and M are specified, the appropriate type will be created.
3535

36-
\code{.py}
37-
pt = QgsPoint(43.4, 5.3)
38-
pt.asWkt() # Point(43.4 5.3)
39-
40-
pt_z = QgsPoint(120, 343, 77)
41-
pt.asWkt() # PointZ(120 343 77)
42-
43-
pt_m = QgsPoint(33, 88, m=5)
44-
pt_m.m() # 5
45-
pt_m.wkbType() # QgsWkbTypes.PointM
46-
47-
pt = QgsPoint(30, 40, wkbType=QgsWkbTypes.PointZ)
48-
pt.z() # nan
49-
pt.wkbType() # QgsWkbTypes.PointZ
50-
\endcode
36+
.. code-block:: python
37+
38+
pt = QgsPoint(43.4, 5.3)
39+
pt.asWkt() # Point(43.4 5.3)
40+
41+
pt_z = QgsPoint(120, 343, 77)
42+
pt.asWkt() # PointZ(120 343 77)
43+
44+
pt_m = QgsPoint(33, 88, m=5)
45+
pt_m.m() # 5
46+
pt_m.wkbType() # QgsWkbTypes.PointM
47+
48+
pt = QgsPoint(30, 40, wkbType=QgsWkbTypes.PointZ)
49+
pt.z() # nan
50+
pt.wkbType() # QgsWkbTypes.PointZ
5151
%End
5252
%MethodCode
5353
double z;
@@ -293,22 +293,22 @@ M value is preserved.
293293
:return: The point projected. If a 2D point is projected a 3D point will be returned except if
294294
inclination is 90. A 3D point is always returned if a 3D point is projected.
295295
Example:
296-
\code{.py}
297-
p = QgsPoint( 1, 2 ) # 2D point
298-
pr = p.project ( 1, 0 )
299-
# pr is a 2D point: 'Point (1 3)'
300-
pr = p.project ( 1, 0, 90 )
301-
# pr is a 2D point: 'Point (1 3)'
302-
pr = p.project (1, 0, 0 )
303-
# pr is a 3D point: 'PointZ (1 2 1)'
304-
p = QgsPoint( QgsWkbTypes.PointZ, 1, 2, 2 ) # 3D point
305-
pr = p.project ( 1, 0 )
306-
# pr is a 3D point: 'PointZ (1 3 2)'
307-
pr = p.project ( 1, 0, 90 )
308-
# pr is a 3D point: 'PointZ (1 3 2)'
309-
pr = p.project (1, 0, 0 )
310-
# pr is a 3D point: 'PointZ (1 2 3)'
311-
\endcode
296+
.. code-block:: python
297+
298+
p = QgsPoint( 1, 2 ) # 2D point
299+
pr = p.project ( 1, 0 )
300+
# pr is a 2D point: 'Point (1 3)'
301+
pr = p.project ( 1, 0, 90 )
302+
# pr is a 2D point: 'Point (1 3)'
303+
pr = p.project (1, 0, 0 )
304+
# pr is a 3D point: 'PointZ (1 2 1)'
305+
p = QgsPoint( QgsWkbTypes.PointZ, 1, 2, 2 ) # 3D point
306+
pr = p.project ( 1, 0 )
307+
# pr is a 3D point: 'PointZ (1 3 2)'
308+
pr = p.project ( 1, 0, 90 )
309+
# pr is a 3D point: 'PointZ (1 3 2)'
310+
pr = p.project (1, 0, 0 )
311+
# pr is a 3D point: 'PointZ (1 2 3)'
312312

313313
.. versionadded:: 3.0
314314
%End

0 commit comments

Comments
 (0)