235 Commits

Author SHA1 Message Date
Loïc Bartoletti
dcfa1bd02d Update setMValueFromPoints dox 2021-04-29 11:15:34 +10:00
Loïc Bartoletti
9e81011908 Adds setMValueFromPoints 2021-04-29 11:15:34 +10:00
Nyall Dawson
f22c63ec77 Rely on upstream GEOS makevalid algorithm for GEOS 3.9+
No point having our own internal fork of this code now that it's
included (and more importantly, maintained) upstream!
2021-04-29 08:45:25 +10:00
Nyall Dawson
1c11a91811 Add QgsGeometry::normalize()
A port of the equivalent method from GEOS, but with added support
for curved geometries and M values

Reorganizes the geometry into a normalized form (or "canonical" form).

Polygon rings will be rearranged so that their starting vertex is
the lower left and ring orientation follows the right hand rule, collections
are ordered by geometry type, and other normalization techniques are applied.
The resultant geometry will be geometrically equivalent to the original geometry.
2021-04-29 05:33:25 +10:00
Nyall Dawson
e3a73a1ac5 Add method to "scroll" the vertices of a closed curve geometry,
so that a particular vertex is the first one
2021-04-29 05:33:25 +10:00
Nyall Dawson
417d444429 Add api to condense compound curves by merging adjacent parts of the
same type to single parts
2021-04-28 11:15:17 +10:00
Nyall Dawson
bab01b1b75 Dox ++ 2021-04-27 21:13:22 +10:00
Nyall Dawson
9c53fb8635 Add QgsAbstractGeometry::compareTo( QgsAbstractGeometry*)
Allows for comparison of geometry objects, e.g. to allow for stable
sorting of them.

Ported from the GEOS equivalent method, but with addition of support
for M values and curved geometry types
2021-04-27 21:13:22 +10:00
Nyall Dawson
36e52f8514 Add method to split QgsCurve geometries into two parts at a specific
vertex index
2021-04-27 19:15:51 +10:00
Nyall Dawson
a9a6e38665 Add QgsCircularString::append( const QgsCircularString* )
Appends the contents of one circular string to the end of another
2021-04-27 19:15:33 +10:00
Nyall Dawson
1c94f6b941 Dox++ 2021-04-27 14:53:20 +10:00
Nyall Dawson
063f2ee852 Add optimised method to create QgsCircularString direct from coordinate
arrays
2021-04-27 14:53:20 +10:00
Nyall Dawson
729792d981 Add QgsCurve::indexOf to retrieve index of a specified QgsPoint
within the curve
2021-04-27 11:26:49 +10:00
Nyall Dawson
9c4375b4c7 Add QgsGeometry::isAxisParallelRectangle for checking whether
a geometry is a axis-parallel rectangle

Credit to @stefanuhrig
2021-04-24 06:25:02 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
0c5ffe7ecf Spelling 2021-03-19 18:47:23 +10:00
Nyall Dawson
425f27186f Add method to determine closest side of rectangle to a point 2021-03-19 18:47:23 +10:00
Nyall Dawson
ba6d96725b Add geometry util to calculate a point along a segment offset in a perpendicular direction by a set offset amount 2021-03-19 18:47:23 +10:00
Nyall Dawson
7c410120e3 Super-optimised version of geometry bounding box intersects test
Apply some fancy logic to make this test as cheap as possible
to run
2021-03-12 05:46:14 +10:00
Nyall Dawson
5445aceaff Add QgsRectangle::contains overload which doesn't require QgsPoint/QgsPointXY objects 2021-03-12 05:46:14 +10:00
Nyall Dawson
7fb3c83e76 Sipify 2021-03-12 05:46:14 +10:00
Nyall Dawson
afccd31720 Add method to add a linestring to compound curves where we extend
the existing final part if it's a linestring and the newly added
curve is also a linestring, instead of adding a whole new curve
2021-03-05 04:28:31 +10:00
Nyall Dawson
6ab4ecfa58 Another attempt 2021-02-25 11:08:56 +10:00
Nyall Dawson
73658c5910 Fix mac build 2021-02-25 11:08:56 +10:00
Nyall Dawson
bd82925df3 Replace qgis::make_unique with std::make_unique
Now that we require c++14 features, we don't need to use the custom
backported version anymore...
2021-02-25 11:08:56 +10:00
Nyall Dawson
d007901f14 Allow QgsRectangle constructors to bypass the automatic normalization
step, when they know in advance they are already normalized

This step isn't free, and can add up when many rectangles are
constructed
2021-02-23 16:02:06 +10:00
Nyall Dawson
7dfef3a0b1 Newer doxygen versions don't auto convert the first line in a class'
documentation to a brief note, so we have to do it explicitly...
2021-02-19 08:15:29 +10:00
Loïc Bartoletti
e336b831c2 Remove automagic fix and tiny refacto 2021-02-13 09:25:19 +10:00
Loïc Bartoletti
7e7732218b Add a message if a geometry was fixed 2021-02-13 09:25:19 +10:00
Nyall Dawson
6f4b32f658 Create class QgsAbstractGeometryTransformer, which can be used
to transform the vertices of a QgsAbstractGeometry

E.g.

        class Transformer(QgsAbstractGeometryTransformer):

            def transformPoint(self, x, y, z, m):
                return True, x * 2, y + 1, z, m

        transformer = Transformer()
        g = QgsGeometry.fromWkt('LineString(3 0, 10 0, 10 10)')
        g.get().transform(transformer)
        print(g.asWkt()) # 'LineString (6 1, 20 1, 20 11)'
2021-02-08 12:12:53 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Harrissou Sant-anna
8a8d2a2c66 Fix some formatting in pyQGIS doc 2021-01-30 08:25:03 +10:00
Belgacem
f362eab3d8 fix indentation 2021-01-13 15:47:40 +01:00
Belgacem
0167d07eaa fix tests 2021-01-13 15:47:40 +01:00
Belgacem
be88fff95c add some QgsRay3D tests 2021-01-13 15:47:40 +01:00
Belgacem
2c9c6f94b9 fix somethings and testRayFromScreenPoint 2021-01-13 15:47:40 +01:00
Belgacem
fa7e3d4f7d fix sip and add Nyall suggestions 2021-01-13 15:47:40 +01:00
Belgacem
59bb58f880 cleanup and fix symbol nullptr bug 2021-01-13 15:47:40 +01:00
Belgacem
0073c35b65 remove distanceFromPoint 2021-01-13 15:47:40 +01:00
Belgacem
a97ade0e88 address reviews 2021-01-13 15:47:40 +01:00
Belgacem
432f29be92 add pointsLimit and SIP 2021-01-13 15:47:40 +01:00
Belgacem
4f3f95a841 raycast intersection with node bounding box 2021-01-13 15:47:40 +01:00
Loïc Bartoletti
817744928c
Fix circle by three tangents parrallel when two are parallels (#40702)
* add new method to solve QgsCircle::from3tangents where 2 tangents are parallels
2020-12-23 09:00:15 +10:00
Nyall Dawson
932e70b247 Dox grammar 2020-12-14 08:51:51 +10:00
Loïc Bartoletti
fe80965d50 [API] Add angleBisector method 2020-12-07 08:40:59 +10:00
Loïc Bartoletti
d6ac6c4029 Fix since version for bisector method 2020-12-02 19:46:13 +10:00
Loïc Bartoletti
0f292cfb36
[API] Improve isValid method for curve type 2020-12-02 06:32:54 +10:00
Loïc Bartoletti
5f36925189 [API] Add asGml methods to QgsCircle 2020-12-02 06:32:00 +10:00
Loïc Bartoletti
25e14ee766 add python binding 2020-11-28 08:11:54 +10:00
Nyall Dawson
13e8d45fed Add signal for when project preset full extent is changed 2020-11-24 04:44:19 +10:00