437 Commits

Author SHA1 Message Date
Nyall Dawson
d6f09c012e [FEATURE] Add method to calculate pole of inaccessibility for polygons
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.
2016-11-14 15:52:41 +10:00
Martin Dobias
d729951dcd Remove caching of WKB from QgsGeometry (was kept just for compatibility)
Also improves the API to export/import WKB as QByteArray
2016-11-14 13:36:12 +08:00
Nyall Dawson
3ef7b3b7eb [processing] Use standard QGIS projection selection widget for CRS params 2016-11-13 20:34:35 +10:00
Nyall Dawson
132e76a596 [FEATURE][processing] New input type for expressions
This adds a new input type for expression inputs. Expression
inputs can be linked to a parent layer so that the builder
shows the correct fields and layer variables.

It's designed for two use cases:

1. to be used when an algorithm specifically requires an expression,
eg Select by Expression and Extract by Expression.

2. to be potentially used as a replacement input instead of string
or number literals in algorithms. Eg - if the simplify algorithm
tolerance parameter was replaced with an expression paremeter, then
this expression would be evaluated for every feature before
simplifying that feature. It would allow parameters to be calculated
per feature, as opposed to the current approach of calculating
a parameter once before running the algorithm. It would also
mean algorithms like "variable distance buffer" would no longer
be needed, as a single "buffer" algorithm could then be used
for either a fixed distance, field based, or expression based
distance.
2016-11-11 13:26:31 +10:00
Alvaro Huarte
dc800dbab7 Fix iteration of features 2016-11-11 00:28:27 +01:00
volaya
72fddb8b5e Merge pull request #3470 from arnaud-morvan/refactor_fields_context_generator
[Processing] Fix processing refactor fields algorithm using expression context generators
2016-11-08 10:45:32 +01:00
volaya
7c4e66b360 Merge pull request #3726 from arnaud-morvan/processing_various_fixes
[processing] small fixes
2016-11-08 10:30:06 +01:00
Nyall Dawson
3550cc99a6 [processing] Allow algorithms to specify tags
Tags are used while searching in the toolbox. This should help with
finding algorithms when the exact name is not known, eg
you could search for "envelope" or "bounds" and find the
'Polygon from Layer Extent' algorithm.

At the moment it's quite hard to discover algorithms which exist
when you don't know what their called and have to instead search
for every possible naming variant which could exist...
2016-11-08 10:15:31 +10:00
Nyall Dawson
4e4bb2bf6b Merge pull request #3728 from nyalldawson/open
Cleanup processing file handling
2016-11-07 13:20:13 +10:00
Nyall Dawson
8acc286b0f [FEATURE] Snap to layer algorithm accepts a mode parameter
With a new option to prefer to snap to closest point on geometry.
The old behaviour was to prefer to snap to nodes, even if a node
was further from the input geometry than a segment. The new option
allows you to snap geometries to the closest point, regardless
of whether it's a node or segment.
2016-11-07 12:20:59 +10:00
Nyall Dawson
dae0a01761 [FEATURE][processing] Snap geometries algorithm allows snapping
to other layer types, supports point/line layers

Fix #14791, #15313
2016-11-07 12:20:59 +10:00
Nyall Dawson
c3a978b9da [FEATURE][processing] Snap geometries to layer algorithm
Port the Geometry Snapper plugin across to the analysis lib, and
expose to python bindings

Add a new algorithm which performs the snapping to layers
2016-11-07 12:20:59 +10:00
Nyall Dawson
6a99017bf0 [processing] Use with ... when opening files 2016-11-07 11:36:38 +10:00
Nyall Dawson
eefa7115bf [processing] Fix invalid geometries made by densify when input geom is null 2016-11-07 09:22:50 +10:00
arnaud.morvan@camptocamp.com
78236c0be1 Use contextGenerator in refactor fields algorithm 2016-11-06 18:11:15 +01:00
arnaud.morvan@camptocamp.com
93be141af5 [processing] Fix import error in FieldsMappingPanel 2016-11-06 13:03:06 +01:00
nirvn
03e29d4f01 [processing] optimise singlepart to multipart algorithm
- keep z/m/curved geometries intact
- rewrite loop to avoid the cost of nb. feature x unique values
2016-11-03 09:05:31 +07:00
Nyall Dawson
a44ea22880 Small refinement to multipart to singlepart alg 2016-11-03 05:40:11 +10:00
Alexander Bruy
5d877fd888 Merge pull request #3707 from nyalldawson/multipart_to_single
[processing] optimise multipart to singlepart algorithm
2016-11-02 10:06:25 +02:00
Nyall Dawson
18fc0c6fad [processing] optimise multipart to singlepart algorithm
- simplify code
- keep z/m/curved geometries intact
- might be a bit faster
2016-11-02 16:06:00 +10:00
Nyall Dawson
f65e770242 [FEATURE[processing] New algorithm to compute geometry by expression
This algorithm updates existing geometries (or creates new
geometries) for input features by use of a QGIS expression. This
allows complex geometry modifications which can utilise all the
flexibility of the QGIS expression engine to manipulate and create
geometries for output features.
2016-11-02 16:05:46 +10:00
Nyall Dawson
a117df2205 Merge pull request #3656 from nirvn/processing_import_to_spatialite
[processing] add "Import into Spatialite" algorithm
2016-10-31 09:14:19 +10:00
Nyall Dawson
82312e10e4 [FEATURE][processing] New algorithm to extract specific nodes
This algorithm allows you to extract specific nodes from geometries.
Eg you can extract the first or last node in the geometry.

The algorithm accepts a comma separated list of node indices to
extract, eg 0 = first node, 1 = second node, etc. Negative indices
can be used to extract nodes from the end of the geometry. Eg
-1 = last node, -2 = second last node.
2016-10-31 07:56:24 +10:00
Nyall Dawson
8dab2cd4d7 [FEATURE][processing] New algorithm to extend lines
Allows extending linestrings by a set distance at the start
and end of the line
2016-10-31 07:56:24 +10:00
Nyall Dawson
c494c472ac Merge pull request #3690 from nyalldawson/extract_by_exp
[FEATURE][processing] New extract by expression algorithm
2016-10-30 08:23:40 +10:00
nirvn
121f48d654 [processing] add import into spatialite algorithm 2016-10-29 09:33:47 +07:00
Nyall Dawson
74e64645e4 [FEATURE][processing] New extract by expression algorithm
Filters an input layer by expression
2016-10-29 08:05:26 +10:00
Paolo Cavallini
79e5911e07 Update RegularPoints.py
Fixes #15773
2016-10-28 09:11:28 +02:00
volaya
b58229009b indentation fix 2016-10-27 14:36:31 +02:00
volaya
472a550168 [processing] fixed field loading in field calculator
fixes #15767

Conflicts:
	python/plugins/processing/algs/qgis/ui/FieldsCalculatorDialog.py
2016-10-27 14:36:30 +02:00
Nyall Dawson
5eb875d63b [processing] Add algorithm to strip null geometries 2016-10-24 11:24:37 +10:00
Nyall Dawson
12a7bb34e8 [processing] Fix qgis zonal stats algorithm 2016-10-24 08:41:16 +10:00
Juergen E. Fischer
28abbf9513 add *.py to .gitattributes 2016-10-23 08:38:36 +02:00
Nyall Dawson
3cc9b5d962 Indentation 2016-10-22 09:03:24 +10:00
nirvn
772f2019c1 [processing] add a spatialite execute SQL algorithm 2016-10-21 10:05:03 +07:00
Alexander Bruy
89fa21e5fa [processing] more complete support for int64 fields (follow up 8d2cc8806b)
(cherry picked from commit 649d41f1ecd4b8d22110e11cb9e693231bec8ed2)
2016-10-20 21:02:37 +03:00
Germán Carrillo
62a9436178 Using QVariant.Type enum instead of numbers for readability.
(cherry picked from commit 6df926dfe6e3e8f7ac330fbb9206dc69492da6ed)
2016-10-20 21:02:37 +03:00
Germán Carrillo
4730d25012 Fixing issue with 'Eliminate sliver polygons' and fields of type long.
(cherry picked from commit be25a29da196fac687f95abffb71e34138e3d20c)
2016-10-20 21:02:37 +03:00
Juergen E. Fischer
2013984297 fix translation strings 2016-10-20 18:16:37 +02:00
Alexander Bruy
8f7183b2a4 [processing] add icon for zonal statistics tool 2016-10-20 12:13:51 +03:00
Alexander Bruy
7bd4315970 [processing] expose zonal statistics from Zonal statistics plugin in toolbox 2016-10-20 12:13:51 +03:00
Alexander Bruy
ea0ad5dd21 Merge pull request #3592 from alexbruy/processing-interpolation
[processing] add interpolation tools
2016-10-20 11:31:43 +03:00
Mathieu Pellerin
cf6004959e [processing] ensure that outputs of vector overlay operations are multiparts (#3622) 2016-10-19 14:58:23 +02:00
Alexander Bruy
ca66951ab1 [processing] add icons for interpolation tools 2016-10-19 14:59:41 +03:00
Alexander Bruy
774965c2d4 [processing] expose TIN interpolation from interpolation plugin in toolbox 2016-10-19 14:59:41 +03:00
Alexander Bruy
f7575e08f5 [processing] expose IDW interpolation from Interpolation plugin in toolbox 2016-10-19 14:58:35 +03:00
Piotr Pociask
cd0fefb42b [processing] Update voronoi classes for Python3; update expected data for multipoint Delaunay traingulation test 2016-10-19 11:15:38 +02:00
Piotr Pociask
3af23036fd Test for multipoint Delaunay triangulation 2016-10-19 11:15:38 +02:00
Piotr Pociask
41fafd6982 [processing] support MultiPoint geometries in Delaunay triangulation 2016-10-19 11:15:38 +02:00
Nyall Dawson
cea47427d0 Optimise creation of spatial indexes
Use constructor which takes an iterator instead of manually
adding features, and don't request attributes for spatial
index features
2016-10-19 08:38:11 +10:00