186 Commits

Author SHA1 Message Date
Sandro Santilli
57bf9daaac Document semantic of SegmentationToleranceType
.. and default of QgsCircularString::curveToLine

[ci skip]
2017-06-21 18:35:32 +02:00
Nyall Dawson
e74395d95b [FEATURE] Subdivide algorithm for QgsGeometry
Subdivides the geometry. The returned geometry will be a collection
containing subdivided parts from the original geometry, where no
part has more then the specified maximum number of nodes.
2017-06-14 22:57:20 +10:00
Nyall Dawson
bde0c7267e Expose GEOS clip by rect algorithm via QgsGeometry API
Performs a fast, non-robust intersection between the geometry and
a rectangle. The returned geometry may be invalid.
2017-06-14 22:02:01 +10:00
Matthias Kuhn
501081f863 Remove unrequired SIP_SKIP 2017-06-14 07:37:31 +02:00
Matthias Kuhn
37a306e3f2 Fix tests 2017-06-14 07:37:31 +02:00
Matthias Kuhn
96cf4b7026 Projecting a 2D point with inclination assumes 0 for Z 2017-06-14 07:37:31 +02:00
Matthias Kuhn
1808dc9c95 More intuitive QgsPoint python constructors
In python, the wkb type of a QgsPoint will by default be determined from
the provided parameters, where Z and M will be added as required if the
wkbType is Undefined.

    QgsPoint(x, y, z=nan, m=nan, wkbType=QgsWkbTypes.Undefined)

Thanks to the python API support of named parameters, it's also
straightforward to specify z, m and wkbType in any desired combination.

On the other hand, on C++ side it's often preferable to use

    QgsPoint(QgsWkbTypes::WkbType wkbType, double x, double y, double z, double m);

due to the lack of named parameters which make it harder to specify a
specific type and the advantage of typesafety that makes it possible to
verload the first constructor with this one.
2017-06-14 07:37:31 +02:00
Matthias Kuhn
4db671e83b Fix sip bindings for QgsPoint 2017-06-14 07:37:31 +02:00
Matthias Kuhn
7e487190e8 Add an easy to use Z/M default value constructor to QgsPoint 2017-06-14 07:37:31 +02:00
Matthias Kuhn
4eae0872ab Fix QgsPoint(XY) sip bindings 2017-06-14 07:37:31 +02:00
Nyall Dawson
74ce5550ad Remove duplicate QgsRectangle::unionRect method
QgsRectangle::combineExtentWith does the exact same thing
2017-06-12 07:03:08 +10:00
Matthias Kuhn
cc877c39eb No more QgsGeometry pointers in the public API
Geometries are passed as const reference and returned by value.
This make using the API easier and reduces the risk of ownership
problems.

The overhead is minimal due to implicit sharing.

Fix https://github.com/qgis/qgis3.0_api/issues/68
2017-06-11 09:13:16 +02:00
Martin Dobias
2964c33d63 Reshape tool: use default Z value for 3D geometries 2017-06-08 21:56:21 +02:00
Nyall Dawson
64a86e3d6c Add an explicit argument to set QgsGeometryValidator method
Previously this was always read from settings when using
QgsGeometryValidator. It's now an explicit argument
when constructing QgsGeometryValidator or calling the
static validation methods, allowing choice of internal/GEOS
validation methods.

Helps remove more QgsSettings use from core.
2017-06-07 11:36:14 +10:00
Matthias Kuhn
2bbadbacb7 Rename qgspoint.h and qgspointv2.h
To qgspointxy.h
And qgspoint.h
2017-06-02 19:53:37 +02:00
Matthias Kuhn
4f3cd3e12c QgsPoint migration 2017-06-02 19:53:37 +02:00
Matthias Kuhn
e2227d9998 Fix QgsPointXY issues 2017-06-02 19:53:37 +02:00
Matthias Kuhn
a9d7630a69 Rename QgsPointV2 to QgsPoint and QgsPoint to QgsPointXY
Because 3D coordinates should be the default.

References https://github.com/qgis/qgis3.0_api/issues/36
2017-06-02 19:53:37 +02:00
Martin Dobias
e001d5c70a Add QgsGeometry::isSimple() - useful for self-intersection checks 2017-05-18 09:02:41 +08:00
Denis Rouzaud
8231d7528b sipify QgsExpressionContext, QgsFeatureRequest, QgsOptionalExpression 2017-05-17 15:20:31 +02:00
lbartoletti
bc0c3a22b0 Add inclination method for QgsPointV2 (#4536) 2017-05-13 17:29:50 +10:00
Denis Rouzaud
5888d22c07 fix sip bindings documentation 2017-05-11 12:00:06 +02:00
lbartoletti
13c1318a5f New geometry class: QgsRegularPolygon (#4502) 2017-05-10 22:23:28 +10:00
Martin Dobias
040c4b32f9 Small cleanup of QgsAbstractGeometry header 2017-05-06 20:33:46 +08:00
Matthias Kuhn
28a21209b9 [sipify] seealso 2017-04-30 16:52:05 +02:00
Denis Rouzaud
897e2f0410 [sipify] do not take // comments into docstrings 2017-04-30 16:34:08 +02:00
Denis Rouzaud
f20b9b96e7 [sipify] better remove body, remove duplicate code 2017-04-30 16:34:08 +02:00
Denis Rouzaud
a86f5ea52d remove PyNames for QgsGeometry::compare methods
single python method with some MethodCode to dispatch to proper cpp methods.
2017-04-30 11:29:45 +02:00
Denis Rouzaud
b0d4a4c201 sipify geometry classes 2017-04-30 11:29:45 +02:00
lbartoletti
84471f2e6d New classes for circle and ellipse. 2017-04-27 10:25:29 +10:00
Denis Rouzaud
4cc4a27068 [sipify] operators, remove argument
* skip some operators
 * allow to remove an argument with SIP_PYARGREMOVE
2017-04-26 15:06:16 +02:00
Denis Rouzaud
1bfa539df1 [sipify] remove extra blank line 2017-04-24 07:39:30 +02:00
Denis Rouzaud
8f2a5c7c00 sipify all 2017-04-20 14:21:36 +02:00
Nyall Dawson
18c8c1fe36 Add is2d() method to QgsBox3d to determine whether box is 2d 2017-04-19 18:45:17 +10:00
Martin Dobias
e73a52bb35 [FEATURE] New node tool implementation 2017-04-17 14:23:36 +08:00
Nyall Dawson
eff5a823c9 [sipify] Convert "\a arg" to "`arg`" when processing Docstrings
Allows argument names to be highlighted in Python docs
2017-04-17 13:49:59 +10:00
Nyall Dawson
226bd9bb60 Move QgsRectangle and QgsBox3d to geometry folder
Since these are both geometry related classes, it's nicer to
keep these all together
2017-04-12 15:27:34 +10:00
Martin Dobias
ab5841395f Move private arc segmentization routines to QgsGeometryUtils 2017-04-02 17:42:22 +08:00
Martin Dobias
8e7bb3b672 Code cleanup + more testing 2017-03-29 16:02:38 +08:00
Nyall Dawson
51035cfb67 Add optimised constructors for QgsLineString
Instead of requiring all linestrings to be constructed by
first creating QgsPointSequence (requiring creation or
conversion of points to QgsPointV2), allow construction
of LineStrings directly from vectors of values (fastest!)
or lists of QgsPoint.

Likely results in speedups for lots of geometry operations,
but using the same layer as earlier tested for densify
improvements the densify operation time dropped further
from 25 seconds to 15 seconds.
2017-03-25 20:44:31 +10:00
Nyall Dawson
a769448e70 Also port processing densify to distance to c++
- Add QgsGeometry method to densify by distance
- Fix bug in processing algorithm which resulted in duplicate
vertices and incorrectly spaced extra vertices
2017-03-25 16:23:29 +10:00
Nyall Dawson
5360b79174 [FEATURE] New API QgsGeometry::densifyByCount
Densifies a geometry by adding a specified number of vertices
to each segment
2017-03-25 15:07:16 +10:00
Nyall Dawson
7c79803cc3 Add missing dynamic cast for QgsTriangle to sip bindings 2017-03-22 10:20:01 +10:00
lbartoletti
fb3d07f3f5 [FEATURE] New class for triangle
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
2017-03-21 18:50:47 +10:00
lbartoletti
3703bf7396 Move midpoint to QgsGeometryUtils 2017-02-15 08:48:12 +10:00
lbartoletti
e851b68c53 Add some utils functions for QgsPointV2 (distance3D, midpoint) 2017-02-15 08:48:08 +10:00
Vincent Mora
77bf999094 Merge pull request #3905 from nextgis/25d_enhancement
[FEATURE] QGIS setting to choose default Z value
2017-02-13 09:11:27 +01:00
Nyall Dawson
767e7a53c6 Expose QgsGeometryUtils to python bindings
Has some handy functions and there's no strong reason anymore
why these shouldn't be part of stable API
2017-02-12 13:01:24 +10:00
alisovenko
d780ba7593 Merged master fixed conflict. 2017-02-03 18:11:49 +03:00
Nyall Dawson
aaa8c4e492 [FEATURE] Expose GEOS Voronoi and delaunay triangulation to QgsGeometry 2017-01-31 19:35:32 +10:00