59569 Commits

Author SHA1 Message Date
Nyall Dawson
c924ce5120 [pal] Refine logic for costing polygon candidates
Instead of just considering the "candidate furthest from the polygon
rings" as the best, also consider that candidates closer to the
overall polygon centroid are better than those further from the centroid.

I.e. if two candidates are similarish distances from a ring, pick the
one closer to the centroid instead of the one further from the centroid
(even if that further one is a tiny bit more distant from a ring)
2019-12-29 13:03:23 +10:00
Nyall Dawson
77b3d99b8b Lower default number of polygon candidates per cm2 2019-12-29 13:03:23 +10:00
Nyall Dawson
92f232c7aa [pal] Cache geos area and length calculation results 2019-12-29 13:03:23 +10:00
Nyall Dawson
e0197fe783 [pal] Improve polygon candidate generation logic
Instead of basing the initial dx/dy for the grid-based polygon candidate
generation on the size of the label itself, instead use either the
engine setting for polygon label density OR try and infer this from the
maximum number of candidates to generate for the polygon.

This avoids numerous issues with the label-size based approach:
- small labels (e.g. 1-2 digit labels) would generate a HUGE number of candidates
because the initial dx/dy were very small
- large labels would generate very few candidates, giving few options for
placement within these polygons (due to initially large dx/dy)
- by generating much more candidates then desired for small labels,
all the candidates further from the polygon centers would be culled
at a later step, meaning that the only candidates available for the
labeling problem solving would be clustered around a very small area
of the polygon (instead of distributed over the whole polygon)
2019-12-29 13:03:23 +10:00
Andrea Giudiceandrea
c062b52fd8 Fix SAGA Raster Buffer algorithm (GridBuffer.txt)
Since SAGA 2.3.0, DIST and BUFFERTYPE parameters for Gid Buffer module were renamed to DISTANCE and TYPE, respectively.
2019-12-29 05:49:27 +10:00
Nyall Dawson
1c367605cb
Merge pull request #33467 from Samweli/add_ows_layer_metadata_info
Add WMS, WMTS and WCS metadata_url property in the layer metadata tab
2019-12-29 05:47:56 +10:00
Alexander Bruy
0e01e9529b add scrollarea to layout's pdf export options dialog (fix #33417) 2019-12-29 05:38:49 +10:00
Alexander Bruy
e8d3b4ecd3 reduce height of some dialogs to make them fit into small screens (fix #32021) 2019-12-29 05:38:49 +10:00
Stephen Knox
c242856380 Fix testsqgsgdalutils on proj6 2019-12-28 15:29:47 +10:00
Nyall Dawson
763d4fa731 Fix dox 2019-12-28 04:47:16 +10:00
Nyall Dawson
12d8377f8a Don't use a spatial index to iterate over polygon rings
it's an insane approach
2019-12-28 04:47:16 +10:00
Nyall Dawson
9af3a720e3 Fix crash when no candidates remain 2019-12-28 04:47:16 +10:00
Nyall Dawson
1b5bc76e73 Add descriptive comment 2019-12-28 04:47:16 +10:00
Nyall Dawson
57b41e412a Partially revert 90fb0cd9
Seems this weird logic is still involved in the obstacle avoidance code
2019-12-28 04:47:16 +10:00
Nyall Dawson
5ecc8d5cc3 Nicer code 2019-12-28 04:47:16 +10:00
Nyall Dawson
df2debcba3 Fix point label placement 2019-12-28 04:47:16 +10:00
Nyall Dawson
29955a5516 Satisfy doc test 2019-12-28 04:47:16 +10:00
Nyall Dawson
f9cfa4b3fb More minor cleanups 2019-12-28 04:47:16 +10:00
Nyall Dawson
cb62685e87 Remove redundant scaling factor (the values are set to a fixed range
shortly after this code executes)
2019-12-28 04:47:16 +10:00
Nyall Dawson
49dccd8f21 [pal] Optimisations and fixes for polygon placement costing
1. Remove redundant sort operations
2. Rename classes and methods for clarity
3. Don't overwrite polygon candidate costs with new costs based solely
on the ring distance cost -- instead just increase the existing cost
by the ring distance cost, so that already calculated costs such as
obstacle overlap costs aren't lost
4. Remove unused code
2019-12-28 04:47:16 +10:00
Nyall Dawson
49a7862e28 [pal] Remove some odd/unintelligable logic
Seems to be trimming the candidate list early and artificially
resetting all candidate costs if they are too high?

I believe this code is wrong, or has been made redundant by other
changes to the logic of the labeling engine. At this stage we have
not completely calculated the costs for label candidates, so
sorting and truncating the candidate list here is premature and potentially
removes nice candidates.
2019-12-28 04:47:16 +10:00
Mathieu Pellerin
ddd2c6ea3d Expose QgsBearingUtils to QML 2019-12-27 09:08:38 +07:00
Nyall Dawson
c004f40ee6 Fix build 2019-12-27 08:37:48 +10:00
Harrissou Sant-anna
4557a31cbd [HIG] Remove colon from widget label in status bar 2019-12-27 04:25:14 +10:00
Alessandro Pasotti
e2488eae06
Merge pull request #33521 from elpaso/stored-expressions-fix-rm
Fix stored expression remove
2019-12-26 19:06:58 +01:00
Juergen E. Fischer
157a6700ca txt2tags 3.3: drop --css-sugar --css-inside (closes #33516) 2019-12-26 16:29:03 +01:00
Nyall Dawson
13d409658f [pal] Scale coordinates stored in pal rtrees to full float ranges
Avoids crashes caused by super-heavy labeling jobs, where a huge
number of candidates causes the rtree to branch out to a level
where the leaf size becomes comparable to float epsilon values
2019-12-26 13:19:23 +10:00
Nyall Dawson
5f848be1a5 Add another TODO bug note 2019-12-26 13:18:57 +10:00
Nyall Dawson
bb42c43829 Fix bug in polygon label candidate ranking
Candidates furthest from any obstacles were being preferred, even
when this resulted in labels being located around the edges of polygon
features.

The correct logic should be only to consider direct overlaps of the
candidate with an obstacle as a conflict, and if a candidate does
NOT overlap and obstacles then we rely on the "put labels furthest
from edges as possible" rule.
2019-12-26 13:18:57 +10:00
Nyall Dawson
032e8fd1a8 Add some explanatory comments on the logic happening while ranking
polygon label candidates, and add some TODO notes on bugs identified here
2019-12-26 13:18:57 +10:00
Nyall Dawson
da2419c33f Fix variable name 2019-12-26 13:18:10 +10:00
Nyall Dawson
c5e0ada6bd [needs-docs] Add optional global settings allowing for hard limits
to be placed on the maximum number of point, line and polygon candidates
which are generated for label features

These settings are set via the core\rendering\label_candidates_limit_*
settings, and allow for global limits to be set on the maximum number
of candidates allowed for label features. Placing these limits can
improve map rendering time, at the expense of worse label placement or
potentially missing map labels. (By default no global limit is set, which
means the labeling engine auto calculates the limit or uses the project
level settings)

The intended use case is for server administrators who are seeking for
maximum rendering speed to globally set these limits, causing them to
apply to all projects without the need for project-specific tweaks.
2019-12-26 13:18:10 +10:00
Nyall Dawson
7e3de3a834 Build fixes 2019-12-26 13:18:10 +10:00
Nyall Dawson
664517a968 Rework layout 2019-12-26 13:18:10 +10:00
Nyall Dawson
322eb3139f More test updates 2019-12-26 13:18:10 +10:00
Nyall Dawson
f44c229405 Fix dox test 2019-12-26 13:18:10 +10:00
Nyall Dawson
ad825c9126 Test updates 2019-12-26 13:18:10 +10:00
Nyall Dawson
1899f90a04 [needs-docs] Rework label engine "maximum line candidates" and "maximum polygon candidates"
settings and logic

The previous approach of a single fixed value which applied to ALL line and ALL polygon
features was... not ideal. It meant that all line features would be assigned the same
number of candidates, regardless of length. So a road of length 1 cm on the rendered
map would have an identical number of candidates as a 30cm road covering the length of the
whole map!! This resulted in both a lot of wasted calculations (generating a ridiculous
number of candidates for small lines at barely discernable distances from each other)
AND an insufficient number of candidates for lengthy features (resulting in worse label
placement for these features).

(The situation was similar, but even worse for polygons)

Now, the setting is reworked to "Number of line candidates per cm" and "number of
polygon candidates per cm2". This means that small features get much less candidates,
and large features get much more features! Both a win for map rendering speed in many
circumstances AND good cartography... now that's a nice Christmas gift for QGIS :)
2019-12-26 13:18:10 +10:00
Nyall Dawson
df102a98da [needs-docs] Drop setting for maximum number of point label candidates
This setting is easily replaced by automatically calculated, optimised
values for each separate point plcaement mode individually
2019-12-26 13:18:10 +10:00
Alessandro Pasotti
cd8b6be25d Fix stored expression remove 2019-12-25 23:46:35 +01:00
Samweli
e8c3a8c987 checking with case-insensitive the metadata tags, as suggested by @timlinux and @nyalldawson 2019-12-23 22:11:06 +01:00
Matthias Kuhn
10532accef
Code style 2019-12-23 16:38:00 +01:00
Matthias Kuhn
4f625ce733
Merge pull request #33476 from dmarteau/fix-project-relation-manager
Fix inconsistent dependency to project in QgsRelation/QgsRelationManager
2019-12-23 07:23:08 +01:00
Nyall Dawson
fb5b440d5d [FEATURE] Allow dropping a map layer from the layer tree onto
a projection selection widget to set the projection to match that layer

Just a little timesaving shortcut!
2019-12-23 05:17:40 +10:00
Nyall Dawson
1db193ed5f Add missing file 2019-12-22 20:33:55 +10:00
Nyall Dawson
97e212d753 Add "help" and "reset to defaults" actions to label engine settings panel 2019-12-22 20:33:55 +10:00
Nyall Dawson
d5821feb9f [api] Add api to allow panel widgets to show a "hamburger" style
menu in the top right of the panel

This gives the panel a place to add menu actions like help links
for the panel.
2019-12-22 20:33:55 +10:00
Nyall Dawson
16b981c287 Make label engine project settings dialog open as an inline panel
in the styling dock

Means that you can get instant feedback on changes without having to
close the dialog and refresh the map
2019-12-22 20:33:55 +10:00
Samweli
965cb1344e resolved conflicts 2019-12-21 22:18:44 +03:00
Samweli
93537d3a7e resolving conflicts with master branch 2019-12-21 22:11:56 +03:00