Adds a new geometry class for Triangle geometries
Methods include orthocenter, bisectors, medians, medial, circumscribed (center,
radius), inscribed (center, radius)
Also adds make_triangle expression function for creating triangles
Faster than QgsGeometry::isGeosEmpty() because it avoids the
conversion to GEOS geometries and just uses the QgsAbstractGeometry
subclasses directly.
Also implements faster isEmpty() overrides for specific
QgsAbstractGeometry subclasses.
Allows projection of a point with inclination to return a 3d point.
Expression "project" function has been extended to support a new inclination parameter.
This introduces QgsGeometry::makeValid() which will try to make a valid
geometry out of invalid one. This is more complicated method than just
doing a buffer with zero width, but it should not loose any vertices.
Finally we should have a reliable way in QGIS to fix bad geometries!
Ported the C code from lwgeom library to QGIS.
Adds a new QgsGeometry::orthagonalize method which tries to make
angles in geometries either right angles or straight lines
Also adds a processing algorithm exposing this feature.
Implements a method in QgsGeometry and a processing algorithm to
calculate the pole of inaccessibility for a surface, which is the
most distant internal point from the boundary of the surface. This function
uses the 'polylabel' algorithm (Vladimir Agafonkin, 2016), which is an iterative
approach guaranteed to find the true pole of inaccessibility within a specified
tolerance. More precise tolerances require more iterations and will take longer
to calculate.
Made sure that both closestVertex() and closestSegment() return negative
distance on error (e.g. with null or emtpy geometry).
Also fixes snapping when dealing with layers with null/invalid geometries
(cherry picked from commit c093d5188fad685c4a596ff23c27aad7d151dac2)
Make nCoordinates virtual, and provide shortcuts for some
geometry types. The base method which calls coordinateSequence()
is quite slow in certain circumstances.
Speeds up rendering point layers by ~25%, also likely to
speed up lots of geometry heavy operations throughout QGIS
Refs #15752
segments shorter than a certain threshold or sharp corners
with an angle exceeding a threshold
Expose the angle threshold to processing smooth algorithm
Also:
- optimise QgsGeometry::smooth for new geometry classes
- Fix smooth does not work with geometries containing Z/M
This feature adds a 'collect' aggregation method resulting in a
single multipart geometry from a list of geometries. This is exposed
in the expression engine via the existing aggregate() function,
as well as a new collect() function.
Adds a new QgsGeometry::lineLocatePoint() function for
retrieving the distance along a linestring to the nearest
position on the linestring to a given point.
* Make closestSegment() behave as expected by QgsGeometry::closestSegmentWithContext
This fixes a bug that QgsPointLocator::nearestEdge() would return valid match even for point layers.
* Shortcut if using QgsPointLocator with a wrong layer type