6739 Commits

Author SHA1 Message Date
Paul Blottiere
dee58822af
Merge pull request #36370 from pblottiere/legend_json
Update the API to export a legend in JSON
2020-05-13 15:13:43 +02:00
Nyall Dawson
f845189bde [feature][temporal] Add mode where start and end date are defined by expressions
Allows for handling any kind of corner case, e.g. start/end time in custom
string type fields, start/end time using numeric offsets from a reference
date, etc.

Fixes #36319
2020-05-13 20:20:00 +10:00
Nyall Dawson
8e0ea29988 [feature][temporal] Add option to "accumulate features"
Available when the mode is set to "Single Field with Date/Time"
(logically, it ONLY makes sense in this mode!), this setting
causes events to be visible whenever they have occurred before
or during the visible map temporal range.

Fixes #36321
2020-05-13 20:20:00 +10:00
Nyall Dawson
c162293a1b [feature][temporal] Add a fixed static duration option for vector
layers set to the "Single Field with Date/Time" mode

This allows layers with a single field representing the start date
but where all features have a constant event duration to play
nicely with the temporal framework

Also add user friendly descriptions for the various temporal modes
inside the widget

Fixes #26398
2020-05-13 20:20:00 +10:00
Nyall Dawson
3dce1bf173 [feature][temporal] Add "start field + duration field" mode for vector layers
Allows temporal filtering of layers which store a start time in one
field and a duration in a different numeric field. Users are given
a choice of temporal units for the duration (e.g. seconds, days, etc)
2020-05-13 20:20:00 +10:00
Blottiere Paul
86503e53fa Update doc 2020-05-13 10:47:25 +02:00
Blottiere Paul
1c28b69044 Update sip binding 2020-05-13 10:47:25 +02:00
Blottiere Paul
555d8863fa Update sip binding 2020-05-13 10:47:25 +02:00
Blottiere Paul
6550dad449 Update sip 2020-05-13 10:47:25 +02:00
Nyall Dawson
60d87e785a [temporal] Try to auto-populate reasonable initial choices for
vector layer temporal settings

When a new vector layer is loaded, we scan through the fields
for likely candidates for the start and end field choices. If found,
we initially setup the temporal properties to these guessed fields,
but we DON'T automatically enable temporal properties for the layer.

It's just a nice little shortcut, much like how we auto-guess the
appropriate title field for a newly added layer
2020-05-13 16:40:39 +10:00
Matthias Kuhn
b2890f0b6b
Merge pull request #36283 from nyalldawson/html_colors
Respect HTML colors in labels
2020-05-12 13:16:56 +02:00
Martin Dobias
a5160086ed Support TMS convention with vector tiles ({-y} instead of {y})
XYZ convention has zero Y at the top and increasing downwards,
but various map servers use TMS convention which has zero Y at
the bottom and rising upwards (within tile matrix)
2020-05-12 12:10:55 +02:00
Nyall Dawson
f2b03a8334 Doxygen test fixes 2020-05-12 19:21:39 +10:00
Nyall Dawson
99c8510709 Sipify 2020-05-12 15:37:22 +10:00
Nyall Dawson
180bbeccb8 PyQGIS syntatic sugar, start on tests for QgsTextDocument 2020-05-12 13:26:50 +10:00
Nyall Dawson
7dfc510771 Fix scalebar text size calculation when HTML formatting is used 2020-05-12 11:37:08 +10:00
Nyall Dawson
8b263162d5 Try to fix Travis build 2020-05-12 10:46:45 +10:00
Nyall Dawson
bf71382065 Don't try to reuse True value in enum, causes Python issue 2020-05-12 10:33:30 +10:00
Nyall Dawson
9a63810d82 Use composition rather then inheritance for QgsTextBlock/QgsTextDocument
Allows us to expose these to python and hopefully fixes compilation issue on Travis
2020-05-12 10:33:30 +10:00
Nyall Dawson
cb1e8445d3 Expose some more classes to Python, but mark as unstable API 2020-05-12 10:33:30 +10:00
Nyall Dawson
0e139992e3 Split massive qgstextrenderer.cpp/.h files into separate files per
contained class

and tighten includes to speed up recompilation
2020-05-12 10:33:30 +10:00
Nyall Dawson
e4b201a414 Code shuffle 2020-05-12 10:33:30 +10:00
Nyall Dawson
7fc9c555de More cleanups, avoid multiple parsing of the same HTML content for a label 2020-05-12 10:33:30 +10:00
Nyall Dawson
fe14e52e16 General cleanups, and add support for underline/overline/strikethrough formatting tags 2020-05-12 10:33:30 +10:00
Nyall Dawson
173e209a15 Sip says no 2020-05-12 10:33:30 +10:00
Nyall Dawson
f268356947 Create custom QGIS classes for QgsTextDocument, QgsTextBlock, QgsTextCharacterFormat
etc

In the hope of eventually removing the QTextDocument dependancy for HTML
labels. We use this ONLY for parsing the HTML/css, and it's VERY
heavy for just these needs.
2020-05-12 10:33:30 +10:00
Nyall Dawson
d4fbb6c3d6 [FEATURE] Allow use of color related HTML font tags in label text
When enabled, this option will treat label contents as HTML, and
any FOREGROUND COLOR RELATED html formatting options will be
respected in the rendered label.

I repeat: ONLY HTML COLOR TAGS ARE RESPECTED. This is NOT a bug,
rather this feature has been designed as a "test of the waters"
with HTML formatting in labels, and accordingly only formatting
options which do not alter the font shape were considered.

On the plus side, it works correctly with ALL other label settings,
including shadows, buffers, curved labels, etc!

Sponsored by geoProRegio AG (www.geoproregio.ch)
2020-05-12 10:33:30 +10:00
Nyall Dawson
f5d68ff423 Adapt QgsPalLabeling.splitToLines to account for HTML formatting 2020-05-12 10:33:29 +10:00
Nyall Dawson
87296f246c Add method to extract blocks from HTML text for labeling 2020-05-12 10:33:29 +10:00
Nyall Dawson
df88d42eb3 Add html flag 2020-05-12 10:33:29 +10:00
Andrea Giudiceandrea
27f345f0bf
Fix tick-style scalebar when subdivisions ticks height > segments ticks height
Take the subivisions ticks height into accout, for ticksscalebar box size calculation and horizontal line and labels position, only if the number of subdivisions to draw is greater than 1
2020-05-11 09:14:24 +10:00
Samweli Mwakisambwe
ac0249e8bc enable cumulative temporal controller range setting 2020-05-11 09:00:24 +10:00
nirvn
3675af1778 Address review 2020-05-10 14:30:07 +07:00
nirvn
f105add69a [FEATURE][layout] Expose temporal UI for map items 2020-05-10 14:30:07 +07:00
nirvn
ec32e3248e Address flag comment 2020-05-10 14:02:11 +07:00
nirvn
d0060fd89a Address review 2020-05-10 14:02:11 +07:00
nirvn
9be36fdbf3 [temporal] Optimize canvas rendering by avoiding needless cache clearing 2020-05-10 14:02:11 +07:00
Nyall Dawson
702675ca64 Forward declare QgsMapLayerTemporalProperty subclasses instead of including in header
Speeds up recompilation time
2020-05-10 17:01:44 +10:00
Nyall Dawson
ca64c6cac9 Add a flexible QgsInterval constructor for creating from years/months/days/etc 2020-05-09 20:22:52 +10:00
Nyall Dawson
072222d2fd [feature][temporal] Add expression variables for frame properties
Adds @frame_number, @frame_rate, @frame_duration, which give
the current frame number, frames per second, and length of frames
respectively
2020-05-09 18:06:58 +10:00
Nyall Dawson
cd1f4f3378 [feature][temporal] Add a new "Redraw Layer Only" mode for temporal vector layers
When set to this mode, the layer will automatically be redrawn whenever
the temporal range is changed, but no time based filtering will be applied
to the features.

This configuration is useful when the layer has symbology settings which
vary based on the temporal range. For instance, when a layer is using
time-dependent rule-based renderer expressions or data-defined symbology
expressions.
2020-05-09 18:06:36 +10:00
Matthias Kuhn
753a684c9f
Merge pull request #36265 from m-kuhn/export_label_positions
Abstract dxf export label provider away
2020-05-08 17:49:25 +02:00
Martin Dobias
ab2ec699e9 Clean up doxygen doc so that types are not mistaken as html tags 2020-05-08 12:55:08 +02:00
Martin Dobias
299be94459 Review fixes 2020-05-08 12:55:08 +02:00
Nyall Dawson
731ad8d788 Flesh out QgsVectorDataProviderTemporalCapabilities and implement
setDefaultsFromDataProviderTemporalCapabilities for QgsVectorLayerTemporalProperties

 Please enter the commit message for your changes. Lines starting
2020-05-08 11:46:46 +10:00
Nyall Dawson
bcbfc5eacd Fix sip 2020-05-08 11:46:46 +10:00
Nyall Dawson
82cc5a19cc Add sip casting 2020-05-08 11:46:46 +10:00
Nyall Dawson
0ca630115c Sipify 2020-05-08 11:46:46 +10:00
Nyall Dawson
d98defec1a [feature] Add basic temporal handling support for vector layers
This exposes some basic temporal capabilities for vector layers:
- static time range for layer (to match raster layer possibilities), this
sets a single static time range which applies to the whole layer. ALL
features from the layer will be shown whenever the canvas time
overlaps the layer time range
- "Single field with datetime": Allows selection of a single date
or datetime field from the layer. Features will be shown whenever
this field value is within the canvas time range
- "Separate Fields for Start and End Date/Time": Allows selection
of start and end date/datetime fields from the layer. Features will
be shown whenever the time interval calculated from these fields
overlaps the canvas time range

Some known limitations/inefficiencies:
- currently only date/datetime fields can be used. This was done
to simplify the format handling and avoid the need to worry about
string fields with different datetime formats. In future we should
allow selection of string fields and allow users to enter a custom
datetime format string
- unlike the Time Manager plugin approach, the approach taken here
is to rely completely on QGIS expressions and feature requests to
do the filtering (Time Manager uses layer filter strings and attempts
to set a native SQL filter syntax so that filtering is done on the
backend). This is intentional, because it provides a unified filter
approach regardless of the provider used (i.e. we don't need to worry
about the different SQL syntaxes used natively by the different
providers). The beauty of feature request expression compilation
**should** mean that the QGIS expressions are magically turned into
native backend queries, BUUUUUUUUUUUT... because we lack QGIS expression
support for date time literals, we currently rely on the "to_datetime"
expression function and coerce everything through strings. None of
the expression compilers handle this function, so currently ALL
filtering is done on the QGIS side. We need to add functions for
optimised datetime literal creation, and then ensure that the different
compilers correctly map these literals across to the backend
filter syntax to allow all the filtering work to be done on the database
side...

So currently, performance is much worse with large layers compared
to Time Manager. But, the advantage is that we can use the native
temporal framework and have vector layers animated alongside mesh
and raster layers!
2020-05-08 11:46:46 +10:00
Matthias Kuhn
50e63a785b Abstract dxf export label provider away 2020-05-07 17:13:25 +02:00