4172 Commits

Author SHA1 Message Date
Nyall Dawson
e5c0a14ecd [feature] Add a new classification method for "Fixed interval"
Allows users to create graduated breaks using a specific interval
width for classes (instead of the total number of classes)

Sponsored by SLYR
2022-05-06 13:44:31 +10:00
Nyall Dawson
97bb5f6e95 Try to fix build 2022-05-06 08:58:41 +10:00
Nyall Dawson
ca710d64e0 Implement identify support for point cloud results 2022-05-06 08:58:41 +10:00
Nyall Dawson
3c086ead05 Add framework for identifying results from profile generators 2022-05-06 08:58:41 +10:00
Nyall Dawson
e163361da9 Add option to show markers over continuous surface plot 2022-05-03 12:15:02 +10:00
Nyall Dawson
826cbe37d6 [feature] Add an "interpretation" option for vector elevation profiles
Choices are "individual features" (the default behavior) or "continuous
surface". The new Continuous Surface option is designed for vector
layers which represent a continuous elevation surface, e.g contour
lines or surveyed elevation points. When selected, the elevation
chart will be rendered as a surface instead of separate features
by joining the sampled elevation results into a continuous line.

There's also the same option exposed as for raster and mesh layers
where the appearance can be toggled from a single line to a "fill
below" symbol.

Fixes #48341
2022-05-03 12:15:02 +10:00
Nyall Dawson
eeb444948f Add mechanism for python clients to setup custom QNetworkReply
preprocessors

Since it's not possible to overwrite
QgsNetworkAccessManager::createRequest, the normal Qt approach for
adding custom handling for replies is not possible. This new API
adds a QgsNetworkAccessManager.setReplyPreprocessor() method
which allows clients to add a custom reply preprocessor for implementing
their own logic for replies.

For example:

    def _on_ready_read(reply):
        print(reply.peek(reply.bytesAvailable()))

    def _my_preprocessor(request, reply):
        if reply.operation() == QNetworkAccessManager.PutOperation:
            reply.readyRead.connect(partial(_on_ready_read, reply))

    QgsNetworkAccessManager.setReplyPreprocessor(_my_preprocessor)

Fixes #48169
2022-05-02 12:31:42 +10:00
Nyall Dawson
c9678be608 Simplify api 2022-05-01 09:13:08 +10:00
Nyall Dawson
e415cad690 Avoid unnecessary layer redraw 2022-05-01 09:13:08 +10:00
Nyall Dawson
6ca9c4bdc1 Clearer name for signal 2022-05-01 09:13:08 +10:00
Nyall Dawson
2c9e37d4ba Add setting to respect point cloud coloring in profile plots 2022-05-01 09:13:08 +10:00
Nyall Dawson
51a178279c API for rendering point cloud profiles using renderer colors 2022-05-01 09:13:08 +10:00
Nyall Dawson
f0f7ae54a6 Enum class 2022-04-29 19:58:21 +10:00
Nyall Dawson
e6b65767cf Use different snap tolerances when snapping to points vs snapping
to continuous elevation surfaces

When snapping to a surface we want to be very "grabby" in the height
axis but ungrabby in the distance axis. For points we should be equally
grabby on either axis.
2022-04-29 19:58:21 +10:00
Nyall Dawson
0f13138e0c Fix typo 2022-04-29 19:58:21 +10:00
Nyall Dawson
a9e1f1125f Use DPI directly instead of scale factor 2022-04-29 19:58:21 +10:00
Nyall Dawson
6811b41a9c Add opacity by distance from curve effect 2022-04-29 19:58:21 +10:00
Nyall Dawson
548f3df629 Add elevation profile support for point cloud layers 2022-04-29 19:58:21 +10:00
Nyall Dawson
bad241ead2 Ensure that results from final plot area are always shown in plot, even when
a job was already in progress when the plot area was changed
2022-04-29 19:58:21 +10:00
Nyall Dawson
81680ea15b Add profile related settings to point cloud elevation properties 2022-04-29 19:58:21 +10:00
Nyall Dawson
c35d17b6e4 Move useful point cloud renderer enums to Qgis namespace 2022-04-29 19:58:21 +10:00
Nyall Dawson
77052c6473 Add map units per pixel to QgsProfileGenerationContext 2022-04-29 19:58:21 +10:00
Julien Cabieces
fb50f69e2b other const methods 2022-04-29 08:21:47 +10:00
Julien Cabieces
012b6a46db constify methods 2022-04-29 08:21:47 +10:00
Denis Rouzaud
3c0ecd38e8 move enum to Qgis + remove commented code 2022-04-29 07:57:25 +10:00
Denis Rouzaud
6dd66759cd sipify 2022-04-29 07:57:25 +10:00
Alessandro Pasotti
041e18a85c
Merge pull request #48107 from elpaso/db_logger_2
Implementation of QEP: Add SQL Logging in the debugging/development panel
2022-04-28 10:11:31 +02:00
Nyall Dawson
5fb4f656c1 Fix doxygen warning 2022-04-28 13:54:47 +10:00
Nyall Dawson
bc7fa813e5 Only refine layers which benefit from refining (i.e. rasters) 2022-04-28 13:54:47 +10:00
Nyall Dawson
85966c7625 Add support for refining elevation plot based on scale and visible range
For some layer types (rasters, point clouds) this gives a much better
experience vs generating the profile completely upfront. (I.e. even
with super-detailed DEM layers the profile is now basically instant
to generate).
2022-04-28 13:54: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
5e831971cc Cleanup light source handling in API 2022-04-27 11:50:13 +10:00
Nyall Dawson
5a6524f3aa Use "regenerate" instead of "update" for re-building the profile for
a layer, as "update" is ambiguous and is associated with "repainting"
a Qt widget
2022-04-27 10:24:12 +10:00
Nyall Dawson
ddfe22aedb Rename method to copyPropertiesFromGenerator and avoid some duplicate code 2022-04-27 10:24:12 +10:00
Nyall Dawson
e59c5d9881 Add dox note about source ID and layer IDs 2022-04-27 10:24:12 +10:00
Nyall Dawson
a35e74c656 Add api to allow redrawing of previously collected results for a single
elevation profile source

And use this to just redraw the existing results whenever a setting
relating only to the appearance of the profile chart is changed,
instead of regenerating the whole chart
2022-04-27 10:24:12 +10:00
Nyall Dawson
99da12fcac Add api to trigger regeneration of profile results for a single layer 2022-04-27 10:24:12 +10:00
Nyall Dawson
86704dbe16 Add means of linking profile results back to source layer 2022-04-27 10:24:12 +10:00
Nyall Dawson
6f8d668acd Add signals for when layer elevation properties change 2022-04-27 10:24:12 +10:00
Nyall Dawson
bc90217bc0 Add method to prepare animated images in advance, by extracting
all frames from the animation to a temporary directory

This avoids lengthy delays when trying to render a specific frame
from the animation, as most animation formats require us to
iterate through all preceding frames in order to retrieve a specific
frame. By iterating once in advance and saving the results out we
gain instant access to any individual frame from the animation.
2022-04-27 05:57:21 +10:00
Alessandro Pasotti
485cd0a15d Log execSql from connections API 2022-04-26 14:02:28 +02:00
Alessandro Pasotti
566c3cdb99 Handle errors 2022-04-26 14:02:27 +02:00
Alessandro Pasotti
8043bbdb55 Row count 2022-04-26 14:02:27 +02:00
Alessandro Pasotti
f388ef7a34 More on query logging 2022-04-26 14:02:27 +02:00
Nyall Dawson
a0c69216ab Enabled 2022-04-26 14:02:27 +02:00
Nyall Dawson
0108041c68 Add query log 2022-04-26 14:02:27 +02:00
Nyall Dawson
9de1920302 Add option for "forced bold" and "force italic" to QgsTextFormat
Unlike setting a font's style via setNamedStyle(), these settings
will ensure that a font is always rendered in bold or italic regardless
of whether the font family actually has a bold or italic variant. A
"faux bold" or slanted text effect will be emulated by Qt, which may
result in poor quality font rendering.

(For this reason it is greatly preferred to call setNamedStyle() instead.)

This API is being added so that QgsTextFormat/QgsTextRenderer can
replicate the same font behaviour as the base QFont/QPainter classes
do, where faux bold/italic effects are possible.

(It's not exposed anywhere for user control!)
2022-04-26 10:56:28 +10:00
Nyall Dawson
25a4468547 Add method to try to resolve a QFont to its equivalent style name
Eg if a font is built by calling .setBold/.setItalic and not
by QFont::setStyleName then this method will attempt to return
the equivalent style name.

Results are very platform dependent and font dependent, depending
on Qt's internal matching logic (hence no unit tests)
2022-04-26 10:56:28 +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