405 Commits

Author SHA1 Message Date
Even Rouault
15ea5c46bc
Header files: remove all mentions of '\since QGIS 3.0' 2024-02-18 20:57:23 +01:00
Even Rouault
02caeb9db7
Header files: remove all mentions of '\since QGIS 2.' 2024-02-18 20:46:01 +01:00
Even Rouault
a5c8f01003
Header files: remove all mentions of '\since QGIS 1.' 2024-02-18 20:46:00 +01:00
Nyall Dawson
45e51c2a55 Expose GEOS constrainedDelaunayTriangulation to QgsGeometry
Allows calling this method when QGIS is built against supported
GEOS versions (>= 3.11)
2024-02-10 08:04:51 +10:00
Nyall Dawson
fa6c41fd74 Add QgsGeometryCollection::extractPartsByType
Allows extraction of matching parts from a collection, returning
the corresponding collection subclass.

  mixed_collection = QgsGeometryCollection()
  mixed_collection.addGeometry(... mix of geometry types ...)

  multi_line_string = mixed_collection.extractPartsByType(Qgis.WkbType.LineString)

In this case multi_line_string will be a QgsMultiLineString object,
containing just the line string parts from mixed_collection
2024-02-10 08:04:51 +10:00
Alessandro Pasotti
f2f2840173
Merge pull request #55588 from elpaso/mssql-log-query-when-update-geometry-value
MSSQL: fix add/fill ring
2024-02-06 13:47:01 +01:00
Loïc Bartoletti
67ea128ee0 DOX: better wording for createGeometryEngine
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
2024-02-06 10:28:53 +01:00
Loïc Bartoletti
f5db8a765f QgsGeos: Add precision when createGeometryEngine 2024-02-06 10:28:53 +01:00
Loïc Bartoletti
7bdf16d976 QgsAbstractGeometry: Update dox for fuzzyEqual and fix \see tags 2024-01-12 07:10:37 +10:00
Loïc Bartoletti
c16938c683 DOX: add a more descriptive information on fuzzyDistanceEqual. What is a 'distance comparison' 2024-01-12 07:10:37 +10:00
Loïc Bartoletti
c6eca9361f QgsAbstrcatGeometry and childs: Add fuzzyEqual and fuzzyDistanceEqual. Replaces operator== with fuzzyEqual and uses epsilon=1E-8
The comparisons among QGIS were conducted on coordinates using a fixed epsilon:
specifically, 1e-8 for QgsPoint and the default value for qgsDoubleNear: 4 *
DBL_EPSILON.

Initially, I've standardized its use to 1e-8 universally; it's already
significantly adequate for our Cartesian cases (1e-3 should suffice for many),
potentially fitting just right for geographical contexts.

Furthermore, in response to precision concerns, we're using the fuzzyEqual
and fuzzyDistanceEqual methods. These methods enable users/developers to
compare geometries more easily and with a given precision.

The API remains intact as operator==/equals() have been shifted into fuzzyEqual
(with an epsilon of 1e-8).

To consolidate the code between fuzzyEqual and fuzzyDistanceEqual, helper
functions, fuzzyHelpers, have been introduced following the logic of the
respective segments to be executed.
2024-01-12 07:10:37 +10:00
Loïc Bartoletti
c9d4a02d96 dox: Adds a \warning tag. Adds a mention about caller's responsibility and adds a \since tag 2024-01-11 05:23:39 +10:00
Loïc Bartoletti
a590b0e4c6 QgsGeometryUtils: add sqrDistance3D and distance3d for QgsPoint using QgsGeometryUtilsBase functions 2024-01-11 05:23:39 +10:00
Loïc Bartoletti
2fdcc3c01e QgsGeometryUtilsBase: add sqrDistance3D and distance3D
As for the sqrDistance and Distance 2D functions, this adds functions for 3D.
To maintain the lowest level, the specific case where a Z could be NaN
is not handled.
It is left to the responsibility of other methods using these functions.
2024-01-11 05:23:39 +10:00
Loïc Bartoletti
491d133a05 QgsGeometryUtilsBase: Add a fuzzy compare method for comparing pairs
This method will be used where multiple calls to `qgsDoubleNear(x1, y1, eps) &&
qgsDoubleNear(x2, y2, eps) && ... && qgsDoubleNear(xn, yn, eps)` are possible.
2023-12-14 20:17:25 +01:00
Loïc Bartoletti
2910e24d87 Add const SIP_FACTORY for measuredLine methods 2023-12-14 05:52:21 +10:00
Loïc Bartoletti
a93136c313 QgsMultiLineString: add method measuredLine 2023-12-14 05:52:21 +10:00
Loïc Bartoletti
6cb243571f QgsLineString: add method measuredLine 2023-12-14 05:52:21 +10:00
Alessandro Pasotti
ce4c5bd7de MSSQL: fix add/fill ring
Fix #53698

Funded by: All My Favourite Things ♬
2023-12-13 11:24:57 +01:00
Loïc Bartoletti
4a353d1a12 Marks deprecated methods in QgsGeometryUtils redundant with QgsGeometryUtilsBase 2023-12-01 11:17:11 +01:00
Loïc Bartoletti
8025f72fa7 QgsGeometryUtils_base: add this class available in Python binding 2023-12-01 11:17:11 +01:00
Loïc Bartoletti
ac3e73e25c [refacto] QgsGeometryUtils: move base methods to a dedicated class
Refactor QgsGeometryUtils to separate "basic" methods from those involving QGIS
composite types.
By "basic" methods, we refer to those that only require doubles or (qgs)vectors.
These methods are now encapsulated in their dedicated classes and can be called
from anywhere to prevent duplications in certain methods (in particular Cartesian distance calculation).

To maintain API compatibility, all methods are also accessible in QgsGeometryUtils
which acts as a pass-through to QgsGeometryUtilsBase.
2023-12-01 11:17:11 +01:00
Loïc Bartoletti
3ab676e603 QgsGeometryUtils: move 2D distance code into QgsGeometryUtils.h and uses it 2023-12-01 11:17:11 +01:00
Loïc Bartoletti
361fbded94 QgsGeometry: use NoOrientation enum and fix some possible nullptr uses 2023-11-24 09:18:02 +00:00
Loïc Bartoletti
0f27fd3b1e QgsGeometry: add methods to return orientation 2023-11-24 07:43:24 +00:00
dubravat
e1ba6f5272 Mistype in QgsGeometryUtils::segmentSide description was fixed 2023-11-23 08:28:20 +10:00
Nyall Dawson
25b75353b5 Add coverage union algorithm 2023-11-02 22:03:20 +10:00
Nyall Dawson
c8eefd0558 Expose GEOS coverage simplify as a processing algorithm 2023-11-02 22:03:20 +10:00
Sandro Santilli
f42699979c Drop the temporary QgsRectangle::createNull static, not more needed 2023-10-23 10:07:42 +10:00
Sandro Santilli
1df4c52321 Add a QgsRectangle::createNull() temporary static method 2023-10-21 16:07:32 +13:00
Sandro Santilli
94ef53286b Rename QgsBox3d::setMinimal() to setNull()
The method was introduced in this version so it should be ok to
rename with no formal deprecation notice
2023-10-20 07:03:55 +13:00
Sandro Santilli
0ec5f0debb Add QgsRectangle::setNull(), deprecating setMinimal() 2023-10-20 07:03:55 +13:00
Julien Cabieces
29f19dafc6 fix sip 2023-09-27 18:39:19 +02:00
Julien Cabieces
7ef5717c7a add deprecated instructions 2023-09-25 11:12:15 +02:00
Julien Cabieces
5315ae6cc5 make avoidIntersections return an enum 2023-09-25 08:42:03 +02:00
Jean Felder
d7bdfe000c geometry: Remove duplicated 2d boundingbox logic 2023-09-02 12:38:44 +10:00
Jean Felder
cdc2abea90 qgsgeometry: Add support for 3D boundingbox 2023-09-02 12:38:44 +10:00
bdm-oslandia
40089e6230 qgsabstractgeometry: Add support for box3d intersection 2023-09-02 12:38:44 +10:00
bdm-oslandia
5774acf8d0 qgsabstractgeometry: Add boundingBox3D logic
With this change `QgsAbstractGeometry::calculateBoundingBox()` is now
computed from `QgsAbstractGeometry::calculateBoundingBox3D()`.
2023-09-02 12:38:44 +10:00
Nyall Dawson
22fd8d9698 Add method to detect whether two QgsOrientedBox3Ds intersect 2023-08-03 22:13:03 +10:00
Nyall Dawson
5b0b7e3c2f Add repr for QgsBox3D, QgsOrientedBox3D 2023-08-03 15:27:22 +10:00
Nyall Dawson
519c32a3ff Hold GIL for more methods 2023-08-03 15:27:22 +10:00
Nyall Dawson
c3159d5a28 Add method to get corners of QgsBox3D 2023-08-03 15:27:22 +10:00
Nyall Dawson
5bdbcc4f6c Add more helpful methods for 3d objects 2023-08-03 15:27:22 +10:00
Nyall Dawson
6c24fa8571 Add some more convenience methods for QgsOrientedBox3D 2023-08-03 15:27:22 +10:00
bdm-oslandia
e0f71afeaa
qgsgeometry: Add fromBox3D constructor 2023-07-26 09:17:17 +02:00
bdm-oslandia
4c23966008
qgsgeometry: Add fromPoint constructor 2023-07-26 08:58:49 +02:00
Martin Dobias
ecc1bf2c19 sip fix 2023-07-20 14:03:55 +02:00
Martin Dobias
e8f0e1cca1 fixes after rebase 2023-07-20 14:03:55 +02:00
Martin Dobias
5e3c230262 Small additions to QgsBox3d and QgsOrientedBox3D API
- operators to move QgsBox3d by a QgsVector3D
- reproject QgsOrientedBox3D and get its axis-aligned bounding box
- get length of sides of QgsOrientedBox3D
- transform QgsOrientedBox3D with a QgsMatrix4x4
2023-07-20 14:03:55 +02:00