Skip to content

Commit 313417d

Browse files
committed
Stop conflicts
1 parent 972e789 commit 313417d

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

python/core/geometry/qgsgeometryutils.sip

+33-31
Original file line numberDiff line numberDiff line change
@@ -103,37 +103,39 @@ Returns the squared distance between a point and a line.
103103
static bool segmentIntersection( const QgsPoint &p1, const QgsPoint &p2, const QgsPoint &q1, const QgsPoint &q2, QgsPoint &intersectionPoint /Out/, bool &isIntersection /Out/, const double tolerance = 1e-8, bool acceptImproperIntersection = false );
104104
%Docstring
105105
Compute the intersection between two segments
106-
\param p1 First segment start point
107-
\param p2 First segment end point
108-
\param q1 Second segment start point
109-
\param q2 Second segment end point
110-
\param intersectionPoint Output parameter, the intersection point
111-
\param isIntersection Output parameter, return true if an intersection is found
112-
\param tolerance The tolerance to use
113-
\param acceptImproperIntersection By default, this method returns true only if segments have proper intersection. If set true, returns also true if segments have improper intersection (end of one segment on other segment ; continuous segments).
114-
:return: Whether the segments intersect
115-
* Example:
116-
\code{.py}
117-
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 1 ), QgsPoint( 1, 1 ), QgsPoint( 1, 0 ) )
118-
ret[0], ret[1].asWkt(), ret[2]
119-
# Whether the segments intersect, the intersection point, is intersect
120-
# (False, 'Point (0 0)', False)
121-
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 5 ), QgsPoint( 0, 5 ), QgsPoint( 1, 5 ) )
122-
ret[0], ret[1].asWkt(), ret[2]
123-
# (False, 'Point (0 5)', True)
124-
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 5 ), QgsPoint( 0, 5 ), QgsPoint( 1, 5 ), acceptImproperIntersection=True )
125-
ret[0], ret[1].asWkt(), ret[2]
126-
# (True, 'Point (0 5)', True)
127-
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 5 ), QgsPoint( 0, 2 ), QgsPoint( 1, 5 ) )
128-
ret[0], ret[1].asWkt(), ret[2]
129-
# (False, 'Point (0 2)', True)
130-
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 5 ), QgsPoint( 0, 2 ), QgsPoint( 1, 5 ), acceptImproperIntersection=True )
131-
ret[0], ret[1].asWkt(), ret[2]
132-
# (True, 'Point (0 2)', True)
133-
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, -5 ), QgsPoint( 0, 5 ), QgsPoint( 2, 0 ), QgsPoint( -1, 0 ) )
134-
ret[0], ret[1].asWkt(), ret[2]
135-
# (True, 'Point (0 0)', True)
136-
\endcode
106+
107+
:param p1: First segment start point
108+
:param p2: First segment end point
109+
:param q1: Second segment start point
110+
:param q2: Second segment end point
111+
:param intersectionPoint: Output parameter, the intersection point
112+
:param isIntersection: Output parameter, return true if an intersection is found
113+
:param tolerance: The tolerance to use
114+
:param acceptImproperIntersection: By default, this method returns true only if segments have proper intersection. If set true, returns also true if segments have improper intersection (end of one segment on other segment ; continuous segments).
115+
116+
:return: Whether the segments intersect
117+
* Example:
118+
\code{.py}
119+
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 1 ), QgsPoint( 1, 1 ), QgsPoint( 1, 0 ) )
120+
ret[0], ret[1].asWkt(), ret[2]
121+
# Whether the segments intersect, the intersection point, is intersect
122+
# (False, 'Point (0 0)', False)
123+
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 5 ), QgsPoint( 0, 5 ), QgsPoint( 1, 5 ) )
124+
ret[0], ret[1].asWkt(), ret[2]
125+
# (False, 'Point (0 5)', True)
126+
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 5 ), QgsPoint( 0, 5 ), QgsPoint( 1, 5 ), acceptImproperIntersection=True )
127+
ret[0], ret[1].asWkt(), ret[2]
128+
# (True, 'Point (0 5)', True)
129+
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 5 ), QgsPoint( 0, 2 ), QgsPoint( 1, 5 ) )
130+
ret[0], ret[1].asWkt(), ret[2]
131+
# (False, 'Point (0 2)', True)
132+
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, 0 ), QgsPoint( 0, 5 ), QgsPoint( 0, 2 ), QgsPoint( 1, 5 ), acceptImproperIntersection=True )
133+
ret[0], ret[1].asWkt(), ret[2]
134+
# (True, 'Point (0 2)', True)
135+
ret = QgsGeometryUtils.segmentIntersection( QgsPoint( 0, -5 ), QgsPoint( 0, 5 ), QgsPoint( 2, 0 ), QgsPoint( -1, 0 ) )
136+
ret[0], ret[1].asWkt(), ret[2]
137+
# (True, 'Point (0 0)', True)
138+
\endcode
137139
%End
138140

139141
static QgsPoint projPointOnSegment( const QgsPoint &p, const QgsPoint &s1, const QgsPoint &s2 );

0 commit comments

Comments
 (0)