239 Commits

Author SHA1 Message Date
Julien Cabieces
012b6a46db constify methods 2022-04-29 08:21:47 +10:00
Nyall Dawson
940175fc66 [feature] Add option to render raster and mesh elevation surface levels
using a fill symbol below the elevation surface

This can be easier to interpret in some cases, and helps match expected
symbology conventions in certain disciplines.
2022-04-27 17:30:14 +10:00
Nyall Dawson
9a99ed8800 Don't show vector layers with no interesting elevation properties
set by default in newly created elevation profiles

Fixes #48286
2022-04-22 13:07:16 +10:00
Nyall Dawson
1fc20cb026 Show elevation specific tooltips 2022-04-22 13:07:16 +10:00
Juergen E. Fischer
30e6901931 fix msvc build 2022-04-11 09:54:00 +10:00
Nyall Dawson
f4f514dd86 Add choice of band to use for elevation profiles 2022-04-07 19:22:19 +10:00
Nyall Dawson
8ee20464a0 Ensure that elevation properties are copied whenever a layer is cloned 2022-04-07 19:22:19 +10:00
Nyall Dawson
9ff504f614 Add profile line symbol setting for raster layer elevation properties 2022-04-07 19:22:19 +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
7536cc72c7 Add method to calculate pixel-perfect sub region of a raster 2022-03-25 10:08:11 +10:00
Nyall Dawson
cc24106d01 Add QgsMapLayerElevationProperties subclass for vector layers
Allows elevation properties to be set for vector layers, including:

- altitude binding
- altitude clamping
- extrusion
- scale
- offset

These properties can be set through the new "Elevation" tab in
the vector layer properties dialog
2022-03-03 06:15:10 +10:00
Nyall Dawson
2379de4a95 Add QgsMapLayerElevationProperties subclass for raster layers
Allows elevation properties to be set for raster layers, including:

- whether raster values represent heights
- scale
- offset

These properties can be set through the new "Elevation" tab in
the raster layer properties dialog
2022-03-03 06:15:10 +10:00
Nyall Dawson
caee2cabbd Add Qgis::MapLayerProperty flag for layers which should be considered
as "basemap" layers

This flag identifies if the layer is considered a 'basemap' layer, where
certain properties of the layer should be ignored when calculating
project-level properties. For instance, the extent of basemap layers
should be ignored when calculating the overall extent of a project,
as these layers are typically global and extend outside of a project's
area of interest.
2022-02-24 16:20:51 +10:00
Vincent Cloarec
9965eccdce
Template parameter {usage} for XYZ raster and vector tiles (#46731) 2022-01-13 15:11:31 +01:00
Juergen E. Fischer
c6008b7ee1 fix MSVC build: reverts fee62e4, dff05dd and e3a77b9484c effectivly
reverting 3fb0f66 (followup #45348)

Using --no-public-is-protected (default on Windows) also works on Linux
and fixes #45331 too
2021-10-21 23:03:48 +02:00
nirvn
ce49784823 All public now 2021-10-12 16:34:05 +10:00
nirvn
ef84e48a09 Run sipify_all.sh 2021-10-12 16:34:05 +10:00
Denis Rouzaud
ec16736306 run sipify 2021-10-12 16:34:05 +10:00
Juergen E. Fischer
f76af64fba msvc build fixes 2021-09-29 23:49:33 +02:00
Juergen E. Fischer
b843556719 fix msvc build 2021-09-28 21:40:49 +02:00
Sandro Mani
6fd34ca92b Add sip5/sip6 sip-build support 2021-09-24 08:56:40 +10:00
Nyall Dawson
b8f65cbf01 Promote temporal related enums to enum classes, move to Qgis 2021-09-09 14:56:47 +10:00
Francesco Bursi
179cb1d951
[feature] virtual raster data provider (#44195)
* try to commit some changes in the branch

* addedd 3 file, cmake, vrp .h and .cpp

* updating VRP, no good results

* try to solve some issue to the virtual raster provider

* metadata class added, it should be developed

* registred in qgsproviderregistry the new VRP

* on line to test debug in the  new VRP

* chenge of 1_06

* minor change 2 06

* updating VRP, it can add some useless color to map canvas

* add baseclass test fro new provider

* Delete testqgsvirtualrasterprovider.cpp

* move VRP to src/providers

* Delete src/core/providers/virtualrasterprovider directory

* little change to cmake

* added as dynamic provider

* move the VRP to src/providers and let it work

* move the VRP to src/providers and let it work

* including qgis analysis

* updating block function with some calc tools

* delete block function, updating readblock function

* modified block method, used setValue --> to update with bits

* modified block method

* modified block method, adding takedata to the resultmatrix

* modified test for the new provider

* Add some checks in the block method, for raster entries

* tries for the calculator tool

* work on the hardcoded part and test

* work on the hardcoded test

* minor change in order to make the calc functionaltiy work

* minor change to the loop in which the computation occurs

* try to understand how qgsrastermatrixworks

* work on debugging new class

* work on debugging new class

* updating test and block method

* updating test and and block, now it works running in test mode

* updating test and and block, now it works running in test mode with bits

* updating test and and block, now it works running in test mode with bits

* update test

* update test and provider class

* add decodeuri and encodeui in metadata, at the moment they do nothing

* modify qgsrasterdataprovider by adding decoding and encoding uri methods

* workin on encode and decode funct

* work on encode/decode after Martin advices

* work on encode/decode after Martin advices, and update unit test

* work on encode/decode and update Cmakelist of provider test

* work on encode/decode and update Cmakelist and provider test

* work on encode/decode and update test + constructor

* work on encode/decode and constructor

* decode is now non trivial, he same as constructor

* working on encoding

* working on encoding/decoding

* change a little the code/decode mehods in order to return and get a struct as output/input

* change of decode method

* change the encode method, I should polish the code and optimize the encode for raster layers

* add flag ptr bool to decode mehod

* add flag ptr and modified the constructor of vrprovider

* work on the constructor and deconstructor, the flag does not work properly

* work on the constructor anf decoder

* work on the constructor and decoder

* work on the constructor and add some lines to popoluta mRasterEntries

* delete hardcoded data

* work on constructor and copy constructor 2

* add the parsing of the formula in the constructor, I should make a private var with calcnode

* add the parsing of the formula in the constructor, I should make a private var with calcnode2

* add some checks in the constructor2

* modify the copy constructor, add some code to adjust the qgsrasterdataprovider.sip

* modify checks in the constructor and in the decode method, in order to avoid nested if stat

* delete the logic in the decode method and add in the constructor

* delete the logic in the decode method and add in the constructor, add some redundant check in the constructor

* delete the logic in the decode method and add in the constructor, add some redundant check in the constructor 2

* test is now more general

* test is now more general2

* delete of a comment

* banned keywords check

* little error

* add copyright

* add copyright2

* add assignment operator= delete

* add documentation in qgsrasterprovider

* documentation

* modify qgsstringutils

* little modifications

* add the checkbox to the ui

* come back to old ui for raster calc

* adjust some qt::endl in the test of vrprovider

* start to work on the ui dialog

* layot of the code

* add some logic to the dialog of the raster calc

* add some test to qgisapp, need to modify the encoder and maybe put it in the qgrastercalcdialog

* modify some logic in rastercalcdialog and in the app, I should modify and move the encode method

* modify the comment

* add method to calcnode, modify the constructor of the provider and the open of the dialog

* add documentation

* some modifications according to the first review

* sadd some changes according to Martin's review

* change qgsrastercalcnode methods that returns raster names, small change to ui

* change the ui

* change the ui - using QString instead of QStringLiteral

* change the ui - using QString instead of QStringLiteral

* change name of subdirectory containing the virtual raster provider

* change name of subdirectory containing the virtual raster provider2

* change name of subdirectory containing the virtual raster provider3

* minor changes to makefiles

* minor change to dialog, to hide and show the output format and path

* provider key changed to the shorter virtualraster

* add some code to QgsRasterLayer::encodedSource and decodedSource

* delete some comments

* updating VRP, no good results

* made some change after the the second review

* delete the comments

* change some part of the code (delete of comments and cleaning the code)

* correct some layout errors

* change the mail contatct in my prvider

* change details on the method in qgsrastercalcnode

* change some method of the test class of my provider

* delete some leakage in the virtual raster provider

* modify some parts according to the review + change two lines of code for encoding/decoding methods

* modify a line of qgisapp.cpp

* small change according to the comments on th PR

* add a test method for second generation virtual raster and modify checks in qgisapp

* correction of the test method

Co-authored-by: franc <Franc-Brs>
2021-08-17 10:00:16 +02:00
Mathieu Pellerin
8a4683f737
[feature][exiftools] Implement tags reading, allow for individual tag value read (#44076) 2021-07-08 14:13:25 +07:00
nirvn
4b52b7be7f Move QgsExifTools utility class to core 2021-07-07 13:46:11 +07:00
Nyall Dawson
8c9d008413 Spelling 2021-06-25 13:53:52 +10:00
Nyall Dawson
2d489737e2 [feature] Add a "redraw layer only" temporal mode for raster layers
Just like the equivalent setting for vector layers, this option
causes a raster layer to be redrawn on each new animation frame. It's
useful when the layer uses time-based expression values (e.g. data
defined renderer opacity, to fade/in out a raster layer)
2021-06-25 13:53:52 +10:00
Nyall Dawson
c013c78285 [api] Attach QgsPropertyCollection to QgsRasterPipe to allow
for data-defined raster pipeline properties
2021-06-25 13:53:52 +10:00
Nyall Dawson
f62ddb37a2 Promote QgsRasterPipe enums to enum classes in Qgis namespace
and add forward declares where possible
2021-06-23 17:30:47 +10:00
Nyall Dawson
e2b7f0712e Improve QgsRasterPipe docs 2021-06-23 17:30:47 +10:00
nirvn
01fe6c5b77 [FEATURE][rasters] Invert colors' raster rendering filter option 2021-06-20 21:29:55 -07:00
Blottiere Paul
a36e60884d Skip method from sip binding 2021-06-17 22:28:07 +02:00
Blottiere Paul
0924ae1b4e Update sip 2021-06-17 22:28:07 +02:00
Nyall Dawson
005a0ad093 Sipify 2021-05-27 13:44:15 +10:00
Nyall Dawson
b4fea529f1 Promote Qgis::DataType to enum class 2021-05-27 13:44:15 +10:00
Matthias Kuhn
ef3d9a2c32
Merge branch 'master' into unvirtualize-setdatasource 2021-05-05 08:01:26 +01:00
Mathieu Pellerin
8299547682 Address review 2021-05-03 20:43:37 +07:00
Mathieu Pellerin
8d1371f3e9 [layouts] Respect XYZ output zoom level when previewing map items in the layout designer 2021-05-03 18:01:24 +07:00
rldhont
4afa66af30 [API] Unvirtualize layer setDataSource method
Changes in the layer API:
* The setDatasource() methods become non-virtual public method
* The virtual private setDataSourcePrivate() method is defined and the provider setDataSource implementations have been moved to this new virtual method
2021-04-26 17:14:07 +02:00
Nyall Dawson
7715a12916 Fix spelling 2021-03-31 10:59:47 +10:00
Nyall Dawson
b85614e67e Spelling 2021-03-31 10:59:47 +10:00
Nyall Dawson
c4c8aab7b4 Improve documentation for raster pyramid creation methods/classes
The PyQGIS documentation for this workflow was very poorly documented
2021-03-31 10:59:47 +10:00
Nyall Dawson
929b7086b1 If a wms-t layer is the first temporal layer loaded into a project,
use the wms-t capabilities to set a sensible default time step
for the temporal controller (just like we do for mesh layers)
2021-03-25 17:55:04 +10:00
Nyall Dawson
cae8aae849 Add method to collate all used time ranges for layers in project
Unlike the existing methods, this new method does not return
a single overall time range, but rather (possibly with gaps)
containing all time ranges were we know data actually exists
in the project.
2021-03-25 13:35:52 +10:00
Nyall Dawson
894283b994 Add "allAvailableTemporalRanges" getter/setter to QgsRasterDataProviderTemporalCapabilities
So that we can store and retrieve a list of all available temporal
ranges for a raster data provider when that range of dates is
non-contiguous
2021-03-25 08:01:51 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Alessandro Pasotti
7b2fc4c1f8 More doxy nonsense, pt 2 2021-02-19 08:15:29 +10: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
50b9beaad6 [sipify] Catch more class references and insert :py:class: annotations 2021-01-31 05:41:22 +10:00
Denis Rouzaud
2cc632ee5d follow up QVariant 2021-01-03 20:16:56 +01:00