4295 Commits

Author SHA1 Message Date
Nyall Dawson
3a2710efe5 Merge pull request #4870 from nyalldawson/algs3
Port 4 more algs to new API
2017-07-17 07:51:47 +10:00
Nyall Dawson
38a13ff5af Make pole of inaccessibility calculation handle multipolygons 2017-07-17 07:24:33 +10:00
Nyall Dawson
1342f4d9ac Add API to set optional destination parameters as not created by default
This allows optional outputs (such as null geometry features detected
by the Remove Null Geometries algorithm) to be skipped by default
when desirable.
2017-07-16 18:19:24 +10:00
Nyall Dawson
8711473b7f Add a very basic guard against virtual fields which reference themself 2017-07-14 10:29:18 +10:00
Nyall Dawson
f84a3bbd04 Merge pull request #4819 from nyalldawson/layout_gui
Layout GUI work (pt 1/?)
2017-07-14 10:22:38 +10:00
Nyall Dawson
3f4d6de54b Fix aggregate expression calculation when used with virtual fields
The layer expression context (which is required for aggregate
calculation to work) was not being added to the context used
by vector layer feature iterators.

Fix #15930
2017-07-14 10:21:56 +10:00
Nyall Dawson
eb0c3015f9 Push minimumValues/maximumValues up to QgsFeatureSource base class
Allows these methods to be called on feature sources
2017-07-13 20:07:33 +10:00
Radim Blazek
50df255edc Merge pull request #4847 from blazek/remove-grass6
Remove GRASS 6 support
2017-07-13 08:56:04 +02:00
Mark Johnson
172e809181 [FEATURE] New unit type for rendering in map unit meters sizes
Allows setting symbols other map item sizes to Map Units in Meters. This allows setting the size always in meters, regardless of what the underlying map units are (e.g. they can be it geographic degrees). The size in meters is calculated based on the current project ellipsoid setting and a projection of the distances in meters at the center of the current map extent.
2017-07-13 16:26:41 +10:00
Nyall Dawson
773b2e7f9e Port grass followup to area calculation fix
https://trac.osgeo.org/grass/changeset/71259

refs discussion at

https://trac.osgeo.org/grass/ticket/3369
2017-07-13 07:41:42 +10:00
Radim Blazek
eb6301e023 [GRASS] remove GRASS 6 support 2017-07-12 17:51:03 +02:00
rldhont
7cbf9df21a [Server] Tests update mask image 2017-07-12 16:01:55 +02:00
Nyall Dawson
058271b0c1 Auto create corresponding outputs when adding destination style
parameters to an algorithm

QgsProcessingAlgorithm::addParameter() has a new createOuput
argument (true by default).

If the createOutput argument is true, then a corresponding
output definition will also be created (and added to the
algorithm) where appropriate. E.g. when adding a
QgsProcessingParameterVectorDestination and createOutput is
true, then a QgsProcessingOutputVectorLayer output will be
created and added to the algorithm. There is no need to call
addOutput() to manually add a corresponding output for this
vector. If createOutput is false then this automatic output
creation will not occur.

This should simplify declaration of outputs for algorithms
as it avoids the need to manually declare these corresponding
outputs.
2017-07-12 07:18:53 +10:00
Nyall Dawson
cf488d34a4 Split layout item registry into two separate registries
Instead of relying on forward declared c++ classes from
gui in QgsLayoutItemRegistry, instead create a
QgsLayoutItemGuiRegistry which handles registration
of all the GUI specific behavior relating to layout items.

Remove all GUI related code from QgsLayoutItemRegistry.

This creates a cleaner split between core/gui code, and
given that there'll be a lot of gui specific behavior
which needs to be handled by a registry it makes sense
to keep this isolated in gui.

It also plays nicer with the sip bindings, which can't
handle forward declared gui classes in core.
2017-07-11 11:06:36 +10:00
Nyall Dawson
179c51c953 Don't auto populate QgsLayoutItemRegistry
Initially create an empty registry, allow it to be populated
at a later stage.
2017-07-11 11:06:36 +10:00
Nyall Dawson
20ca51b59c Port ability to wheel zoom into/out of layout designer 2017-07-11 11:06:36 +10:00
Nyall Dawson
867bdb6117 Move click-and-drag detection to QgsLayoutViewTool 2017-07-11 11:06:36 +10:00
Nyall Dawson
5cac2f71f0 Allow setting pen/brush for QgsLayoutViewRubberBand 2017-07-11 11:06:36 +10:00
Nyall Dawson
86bc8af216 Add some unit tests 2017-07-11 11:06:36 +10:00
Nyall Dawson
25034979e3 Add some unit tests for layout tools 2017-07-11 11:06:35 +10:00
Nyall Dawson
726936eee2 Merge pull request #4831 from nyalldawson/processing_alg_config2
Minor refactoring to processing algorithms, future proofing some API
2017-07-11 10:59:08 +10:00
Nyall Dawson
326d6f5fc7 Allow child algorithm configuration to be stored and handled by models 2017-07-10 17:02:23 +10:00
Nyall Dawson
1e13d733c2 Move declaration of algorithm parameters/outputs to a new virtual
initAlgorithm() method

This allows 2 benefits:
- algorithms can be subclassed and have subclasses add additional
parameters/outputs to the algorithm. With the previous approach
of declaring parameters/outputs in the constructor, it's not
possible to call virtual methods to add additional parameters/
outputs (since you can't call virtual methods from a constructor).

- initAlgorithm takes a variant map argument, allowing the algorithm
to dynamically adjust its declared parameters and outputs according
to this configuration map. This potentially allows model algorithms which
can be configured to have variable numbers of parameters and
outputs at run time. E.g. a "router" algorithm which directs
features to one of any number of output sinks depending on some
user configured criteria.
2017-07-10 16:31:14 +10:00
nirvn
1aa0091e7a [ogr] return multi{linestring,polygon} type for shapefile driver 2017-07-10 13:26:45 +07:00
Nyall Dawson
03275bbace Split QgsProcessingAlgorithm::create into non virtual-create
and pure virtual createInstance

Allows us to add logic which always need applying within
create(), leaving createInstance() free to just return a
raw new instance of the class
2017-07-10 10:07:32 +10:00
Nyall Dawson
d85039363a Fix incorrect area calculation in corner cases (fix #16820)
In certain circumstances very proximal nodes could cause instability
in the ellipsoidal area calculation.

Port (slightly tweaked) fix from grass changeset 71167 for same issue,
and add a unit test
2017-07-10 09:31:16 +10:00
Nyall Dawson
cd6e7d78cf Add method to processing registry to create a new instance of an algorithm directly 2017-07-09 17:14:45 +10:00
Even Rouault
7d67b02ae4 [OGR] Use OGR_F_SetFieldNull() with GDAL >= 2.2 to avoid GeoJSON fields to be unset (fixes #16812) 2017-07-08 14:01:10 +02:00
Nyall Dawson
f49b603443 Split QgsProcessingModelAlgorithm into separate components
The cpp/h file was getting too large, so split off the individual
subcomponents into their own h/cpp files to keep code
maintainable.
2017-07-08 20:49:17 +10:00
Nyall Dawson
9d04f87249 Rename "output" style parameters for clarity
The previous naming was too easily confused with processing outputs.
Rename them to QgsProcessingParameterFileDestination, etc... to
make it clearer what they are used for.
2017-07-08 20:49:17 +10:00
Nyall Dawson
f82b41e001 Move an enum to new QgsProcessing class 2017-07-08 20:49:17 +10:00
Nyall Dawson
febf0a0e6e Rename method to more generic name - it's usable by vector layer outputs too 2017-07-08 20:49:17 +10:00
Nyall Dawson
9e184feaed Add method to evaluate parameters to compatible vector layers
of a specified type
2017-07-08 20:49:17 +10:00
Matthias Kuhn
875a5d6d9d Merge pull request #4818 from DelazJ/spelling
Fix some spelling issues
2017-07-08 10:20:40 +02:00
Matthias Kuhn
ada9ce4dcf Merge pull request #4825
Various new expression functions and possibilities
2017-07-08 10:18:10 +02:00
rldhont
6b6a52be49 Merge pull request #4823 from rldhont/fix-qgis3-asgml2
Fix GML2 after GML3 improvements
2017-07-07 15:32:33 +02:00
Blottiere Paul
e6de737fad Add unit tests 2017-07-07 14:35:08 +02:00
rldhont
aa24896ce1 Fix GML2 after GML3 improvements 2017-07-07 13:01:31 +02:00
Matthias Kuhn
72da246b8b Add tests 2017-07-07 13:01:17 +02:00
rldhont
59d1f6d1b2 [Server] Tests update mask image 2017-07-07 13:00:11 +02:00
Martin Dobias
a8cceff0fc Make it possible to build just core lib and providers: -DWITH_GUI=FALSE
This is useful in some cases when working on a third party app/script
that only uses qgis_core. For example, I am working on qgis 3D project
and it is useful to be able to build QGIS core lib with custom Qt version
without having to spend too much time building what I do not need.
Also may be useful for QField to simplify the build of QGIS as a dependency
(no QScintilla, Qwt) and avoid bits of code in providers that would not
be used anyway.

No real source code changes, just configuration changes, mainly in providers.
2017-07-07 11:38:03 +02:00
Matthias Kuhn
632eca6079 Merge pull request #4795 from pblottiere/dynamicform
[FEATURE] Dynamic form for joined fields
2017-07-07 08:22:18 +02:00
Nyall Dawson
515ba24230 Update tests 2017-07-07 11:58:15 +10:00
Nyall Dawson
ac51ae106c Add unit tests 2017-07-07 11:36:41 +10:00
Nyall Dawson
35e16b2f31 Add method for specifying variable description when adding to contexts
And use this description in expression builders when it's set.
2017-07-07 11:35:31 +10:00
Nyall Dawson
82ef7d2a89 Create specific expression context scope for child algorithms
Contains variables for model parameters, algorithm results for
other child algorithms which are not dependent on the
algorithm.

Allows removal of final pieces of ModelerAlgorithm code
2017-07-07 11:35:31 +10:00
Nyall Dawson
17199c8ffd Reimplement getAvailableValuesOfType in QgsProcessingModelAlgorithm 2017-07-07 11:35:31 +10:00
Nyall Dawson
26cd6017b8 Use an expression context when evaluating child parameters with expression sources 2017-07-07 11:35:31 +10:00
Nyall Dawson
3243a1a34c Allow model child parameters to take values from an expression
The expression is evaluated just before the child algorithm is
executed, so can utilise results already calculated by other
children in the model through the use of expression context
functions
2017-07-07 11:34:17 +10:00
Nyall Dawson
52f4c5e975 Merge pull request #4799 from nyalldawson/m2
Run processing algorithms using task manager
2017-07-07 11:31:22 +10:00