4724 Commits

Author SHA1 Message Date
Nyall Dawson
2eacc4c4b4 [FEATURE][layouts] Export project metadata in PDF/image exports
Includes project metadata in PDF exports, and supported image
based formats.

Image based metadata support depends on the format and the
Qt library's handling of each particular format (e.g. PNG
outputs are well supported).

Developed for Arpa Piemonte (Dipartimento Tematico Geologia e Dissesto)
within ERIKUS project
2018-03-22 16:13:30 +11:00
Nyall Dawson
a600b51bad [FEATURE][layouts] Export project metadata as SVG RDF metadata
Adds an option to include project metadata into SVG exports
generated from layouts, using the SVG RDF standard.

Developed for Arpa Piemonte (Dipartimento Tematico Geologia e Dissesto)
within ERIKUS project
2018-03-22 16:13:30 +11:00
Nyall Dawson
accdc23e0b Fix sip subclassing of metadata subclasses 2018-03-22 16:13:30 +11:00
Nyall Dawson
665f3e4cfc Spelling 2018-03-22 16:13:30 +11:00
Nyall Dawson
f4ed93e1ca Add project metadata mode to QgsMetadataWidget 2018-03-22 16:13:30 +11:00
Nyall Dawson
b10be8a8a3 Update metadata xml definitions 2018-03-22 16:13:30 +11:00
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
5cf2656ace Split metadata into two classes
A new base class QgsMetadataBase has been split off QgsLayerMetadata,
containing all non-layer specific metadata items.

This allows us to reuse the common metadata settings for other
non-layer items, e.g. projects.
2018-03-22 16:13:30 +11:00
Nyall Dawson
2be1256097 Followup e90ac56b
Fix warnings, missing Q_OBJECT macro
2018-03-21 15:43:45 +10:00
Salvatore Larosa
330c2f70ce
Merge pull request #6627 from slarosa/cp_layer1
[FEATURE][needs-docs] Copy&Paste Group/Layers from a QGIS project to another
2018-03-20 16:06:21 +01:00
Sandro Mani
e90ac56b46 Add a minimal data provider for plugin layers
Throughout the codebase, there is a general assumption that layer->dataProvider() is not null. This wasn't the case for plugin layers.
2018-03-20 13:39:56 +01:00
Alessandro Pasotti
84bdc92a8c Add axisOrder to QgsAbstractGeometry GML generators 2018-03-20 13:04:17 +01:00
Salvatore Larosa
f6f7027c7f fix failure to travis code_layout 2018-03-18 21:49:59 +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
7c0665a331 Clearer ownership, docs for rule based renderer 2018-03-16 08:18:36 +11: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
Nyall Dawson
dc27d12046 Fix documentation test 2018-03-15 17:55:25 +11: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
654a4a4af6 [processing] Fix algorithm progress bar resets to 0 when an algorithm
reports a non-fatal error

Fixes the "flashy" progress bar when an algorithm encounters a lot
of errors.
2018-03-15 13:43:01 +11:00
Nyall Dawson
ce59cbd6f7 Sipify 2018-03-13 10:39:49 +11: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
Nyall Dawson
6c179059a5 Add straightDistance2d and sinuosity measures to QgsCurve 2018-03-12 14:58:04 +11:00
Nyall Dawson
f06b3691c5 More spelling fixes 2018-03-12 14:32:17 +11:00
Nyall Dawson
d04b3d9eaf Update spell check list, spelling 2018-03-12 14:32:17 +11:00
Nyall Dawson
273e664563 Fix some leaks in conversions 2018-03-12 14:30:53 +11: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
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
678f65853a Allow QgsVectorDataProviders to create QgsFeatureRenderers
Implements https://github.com/qgis/QGIS-Enhancement-Proposals/issues/111

Adds support to QgsVectorDataProvider to create vector layer renderers
using provider-specific backend information.
2018-03-07 16:28:47 +11:00
Nyall Dawson
227f706287 [processing] Add operators for parameter type flags, push warning
to message log for duplicate parameter registration
2018-03-07 09:45:09 +10:00
Matthias Kuhn
5d526794ab Remove leftover file 2018-03-07 09:00:33 +11:00
Matthias Kuhn
c3a843619f Use flags for parameter type extra info 2018-03-07 09:00:33 +11:00
Matthias Kuhn
e3dabac78a Only add parameter when it is new 2018-03-07 09:00:33 +11:00
Matthias Kuhn
f22acb93b7 License headers 2018-03-07 09:00:33 +11:00
Matthias Kuhn
0d00491436 s/Modeller/Modeler/ 2018-03-07 09:00:33 +11:00
Matthias Kuhn
569b39b257 Code and doc improvements 2018-03-07 09:00:33 +11:00
Matthias Kuhn
b5672d7a23 API documentation 2018-03-07 09:00:33 +11:00
Matthias Kuhn
9688bc2734 Remove crap API 2018-03-07 09:00:33 +11:00
Matthias Kuhn
2145865a42 Metadata and modeller exposure support 2018-03-07 09:00:33 +11:00
Matthias Kuhn
ff7b831b9d Remove private implementations from python bindings 2018-03-07 09:00:33 +11:00
Matthias Kuhn
1fd74234b4 Add processing parameter type definitions 2018-03-07 09:00:33 +11:00
Alexander Bruy
44895084d9
Merge pull request #6525 from nyalldawson/segmentize
[FEATURE][processing] Add "segmentize" algorithms
2018-03-06 08:27:52 +02:00
Nyall Dawson
a30403dcbe Rename QgsProject::projectDirty to isDirtyChanged
Also show unsaved status in title bar even when project has
not been first saved
2018-03-06 11:57:51 +10: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