20856 Commits

Author SHA1 Message Date
Nyall Dawson
87c3c911c0 Implement profile generation for point vector layers 2022-03-25 10:08:11 +10:00
Nyall Dawson
12a65da674 Implement a profile generator for QgsRasterLayers
This class implements an optimised method for generating a profile
from a raster layer in a thread-safe way:

On the main thread:

- The data provider is cloned during preparation, and all other
required properties from the raster layer are copied and stored
for later thread-safe use on a background thread

On the background thread:

- The profile line is transformed to the raster's native CRS
- We then iterate over the portion of the raster which intersects
the profile line's bounding box in small tiles. We use small tiles
here as we will shortcut by skipping straight over any tiles which
don't intersect the profile line at all, without requesting their
raster data at all. Since the profile line will only cover a very
small portion of an overall raster extent, by using small tiles
we end up shortcutting and avoiding the costly tile pixel iteration
for most of the raster's coverage.
- For any tiles which DO intersect the profile curve, we fetch the
tile data and then iterate over the pixels, keeping only those
which actually intersect the profile curve. These pixel centroids
are then transformed back to the original CRS of the profile line.
- After collecting the filtered pixels centroids and their raster
(height) values, we then convert the pixel x/y locations to a
distance/chainage along the profile line, giving us an array of
distance vs height values for all pixels which intersect the profile
line.
2022-03-25 10:08:11 +10:00
Nyall Dawson
200be450f2 Add framework for profile generation
- Adds an abstract base class for profile generators,
QgsAbstractProfileGenerator. This is modeled off the approach
used by map layer renderers, where a QgsAbstractProfileGenerator
subclass object is created in the main thread and does all
required (hopefully inexpensive!) preparation steps necessary
to do on the main thread. Then a separate background thread can
later call the virtual generateProfile method, which does
the heavy lifting of calculating the associated profile. Later
the results of the profile generation can be retrieved back
on the main thread.

- Adds an interface "QgsAbstractProfileSource" for objects which
can create a profile generator given a QgsProfileRequest. Map layer
classes will implement this interface, but potentially 3rd party
(plugin based) objects can also implement the interface if they
also want to add custom results to the profile charts (e.g.
borehole trace lines).
2022-03-25 10:08:11 +10:00
Nyall Dawson
7536cc72c7 Add method to calculate pixel-perfect sub region of a raster 2022-03-25 10:08:11 +10:00
Nyall Dawson
a356469058 Add terrain provider to QgsProfileRequest 2022-03-25 10:08:11 +10:00
Nyall Dawson
b75adafe1c Add equals method to QgsTerrainProvider 2022-03-25 10:08:11 +10:00
Nyall Dawson
0a6dac826f Profile request 2022-03-25 10:08:11 +10:00
Loïc Bartoletti
742c860f9f QgsTriangle: constify isDegenerate method 2022-03-24 06:41:30 +01:00
Nyall Dawson
67c00fc6e5 [feature] Add opt-in setting for projects for "Remember attribute table
windows and docks between sessions"

If checked for a project, then any opened attribute tables will be
saved into the project and immediately restored when loading that
project.

Designed to improve workflows when a user has constructed a project
with a particular set of attribute table configurations for their
requirements, and re-setting up these attribute tables is a hassle.
2022-03-24 15:03:16 +10:00
Germán Carrillo
603c5f645c Fix typo in qgspanelwidgetstack.h 2022-03-24 13:25:32 +10:00
Nyall Dawson
883d31dbc0 Fix calculation of tile zoom levels for ESRI vector tiles when
map is in a geographic CRS
2022-03-23 14:10:49 +10:00
Nyall Dawson
f9fe7e4311 Move method to a common place 2022-03-22 11:18:54 +10:00
Nyall Dawson
1b95c0ee21 Add an optional QgsExpressionContext argument to QgsVectorLayer::selectByExpression 2022-03-22 11:18:54 +10:00
Nyall Dawson
793f887dd6 Add method to convert vector renderer legend rule keys to equivalent
QgsExpression filter
2022-03-22 11:18:54 +10:00
Nyall Dawson
02829d5a3e Fix another documentation typo 2022-03-22 10:48:57 +10:00
Nyall Dawson
11c5547cbc Fix documentation warning 2022-03-22 10:48:57 +10:00
Nyall Dawson
618c7f2f73 [feature] Add opt-in setting in project properties for
"Remember editable layer status between sessions"

If checked, then any layers which are editable will be remembered
when saving that project and immediately made editable whenever
the project is restored.

This is an opt-in, per-project setting. The intended use case
is for users who are making complex, data-editing focused projects.
2022-03-22 10:48:57 +10:00
Nyall Dawson
9efe9f512c Change some boolean QgsProject properties to flags instead 2022-03-22 10:48:57 +10:00
NEDJIMAbelgacem
66b3c57f2b - Fix spelling & SIP
- Fix 3D -> 2D -> 3D sync
- Fix trapezoid setting saving
2022-03-21 07:56:39 -07:00
NEDJIMAbelgacem
1577174ffb fix tests 2022-03-21 07:56:39 -07:00
NEDJIMAbelgacem
60144d7645 switch to flag based approach for 2D/3D sync 2022-03-21 07:56:39 -07:00
NEDJIMAbelgacem
9141d05d59 - Change extent to trapezoid shape
- Visualize the viewed area using QgsRubberBand
-  Address reviews
2022-03-21 07:56:39 -07:00
NEDJIMAbelgacem
e38a879378 initial implementation 2022-03-21 07:56:39 -07:00
Nyall Dawson
5b317e6808 Ignore symbol layer types which do not have colors (raster fill, marker,
etc) when calculating overall symbol colors

Fixes #47723
2022-03-21 17:24:45 +10:00
Nyall Dawson
14952ab6b0 Fix sip build 2022-03-19 05:58:37 +10:00
Nyall Dawson
acdc5d2128 Fix cppcheck warning 2022-03-19 05:58:37 +10:00
Nyall Dawson
36d649fa83 When creating a new 3d map, set the initial terrain settings for the
map to match the project's terrain settings
2022-03-19 05:58:37 +10:00
Nyall Dawson
52c778f3a0 Remove offset/scale from project elevation properties as these were moved to terrain providers 2022-03-19 05:58:37 +10:00
Nyall Dawson
c19ec553ab Add scale and offset to terrain providers 2022-03-19 05:58:37 +10:00
Nyall Dawson
6e9ecc87e4 Use nan for invalid point height calculation results 2022-03-19 05:58:37 +10:00
Nyall Dawson
5124a583f2 Add clone method for terrain providers 2022-03-19 05:58:37 +10:00
Nyall Dawson
231596cd8d Make terrain provider classes generic and move outside of project 2022-03-19 05:58:37 +10:00
Nyall Dawson
22034f354e Project elevation properties framework 2022-03-19 05:58:37 +10:00
Loïc Bartoletti
94a3744521
Merge pull request #46647 from Koyaani/advanced_snapping
[Feature] New soft constraints in the advanced digitizing dock
2022-03-18 10:11:49 +01:00
Alessandro Pasotti
1eeb11fc48
Merge pull request #47771 from elpaso/between-expression
Between/Not between expression
2022-03-18 07:25:21 +01:00
uclaros
94b13ba049 address review 2022-03-18 10:40:36 +10:00
uclaros
32672cf499 cleanup 2022-03-18 10:40:36 +10:00
uclaros
ca5fa59a92 remove unused method, add docstring 2022-03-18 10:40:36 +10:00
uclaros
280b7cc00c fail on missing attributes, remove unused functions, sip 2022-03-18 10:40:36 +10:00
Alessandro Pasotti
a296a8bb84
Merge pull request #47782 from nyalldawson/highlight_all_curved
Highlight all characters in curved labels when hovering using a map label tool, instead of just one character
2022-03-17 13:29:49 +01:00
Nyall Dawson
180ae3bc16 Also apply font settings from layer conditional styling to layout attribute tables 2022-03-17 18:12:46 +10:00
Nyall Dawson
07ee0bb7e4 Fix some tests on newer GEOS 2022-03-17 18:12:27 +10:00
Nyall Dawson
290154744b [feature][processing] Add "Keep disjoint features separate" option
for dissolve algorithm

If enabled, this option will cause disjoint features and parts to
be exported as separate features (instead of as parts of a
single multipart feature).
2022-03-17 18:12:27 +10:00
Damiano Lombardi
20173fd609 User defined field names in export 2022-03-17 08:34:34 +10:00
Nyall Dawson
bc0b982e26 Read metadata from vtpk files 2022-03-16 14:07:06 +10:00
Nyall Dawson
1ad8639315 Support reading ESRI vector tile packages (.vtpk) files directly 2022-03-16 14:07:06 +10:00
Nyall Dawson
16d8ce71f9 Move gzip utility functions to QgsZipUtils 2022-03-16 14:07:06 +10:00
Ismail Sunni
b665d0a368
Add copy to clipboard for preview expression. 2022-03-16 09:07:44 +10:00
Alessandro Pasotti
34f0e59735 Address PR review comments and handle NULLS
Refactor the evaluation code, handle NULLs to
return a boolean when it is possible.
2022-03-15 12:13:42 +01:00
Nyall Dawson
94f198b36b Default to a "Follow placement" mode for the text anchor point, which
means when the line anchor is < 25% then it will be matched to the
start of the text, when the line anchor is > 75% it will be matched
to the end of the text, otherwise match to center of text
2022-03-15 16:31:45 +10:00