6762 Commits

Author SHA1 Message Date
Nyall Dawson
e99072b161 Add method to QgsStatisticalSummary to get a short name corresponding to a stat
Returns a short name, suitable for use in a field name
2019-01-04 05:01:40 +10:00
Nyall Dawson
5f817b4db3 Allow QgsStatisticalSummary to calculate first/last value
Trivial, but simplifies other code which desires to expose
a choice between first/last/min/max/mean/etc...
2019-01-04 05:01:40 +10:00
Nyall Dawson
201523fb85 Test masks 2019-01-03 04:53:28 +10:00
Nyall Dawson
a441e2b14b [layouts] Add API allowing drawing map overviews under map layers
or under map labels
2019-01-03 04:53:28 +10:00
Nyall Dawson
12da3afa85 [layouts] Add method to alter list of map layers to render to include
overview layers
2019-01-03 04:53:28 +10:00
Nyall Dawson
1b309c6810 [layouts] Add setters/getters for map item stacking positions 2019-01-03 04:53:28 +10:00
Nyall Dawson
6eb49feddc [layouts] Add method to get overview item extent as a vector layer
The layer contains a single feature representing the linked map
extent, and set to render using the overview's symbol
2019-01-03 04:53:28 +10:00
Nyall Dawson
0f7d8c05e3 Split layout map overview tests into their own file, add masks 2019-01-03 04:53:28 +10:00
Nyall Dawson
d14a5bd1dd [layouts] Add inbuilt validity check to warn when scale bars are
not linked to a map item

(and remove test Web mercator projection warning check)
2019-01-03 04:53:07 +10:00
Nyall Dawson
ddd522b432 Rework validity check API to allow future background threaded use 2019-01-03 04:53:07 +10:00
Nyall Dawson
7ccaa3df32 [FEATURE][API] Add flexible framework for custom "validity checks"
Adds a new interface QgsAbstractValidityCheck which defines
a single "check" which can be performed on a given QgsValidityCheckContext.
A new application-wide QgsValidityCheckRegistry registers
and manages instances of all known checks, and allows running
of all registered checks of a specific type at once.

Initially the framework is focused toward print layout validity
checks, but the interface has been designed to be generic enough
to allow alternative types of validity checks (e.g. project save
validity checks, processing model validity checks, etc.).

The API is designed to be used both by internal validity checks
and also to be extended by custom, organisation-specific
validity checks. E.g., for print layout validity checks we could have:
2019-01-03 04:53:07 +10:00
Matthias Kuhn
309920a272
Merge pull request #8733 from m-kuhn/geometry_check_api_docs
Add geometry check to API documentation
2018-12-24 16:58:25 +01:00
Matthias Kuhn
d2b35753be
Merge pull request #8722 from m-kuhn/expression_function_sqlite_fetch_and_increment
Expression function sqlite_fetch_and_increment
2018-12-24 12:07:12 +01:00
Nyall Dawson
f301f944bd Revert QgsBlockingNetworkRequest
Too many issues... I'm unsure if this is even possible now...
2018-12-23 20:19:03 +10:00
Matthias Kuhn
868254d672
Merge pull request #8725 from troopa81/fix_20673
Correct mapFromSource method when reordering columns. fixes #20673
2018-12-22 11:56:13 +01:00
Matthias Kuhn
d3f64deb80
Further doc improvements 2018-12-22 11:54:43 +01:00
Matthias Kuhn
525a3da3ab
More doxygen 2018-12-22 10:57:53 +01:00
Matthias Kuhn
07ab092fb1
Some doc fixes 2018-12-22 10:35:30 +01:00
Matthias Kuhn
c6420690b5
Skip more missing doc checks for old classes 2018-12-22 10:16:24 +01:00
Matthias Kuhn
2ad870b95a
Suppress api doc warnings for old classes 2018-12-21 18:06:40 +01:00
Matthias Kuhn
36c42d2b97
Check for proper error reporting in sqlite_fetch_and_increment 2018-12-21 14:07:24 +01:00
Alessandro Pasotti
f4d7506e73 Processing in-place do not check validity when fixing geometries
Fixes #20812
2018-12-21 11:47:36 +01:00
Nyall Dawson
a457482de8 Add attributes to QgsNetworkReplyContent 2018-12-21 09:05:45 +10:00
Nyall Dawson
d5fddfd588 Basic unit tests for QgsBlockingNetworkRequest 2018-12-21 09:05:45 +10:00
Nyall Dawson
a2b5008b30 [FEATURE][layouts] Allow layout items to "block" map labels
This feature allows other layout items (such as scalebars,
north arrows, inset maps, etc) to be marked as a blockers for
the map labels in a map item. This prevents any map labels from
being placed under those items - causing the labeling engine
to either try alternative placement for these labels (or
discarding them altogether)

This allows for more cartographically pleasing maps -- placing
labels under other items can make them hard to read, yet without
this new setting it's non-trivial to get QGIS to avoid placing
the labels in these obscured areas.

The blocking items are set through a map item's properties, under
the label settings panel. The setting is per-map item, so you can have
a scalebar block the labels for one map in your layout and not others
(if you so desire!)
2018-12-21 04:12:32 +10:00
Nyall Dawson
620baa0d22 Layout map test reference image updates 2018-12-21 04:12:32 +10:00
Julien Cabieces
fba4b25bc2 fixes #20673 : Correct mapFromSource method when reordering columns 2018-12-20 17:21:56 +01:00
sklencar
be34a0ed27 QgsZipUtils unzips also subdirectories of a zip file (#8672)
QgsZipUtils unzips also subdirectories of a zip file
2018-12-20 14:42:22 +01:00
Matthias Kuhn
5d8f6371e1
Add test for sqlite_fetch_and_increment 2018-12-20 14:32:24 +01:00
Nyall Dawson
055a166136 [FEATURE] Boolean field support for memory layers
Adds support for boolean field types to memory layers

Fixes #20844
2018-12-20 18:36:36 +10:00
Matthias Kuhn
bd87b35430
Merge pull request #8713 from m-kuhn/sqlite_quoted_value_to_qgssqliteutils
Move sqlite quoted value methods to QgsSqliteUtils
2018-12-20 08:37:35 +01:00
Mathieu Pellerin
e9e1e0d6f3
[FEATURE][expression] Brand new array_sort() function 2018-12-20 11:47:16 +07:00
Matthias Kuhn
237d40af61
Improve QgsSqliteUtils::quotedIdentifier test 2018-12-19 14:44:28 +01:00
Matthias Kuhn
0437d4ad68
Add tests for quoting sqlite values 2018-12-19 14:44:28 +01:00
Matthias Kuhn
0f037daf47
Merge pull request #8649 from qgis/expression_function_decode_uri
Expression function `decode_uri`
2018-12-19 08:32:09 +01:00
Alessandro Pasotti
56ca46efa9
Merge pull request #8706 from elpaso/bugfix-20674-dbmanager-aliased-3
Fix views query tables in spatialite
2018-12-19 07:43:48 +01:00
signedav
03222c829a fix typo 2018-12-18 22:09:34 +01:00
Nyall Dawson
514c5e2ac5 [api] Raises ValueError and TypeError exceptions when QgsGeometry.asPolygon()
is called on non-single-polygon geometries

Previously we would just return an empty list when geometries of invalid
type were used, but this is dangerous and we are safer to explicitly
raise errors preventing use of asPolygon() with incompatible geometry types.
2018-12-19 05:22:11 +10:00
Nyall Dawson
06d5f924f6 More square brackets 2018-12-19 05:21:49 +10:00
signedav
40c6896fb9 check for GDAL Version and exclude by ifdef 2018-12-18 18:32:30 +01:00
Alessandro Pasotti
07d9d1dbb8 Fix views query tables in spatialite
There is still an old issue: views are only available
through DB manager.

Fixes #20674 - again

- Life is really simple, but we insist on making it complicated.
Confucius
2018-12-18 18:32:14 +01:00
Matthias Kuhn
7b876d81f8
Fix test 2018-12-18 13:47:46 +01:00
Matthias Kuhn
84584012ec
Add docs and tests for decode_uri 2018-12-18 13:47:46 +01:00
signedav
de12239b7e adding and removing json attributes 2018-12-18 09:33:07 +01:00
Nyall Dawson
7d648e5b51 Improve Python __repr__ handling for null geometries
Also avoid massive long __repr__ strings for complex geometries,
as these can flood the Python console (and first aid plugin),
and aren't useful for debugging anyway.

Refs #14640
2018-12-18 18:11:22 +10:00
Nyall Dawson
089a2f1c17 [FEATURE][layouts] Add new setting to control whether map items
should show partial labels

Layout map items no longer respect the default project setting
for "show partial labels", and instead have their own, per map
setting for this option. (Under the map item properties,
labeling settings button).

The map item setting always defaults to off (unlike the canvas
setting, which defaults to true for a new project) as layouts
should always default to the settings which produce the highest
quality cartographic outputs.

In general I suspect that most users would always want to avoid
rendering partial labels in layouts, but this setting was
previously so deeply hidden that most are unaware of how to
change it. (And previous discussion about changing the canvas
setting to hide partial labels deemed this default undesirable
for the canvas, where showing even a small part of a label
on the map border can help identify what sits just on/off
the edges of the map)
2018-12-18 15:32:29 +10:00
Nyall Dawson
5acd7ffaef [processing] Add API to set default unit to distance parameters
Otherwise the API forces use of a corresponding CRS parameter in
order to determine the relevant distance unit, but this is not
always desirable
2018-12-18 04:39:06 +10:00
Nyall Dawson
d1e9ce1f69 [api] Raises ValueError and TypeError exceptions when QgsGeometry.asPolyline()
is called on non-single-line geometries

Previously we would just return an empty list when geometries of invalid
type were used, but this is dangerous and we are safer to explicitly
raise errors preventing use of asPolyline() with incompatible geometry types.
2018-12-18 04:38:42 +10:00
Nyall Dawson
645ca2b351 [ogr] Fix conversion of boolean values
Fixes #20290
2018-12-18 04:37:57 +10:00
signedav
7dbd7a1100 basic tests for json writing 2018-12-17 16:26:06 +01:00