5349 Commits

Author SHA1 Message Date
Nyall Dawson
d293c5d0a0 Code shuffle to avoid duplicate code 2018-03-22 16:13:30 +11:00
Nyall Dawson
99faf06f60 Make project title getters/setters a shortcut to metadata title field
And silently upgrade old project titles to metadata titles
2018-03-22 16:13:30 +11:00
Nyall Dawson
bba3f6c6fe Add QgsProjectMetadata member to QgsProject 2018-03-22 16:13:30 +11:00
Nyall Dawson
09aca080ec Add new QgsProjectMetadata metadata class
For storing QgsProject metadata. Contains all metadata items
from QgsMetadataBase, plus adds author and creation datetime
metadata items.
2018-03-22 16:13:30 +11:00
Nyall Dawson
1e05de049a Update metadata validator for base class split 2018-03-22 16:13:30 +11:00
Nyall Dawson
a96d59a1a6 Create unit test for QgsMetadataBase 2018-03-22 16:13:30 +11:00
Nyall Dawson
a2ba566e2b Fix generation of world file when exporting canvas
Fixes #18491
2018-03-22 11:18:26 +11:00
Nyall Dawson
66c8a85b88 Fix incorrect display of coordinates in status bar 2018-03-21 22:20:43 +11:00
Nyall Dawson
9ab4d96362 [processing] Don't try to load algorithms for disabled providers
Fixes #18488
2018-03-21 08:45:38 +11:00
Alessandro Pasotti
a160e7494c Reference file for the WFS endless loop test 2018-03-19 15:01:57 +01:00
Alessandro Pasotti
1b31e55871 [test] for WFS Fix endless loop
Greetings from Bonn!
2018-03-19 15:00:11 +01:00
Nyall Dawson
fa2c5aebb7 [FEATURE][processing] Import geotagged photos algorithm
This implements a new "import geotagged photos" algorithm
for processing. It allows selection of a folder which it
will scan for jpg files which have been geotagged and
creates a PointZ layer with the result, with attributes
for photo path, altitude, direction and timestamp.

Optionally the scan can be recursive and you can create
an optional table of photos which could not be read
or which were missing geotags.

The algorithm automatically sets the output table to
use an external resource widget to display the linked
photos in the attribute form.

[ALGCHANGE]
2018-03-16 15:08:29 +11:00
Nyall Dawson
435c14d1ee Unlikely attempt to stop flaky rule based renderer test crashing out 2018-03-16 08:18:36 +11:00
Nyall Dawson
7c0665a331 Clearer ownership, docs for rule based renderer 2018-03-16 08:18:36 +11:00
Luigi Pirelli
685adbf7e1
Merge pull request #6615 from elpaso/bugfix-16967-multi-in-value-relation
[bugfix] value relation widget with Allow multiple selection doesn't resolve
2018-03-15 17:09:45 +01:00
Luigi Pirelli
d771991a01
Merge pull request #6603 from slarosa/fix_18435
Fixes #18435: QGIS crash when deleting auxiliary layer
2018-03-15 15:15:55 +01:00
Alessandro Pasotti
4f05ed1dd7 [bugfix] value relation widget with Allow multiple selection doesn't resolve
Now it will accept arrays as well as string representations of arrays

Added a test

Fixes #16967 value relation widget with Allow multiple selection doesn't resolve the values anymore
2018-03-15 15:11:52 +01:00
Salvatore Larosa
74689dfe9d fix typo: followup 24ef27d079 2018-03-15 14:32:57 +01:00
Salvatore Larosa
24ef27d079 add unit test for setAuxiliaryLayer 2018-03-15 11:01:23 +01:00
Nyall Dawson
bd1d87ed86 [processing] Allow algorithms to set layer post-processors for
execution on generated layers after the algorithm (or parent
model) completes

This commit adds an interface for layer post-processing handlers
for execution following a processing algorithm operation.

Post-processing of a layer will ONLY occur if that layer is set
to be loaded into a QGIS project on algorithm completion.

Algorithms that wish to set post-processing steps for generated
layers should implement this interface in a separate class
(NOT the algorithm class itself!) and implement a method
to handle the layer post-processing.

This method always runs in the main thread and can be used to
setup renderers, editor widgets, metadata, etc for the given layer.

Fixes #17961
2018-03-15 17:55:25 +11:00
Nyall Dawson
9e351e80fc Fix flaky VirtualLayerTask test 2018-03-15 13:42:44 +11:00
Nyall Dawson
feb20a7a27 Add unit test for postgres layer metadata 2018-03-15 10:43:04 +11:00
Denis Rouzaud
4c1e19c080 fix constraints not checked when they should be (#6550) 2018-03-14 07:49:37 -04:00
Nyall Dawson
7e6796c657 By default, generate new layer colors from a random selection
in a preset palette

The palette is packaged as resources/new_layer_colors.gpl

TODO: allow users to set a different palette
2018-03-13 10:39:49 +11:00
Nyall Dawson
bc449c401b Move generation of default symbol random colors to
QgsColorSchemeRegistry

and add API to set a QgsColorScheme from which to pull
colors when creating a random symbol color.
2018-03-13 10:39:49 +11:00
Alessandro Pasotti
ea0c7058a5
Merge pull request #6576 from elpaso/bugfix-18292-extra-params-search
[server][bugfix] accept getfeatureinfo filter without h/w
2018-03-12 12:05:30 +01:00
Nyall Dawson
41d16a8491 Unit tests for straightDistance2d/sinuosity 2018-03-12 14:58:04 +11:00
Alessandro Pasotti
39778b16d8 Added test reference file for getfeatureinfo no width 2018-03-11 12:55:28 +01:00
Alessandro Pasotti
59e68d9e4a [server][bugfix] accept getfeatureinfo filter without h/w
When INFO_FORMAT is not an image format there is no
need to make image WIDTH and HEIGHT mandatory.

2.x accepted that, 3.x raised an exception.

This is a partial fix: SRS is still mandatory because
fixing this would require a deeper refactoring and
I believe we can live with it, because SRS will be
required if filters are combined with geometry filters,
while passing a WIDTH/HEIGHT when we don't want an image
back is always useless.

A test was also added.
2018-03-11 11:43:27 +01:00
Alessandro Pasotti
5281c8411d [test][server] Houskeeping: split getfeatureinfo
put it in its own test
2018-03-11 10:41:32 +01:00
Nyall Dawson
0c1ceb3900 [FEATURE][layouts] Data defined table source for attribute table items
When an attribute table is set to a "Layer features" source, this
allows the underlying vector layer from which to source features
to be data defined.

(All existing table attributes (column settings) are left intact,
so setting a data defined table to a layer with different fields
will result in empty columns in the table.)

Sponsored by Kartoza/Inasafe
2018-03-11 10:22:46 +11:00
Nyall Dawson
97324661c7 Add layout util to retrieve map layer from project by string
Considers both layer id (preferred) and layer names
2018-03-11 10:22:46 +11:00
Nyall Dawson
60afeadf44 Add QgsProjectDirtyBlocker and QgsProject.blockDirtying to prevent
project dirtying for the lifetime of an object

Python code can then call:

    project = QgsProject.instance()
    with QgsProject.blockDirtying(project):
      # do something

Use QgsProjectDirtyBlocker to prevent projects being marked as
dirty while creating a new project or while loading an existing
project -- avoids the titlebar temporarily showing the project
state as unsaved while it is being loaded.
2018-03-11 08:44:51 +11:00
Tudor Bărăscu
10cfca48d6 add server test for GetMap with styles and opacities
Covers https://issues.qgis.org/issues/15553 case
2018-03-09 13:20:20 +02:00
Nyall Dawson
00802e5cb2 Update test mask image 2018-03-09 13:34:40 +11:00
Nyall Dawson
8c780dc12f Add @project_home expression variable 2018-03-09 11:15:55 +11:00
Nyall Dawson
4e5c08e2b5 [FEATURE] Allow overwriting the project home path
This allows the project home path (which is used by the browser
to create the 'Project Home' item) to be set by users for a
project, instead of always matching the location where the project
is saved.

This allows users to set the project home to a folder which contains
data and other content, and is especially useful for organisations
where qgis projects are not stored in the root folder of a organisational
'project'.

Project home paths can also be set to relative paths, in which
case they will be relative to the project saved location.

The path can be set through the Project Properties dialog, or
by right-clicking on the Project Home browser item and
selecting 'set project home'

Sponsored by SMEC/SJ
2018-03-09 11:15:55 +11:00
Nyall Dawson
35b5c7820a Add test that AFS provider gets renderer by default 2018-03-07 16:28:47 +11:00
Nyall Dawson
7a3415257b Add unit tests for ArcGIS rest style parsing 2018-03-07 16:28:47 +11:00
Mathieu Pellerin
b42c893bbc
[FEATURE] color_grayscale_average() and color_mix_rgb() expression functions (#6554) 2018-03-07 11:59:52 +07:00
Luigi Pirelli
74d14ae3d4
Merge pull request #6414 from alexispolti/fix-project-path
Fix project path when path contains a symbolic link
2018-03-06 23:46:08 +01:00
Matthias Kuhn
e3dabac78a Only add parameter when it is new 2018-03-07 09:00:33 +11:00
Matthias Kuhn
542910e9da Add QgsProcessingParameterType tests 2018-03-07 09:00:33 +11:00
Alexis Polti
5b2c81bdea Fix project path when path contains a symbolic link 2018-03-06 22:50:07 +01:00
Sandro Mani
5bf28d56b6
Merge pull request #6533 from manisandro/wms_filter_geom_crs
Ensure FILTER_GEOM is transformed to layer CRS in GetFeatureInfo
2018-03-06 15:28:33 +01:00
Sandro Mani
184480bcd6 Ensure FILTER_GEOM is transformed to layer CRS in GetFeatureInfo 2018-03-06 13:16:36 +01:00
Nyall Dawson
93f805cd09 Fix adding parts to curved polygon types fails 2018-03-06 15:20:34 +11:00
Nyall Dawson
454cce89f1 Don't try to render non-finite points
They occur as a result of reprojection errors, and cause a line
to be extend to the top-left of the canvas.

Fixes #9392
2018-03-06 10:26:52 +11:00
Nyall Dawson
5b8599e9bb Strip non-spatial and nullptrs from list when calling
QgsMapSettings::setLayers

Since neither can be rendered, we filter them from the list
of layers to be rendered in the map.
2018-03-06 07:50:26 +11:00
Nyall Dawson
8e4b8a9518 Ensure that non-spatial layers are never set as canvas layers 2018-03-06 07:50:26 +11:00