2945 Commits

Author SHA1 Message Date
Nyall Dawson
6ab4ecfa58 Another attempt 2021-02-25 11:08:56 +10:00
Nyall Dawson
73658c5910 Fix mac build 2021-02-25 11:08:56 +10:00
Nyall Dawson
bd82925df3 Replace qgis::make_unique with std::make_unique
Now that we require c++14 features, we don't need to use the custom
backported version anymore...
2021-02-25 11:08:56 +10:00
Matthias Kuhn
b3dae9ad1a
Merge pull request #41539 from elpaso/bugfix-gh41477-editbuffer-passthrough
Bugfix gh41477 editbuffer passthrough
2021-02-24 14:42:49 +01:00
Nyall Dawson
14f2ab53b1 When attempting to precalculated nodes during an expression prepare
stage, be more intelligent about compiling AND or OR nodes

We can take advantage of the fact that and AND node will ALWAYS
be false if either input node is static and evaluates to FALSE,
and that OR nodes will always be true if either input is static
and evaluates to TRUE.

In some cases this allows us the shortcut and cut out non-static
nodes during preparation, resulting in faster evaluation and
more easily compiled expressions...
2021-02-24 12:39:36 +10:00
Nyall Dawson
d007901f14 Allow QgsRectangle constructors to bypass the automatic normalization
step, when they know in advance they are already normalized

This step isn't free, and can add up when many rectangles are
constructed
2021-02-23 16:02:06 +10:00
Nyall Dawson
b15be66472 Spelling 2021-02-23 15:49:23 +10:00
Nyall Dawson
d84da56dca Add rendered callout details to QgsLabelingResults for retrieval after a map render completes 2021-02-23 15:49:23 +10:00
Nyall Dawson
4f39cf6d6c Move QgsLabelingResults out to its own file 2021-02-23 15:49:23 +10:00
Nyall Dawson
a513f5a1e6 Move QgsLabelPosition out to own file 2021-02-23 15:49:23 +10:00
Nyall Dawson
ee25819b75 [FEATURE][labeling] Add data defined control over callout origin
and destination points

Allows users to data define the starting and ending points for
label callout lines, which is useful when needing to manually
control the exact placement of individual callout lines.
2021-02-23 13:41:58 +10:00
Nyall Dawson
d2e0e8d3b0 Add method for a callout to obtain a transform from the original
associated layer's crs to the destination map crs
2021-02-23 13:41:58 +10:00
Nyall Dawson
af0fb8bb87 [processing] Fix GDAL algorithms hang when gdal command is not available to run 2021-02-21 15:04:31 +10:00
Peter Petrik
da5f9db091
add circle vector tile layer support (#41584)
* fix #41529: add circle vector tile layer support
2021-02-20 08:01:02 +10:00
Nyall Dawson
8324317e22 [layouts] Correctly set data defined html url or attribute table
source property on the parent multiframe object, not the child frame

Fixes #41590
Fixes #36647
2021-02-20 06:12:35 +10:00
Nyall Dawson
c8d61499ff [processing] Instead of a hidden parameter for verbose model logging,
add an explicit log level getter/setter to QgsProcessingContext which
algorithms can use to determine an appropriate level of feedback
to push to users.

Initially the verbose log only triggers the full verbose output
of model executions (which is also used when running models through
the model designer), but the intention is that more algorithms
will fine tune their output based on the logging level.

qgis_process also gains a new --verbose switch to enable verbose
log output.
2021-02-20 05:04:00 +10:00
Alessandro Pasotti
faed480a73 mxe -> fedora mingw64 from Sourcepole
Replace MXE with fedora mingw64 cross build recipe with python.

Thanks to Sandro Mani!
2021-02-19 08:54:18 +01:00
Alessandro Pasotti
7b2fc4c1f8 More doxy nonsense, pt 2 2021-02-19 08:15:29 +10:00
Nyall Dawson
7dfef3a0b1 Newer doxygen versions don't auto convert the first line in a class'
documentation to a brief note, so we have to do it explicitly...
2021-02-19 08:15:29 +10:00
Nedjima Belgacem
d80c27d94b
Fix 3D point cloud position when layer CRS != project CRS (#41538)
* hopefully fixes CRS problem

* fix the 3D map position shift

* remove qDebug

* add catch throw around transformInPlace

* switch to using QgsCoordinateTransform::transform

* move QgsCoordinateTransform to transform context

* remove TODO and fix layout

* add docs

* rename variable

* hadle bounding box coordinate transformation
2021-02-18 09:41:39 +01:00
Nyall Dawson
eba9ffa46e Add option to control the plain text display method for fields using
the checkbox form widget

In QGIS 2.x we always displayed the underlying raw value of a field
using the checkbox widget in the attribute table or in identify results
(i.e. the text display of the field would always match the value
the user had set for the checked or unchecked representation status,
e.g. "yes"/"no", "present"/"absent", etc)

This was changed in 3.0 so that the representation status ONLY affected
how the underlying stored values are mapped to a boolean true or false
value, and accordingly the attribute table/identify results started
only showing "true" or "false" strings.

This new setting allows users to control whether they want plain text
displays of the field to use the 3.x "true"/"false" behavior (the
default), or if they want to see the 2.x style actual field value.
2021-02-16 11:17:28 +10:00
Nyall Dawson
48ce042c84 Take advantage of pre-computed static expression nodes when determining
the referenced fields of an expression

Avoids some cases where use of various expression functions which
normally trigger all attributes to be requested, yet can be pre-computed
during prepare stages, cause non-provider fields to be listed in
the referenced columns and accordingly prevent expression compilation.

Notably this can occur when using an expression like:

   aggregate( .... , filter:=
"some_child_field"=attribute(@atlas_feature, 'some_atlas_field_name') )

where the whole attribute(@atlas_feature....) part is a constant
static value and can be compiled down to a trivial, index-friendly
"some_child_field"=### filter for the aggregate provider request.
Ultimately giving a big performance boost to the atlas!
2021-02-15 12:12:00 +10:00
Alessandro Pasotti
e89c163118 Complete test coverage for edit buffer
Fix tests
2021-02-13 11:54:16 +01:00
Loïc Bartoletti
e336b831c2 Remove automagic fix and tiny refacto 2021-02-13 09:25:19 +10:00
Loïc Bartoletti
7e7732218b Add a message if a geometry was fixed 2021-02-13 09:25:19 +10:00
Richard Duivenvoorde
80251ac97d Make FindBestFrameNumberForFramestart a lot faster 2021-02-13 06:41:56 +10:00
Alessandro Pasotti
8cb15c3260 Editing buffer passthrough 2021-02-12 19:00:57 +01:00
Nyall Dawson
22a4b881d3 Sipify 2021-02-12 15:41:14 +10:00
Nyall Dawson
980d9697a0 Simple line can cause tile artifacts if it's a dashed line 2021-02-12 15:41:14 +10:00
Nyall Dawson
f75c53bbd8 Add QgsSymbol::canCauseArtifactsBetweenAdjacentTiles()
Returns True if ANY of the symbol layers contained in the symbol
can cause tile rendering artifacts
2021-02-12 15:41:14 +10:00
Nyall Dawson
bdf5e4fe3b Add QgsSymbolLayer::canCauseArtifactsBetweenAdjacentTiles()
Returns true if the symbol layer rendering can cause visible
artifacts across a single feature when the feature is rendered
as a series of adjacent map tiles each containing a portion
of the feature's geometry.

This depends on the symbol layer derived class itself - eg
a simple solid color fill won't show any artifacts, but a shapeburst
fill WILL.
2021-02-12 15:41:14 +10:00
Nyall Dawson
cf43c60717 Fix clazy warnings 2021-02-12 12:42:22 +10:00
Nyall Dawson
8fa29ac6d2 When we are compiling expressions to handoff to backend providers,
check if a node has already been determined to evaluate to a static,
precalculated value, and if so, use this value for the node instead
of attempting to compile the actual contents of the node itself

If we are certain that a node is static and will never change,
the this potentially allows us to short-cut a large part of the
filter expressions content. We already use this short-cut when
evaluating expressions on the QGIS side since years, and its
proven to be stable and reliable. By respecting this during
expression compilation we can offer a huge speed up to certain
filter expressions, especially those which utilise QGIS variables
which are known to be static (such as atlas variables, map scales,
etc). Previously ANY use of a qgis variable would always cause
expression compilation to fail and require a full set of feature
fetching from the provider.

(Resulted in orders of magnitude faster atlas export for a complex
atlas.)
2021-02-12 06:05:56 +10:00
Nyall Dawson
c582967b6e Add "octagon", "asterisk" and "square with corners" shapes to simple marker
available shapes
2021-02-11 16:01:50 +10:00
NEDJIMAbelgacem
86a71391df remove point budget approach from 2D rendering 2021-02-10 13:49:28 +01:00
Belgacem
eb1ff089a6 implementation of point budget in 2D 2021-02-10 13:49:28 +01:00
Nyall Dawson
c6613593c7 Don't loop through all selected features multiple times (once per
field) when the attribute form is opened.

This is incredibly expensive, yet only required in a very very small
corner case (field is from a joined layer without the upsert on edit
capabilities).

Refine logic to avoid the scan wherever we can.

Fixes #41366
Fixes #36863
2021-02-09 10:24:45 +10:00
Nyall Dawson
5a46dee738
Merge pull request #41260 from qgis/test-focal
Update test base image and move CI to Github workflow
2021-02-08 18:13:55 +10:00
Nyall Dawson
973682baa3 Use QgsRenderChecker to compare png images when comparing processing result
directories
2021-02-08 13:23:40 +10:00
Nyall Dawson
0aab3073d8 Fix Python based data providers on newer SIP versions 2021-02-08 13:23:37 +10:00
Nyall Dawson
4984de792d Use TRANSFER_BACK annotation instead of FACTORY for QgsProviderRegistry::createProvider
Paraphrasing Phil Thomson's advice on https://www.riverbankcomputing.com/pipermail/pyqt/2017-July/039450.html:

"
/Factory/ is used when the instance returned is guaranteed to be new to Python.
In this case it isn't because it has already been seen when being returned by by the python function
creating the provider subclass.

(However for a different sub-class implemented in C++ then it would be the first time it was seen
by Python so the /Factory/ on create() would be correct.)

You might try using /TransferBack/ on createProvider() instead - that might be the best compromise.
2021-02-08 13:23:37 +10:00
Nyall Dawson
cd2df66674 Use unique_ptr 2021-02-08 13:23:37 +10:00
Nyall Dawson
6f4b32f658 Create class QgsAbstractGeometryTransformer, which can be used
to transform the vertices of a QgsAbstractGeometry

E.g.

        class Transformer(QgsAbstractGeometryTransformer):

            def transformPoint(self, x, y, z, m):
                return True, x * 2, y + 1, z, m

        transformer = Transformer()
        g = QgsGeometry.fromWkt('LineString(3 0, 10 0, 10 10)')
        g.get().transform(transformer)
        print(g.asWkt()) # 'LineString (6 1, 20 1, 20 11)'
2021-02-08 12:12:53 +10:00
Nyall Dawson
8e57368133
Merge pull request #41355 from elpaso/bugfix-gh41342-gpkg-create-table-from-file-browser
GPKG Allow table creation from file browser
2021-02-08 10:34:28 +10:00
nirvn
e82df36c0d Add point cloud layer icon in the map layer model 2021-02-07 12:48:48 +07:00
Nyall Dawson
d0882d0f06 When auto selecting the default identifier field for a layer,
prefer something like "admin_name" over "type_name".

By penalising results with "type", "class", "cat" in their names
we are less likely to accidentally select a category field as the
friendly identifier when a better one exists.

Also add tests for this logic.
2021-02-06 10:10:51 +10:00
Alessandro Pasotti
5733970f84 Add DB connections factory to data items 2021-02-05 12:15:25 +01:00
Nyall Dawson
13fbcd1cff Expose additional GDAL supported resampling methods as options
for "early" raster resampling

Notably, this adds the "Average" resampling as an option for
early resampling methods. (A nice side effect is that we also
get mode, cubic spline, Lanczos, ... for free!)

Fixes #40746
2021-02-01 07:58:20 +10:00
Nyall Dawson
c253bee452 Fix typo 2021-01-31 05:41:22 +10:00
Nyall Dawson
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00