48108 Commits

Author SHA1 Message Date
Nyall Dawson
827eee93df [processing] Fix feedback message in merge vector alg 2018-06-08 13:08:34 +10:00
Nyall Dawson
77786f38c3 [processing][SAGA] Fix interpolation choices for add grid values algorithms
And add more tests

Fixes #19132
2018-06-08 12:18:35 +10:00
Nyall Dawson
4444428133 Add some tooltips to diagram show properties
Refs #19109
2018-06-08 11:43:29 +10:00
Nyall Dawson
b1c894969e Fix data defined show diagram setting does not always work
Fixes #19109
2018-06-08 11:43:29 +10:00
Nyall Dawson
57c442a443 [layouts] Fix item_variables function with non-lowercase item ids
Fixes #19063
2018-06-08 11:11:55 +10:00
Nyall Dawson
262a01f53c Supress dos2unix output 2018-06-08 11:00:25 +10:00
Nyall Dawson
de38bf01ca Use a raster iterator for zonal stats, to optimise zonal stats
calculation of large zones with lots of corresponding raster pixels
2018-06-08 10:13:13 +10:00
Nyall Dawson
b637c7fe22 Prevent background execution of zonal stats
This algorithm is NEVER safe to run in the background, because
it directly modifies a layer in place.

We should:
- make a variant of this algorithm which returns a new layer
AND
- refactor the QgsZonalStats code to create a separate map
of feature->stats, and then modify the existing Zonal Stats
algorithm to apply these changes in a post processing step
2018-06-08 10:13:13 +10:00
Nyall Dawson
6bf7c0eb92 Better constructor, dox 2018-06-08 10:13:13 +10:00
Nyall Dawson
e97f0d3230 Update processing test results 2018-06-08 10:13:13 +10:00
Nyall Dawson
fc5eb96295 Make zonal statistics algorithm thread safe 2018-06-08 10:13:13 +10:00
Nyall Dawson
b533dd8e31 Fix zonal stats min/max values when pixel area is greater than
polygon area
2018-06-08 10:13:13 +10:00
Nyall Dawson
83d44b9fe9 Fix zonal statistics calculations when pixel size is greater than
polygon size

Fixes #17159
2018-06-08 10:13:13 +10:00
Nyall Dawson
985aee6920 Fix incorrect calculation of zonal statistics
Raster block extent was based on intersection of raster vs
feature's bounding box, which was not necessarily snapped to
multiples of the pixel size. But the pixel center point/extent
was being calculated as though the retrieved extent was an
exact multiple of the pixel size. This led to incorrect
retrieval of pixel values.
2018-06-08 10:13:13 +10:00
Nyall Dawson
e9bf7f17c7 Add thread safe method of constructing QgsZonalStatistics,
using a QgsRasterInterface instead of a QgsRasterLayer
2018-06-08 10:13:13 +10:00
Nyall Dawson
8ddab4476a Ensure zonal stats respsects all user set no data values 2018-06-08 10:13:13 +10:00
Nyall Dawson
839139619c Minor refactoring, avoid use of old style cast 2018-06-08 10:13:13 +10:00
Nyall Dawson
ff9e7ba328 Use prepared geometries to check for intersection between
pixel rectangles and polygons when doing exact statistics
calculations in zonal stats

Sppeds up zonal stats calculation by ~10x when pixel size
is large (compared to polygon sizes)
2018-06-08 10:13:13 +10:00
Nyall Dawson
43d85675c9 Avoid use of raw GEOS API 2018-06-08 10:13:13 +10:00
Nyall Dawson
1631a8269a Use doubles, not float values, within zonal stats 2018-06-08 10:13:13 +10:00
Nyall Dawson
919f558877 Use unique_ptr 2018-06-08 10:13:13 +10:00
Nyall Dawson
f6fa022910 Fix missing definition in data defined buttons
Fixes #19110
2018-06-08 10:09:39 +10:00
Nyall Dawson
da89f18ed1 Fix some clazy eventFilter warnings 2018-06-08 10:04:01 +10:00
Nyall Dawson
719adfa511 Capitalization 2018-06-08 09:59:59 +10:00
Nyall Dawson
b95375a42b Use standard crosshair cursor in layouts 2018-06-08 09:55:34 +10:00
Loïc Bartoletti
048db933a6 remove specific cursor for QgsMeasureTool 2018-06-08 09:54:52 +10:00
Denis Rouzaud
088e94f909 [cmake] fix deprecated OLD policy for CMP0053
https://cmake.org/cmake/help/v3.1/policy/CMP0053.html
2018-06-08 08:06:26 +10:00
Harrissou Sant-anna
d674a5389d Add the Copy and Move Feature(s) button to Edit menu (#6884) 2018-06-07 12:15:13 -08:00
Denis Rouzaud
38ef187c02 [move feature tool] respect CAD constraint [fix #19141] 2018-06-07 15:58:18 -04:00
Alessandro Pasotti
51ae8e9e97
Merge pull request #7195 from elpaso/bugfix-18981-export-qlr-crash-2
[bugfix] Crash when exporting (invalid) legend to qlr
Fixes #18981
2018-06-07 09:55:25 +02:00
Alessandro Pasotti
b307f39f63 Added broken qlr file for the test case 2018-06-07 09:05:16 +02:00
Alessandro Pasotti
ad49cfb3a4 Add test for QgsLayerDefinition (regression #18981) 2018-06-07 08:18:59 +02:00
Alessandro Pasotti
a3893215cc Include QDomNode (needed to build the test) 2018-06-07 08:17:09 +02:00
Alessandro Pasotti
2f2221aec7 Do not return invalid layers from findLayers() 2018-06-07 08:16:11 +02:00
Nyall Dawson
22a98fb680 [processing] Allow choice of field prefix for Join algorithms
Avoids clash of field names resulting in potentially misleading results
2018-06-07 14:24:16 +10:00
Denis Rouzaud
42c0b39812
[cmake] fix deprecated OLD policy CMP0048 (#7193) 2018-06-06 17:33:38 -08:00
Alessandro Pasotti
ec909b0aab [bugfix] Crash when exporting (invalid) legend to qlr
Fixes #18981 Save QLR crashes QGIS 3

This patch definitely prevents the crash but I'm not sure if
we should also introduce the same check in QgsLayerTree::isLayer
or even in QgsLayerTreeGroup::findLayers() or also when importing
a qlr that might lead to invalid layer (like in this
bug report).
2018-06-06 17:57:17 +02:00
Harrissou Sant-anna
2e5e20eb54 [needs-docs] Remove obsolete tooltip on "Move Feature(s)" tool (#7191)
now that it fully handles snapping
2018-06-06 05:00:35 -08:00
Nyall Dawson
71f3aaf39e Fix crash in merge features dialog
Fixes #19119
2018-06-06 20:24:43 +10:00
Denis Rouzaud
b2274258a4 fix sip test
only check for Python file if it is produced
2018-06-05 17:02:17 -08:00
Nyall Dawson
4e38d0696e Documentation 2018-06-06 06:27:33 +10:00
Nyall Dawson
40a2062ec1 [python] Don't install error hook by default
This error hook should only ever be used from QGIS app, never
from standalone scripts and applications, so we should default
to not using it and only install it when initializing python
from app.

Otherwise default behavior for standalone scripts based on
PyQGIS is to silently swallow exceptions - this leaves script
developers *no clues* to go off to debug their applications,
meaning that errors which would usually take a couple of seconds
to fix become horrible exercises in frustration for those
unaware of QGIS' exception handling and the
QGIS_DISABLE_MESSAGE_HOOKS environment variable.

Refs #19111
2018-06-06 06:27:33 +10:00
Nyall Dawson
cbbe905fae [processing] Fix missing schemas in postgis destination selection panel 2018-06-06 06:27:03 +10:00
Tom Chadwin
9780068548 Avoid deprecated regex
Avoid invalid escape sequence via raw string:

`re.compile('^[^\s\(]+')` > `re.compile(r'^[^\s\(]+')`
2018-06-06 06:24:24 +10:00
Tom Chadwin
fab563fe71 Processing: avoid deprecated regex
Invalid escape sequence avoided via raw string:

`re.findall("\d+|[a-zA-Z]+", rep[0][0])` > `re.findall(r"\d+|[a-zA-Z]+", rep[0][0])`
2018-06-06 06:24:24 +10:00
Tom Chadwin
6a8a622ea4 Processing: Avoid deprecated regex
Escape sequence avoided in DefinProjection by using raw string:

`re.compile('\|.*')` > `re.compile(r'\|.*')`
2018-06-06 06:24:24 +10:00
Blottiere Paul
0e7238448a
Merge pull request #7078 from arnaud-morvan/server_proper_literal_convertion
[server] Proper convertion of literals in Filters
2018-06-05 16:22:08 +01:00
Even Rouault
370bac9935
Merge pull request #7152 from rouault/fix_memleaks_qgsstyle
Fix various memleaks in QgsStyle
2018-06-05 17:03:55 +02:00
Nyall Dawson
88a49e7e33 Fix zonal stats doesn't work with raster/vector in different CRS
Fixes #19027
2018-06-05 23:04:58 +10:00
arnaud.morvan@camptocamp.com
b07c334723 [server] Proper convertion of literals in Filters
Convert OGC Filter's literals accordings to field type.
This can have a huge impact on performance in some cases.
For example for a filter like "num_char" = '+2' converted to "num_char" = 2,
this result with PostgreSQL provider in a fallback to client side evaluation for the whole filter,
including the bbox if present.
2018-06-05 14:26:37 +02:00