59708 Commits

Author SHA1 Message Date
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
Matthias Kuhn
e23089ee3f Fix dxf test 2019-12-24 19:26:14 +01:00
Matthias Kuhn
f3e309406f Fix labeling offset 2019-12-24 17:39:51 +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
Matthias Kuhn
59c777fd60
Merge pull request #33498 from Samweli/wms_code_convention_refactor
Code refactor on wms capabilities files
2019-12-21 14:14:33 +01:00
David Marteau
907b27309c
Add missing parameter documentation 2019-12-21 13:28:31 +01:00
Matthias Kuhn
5eaaf739b5
Ignore test file in spell check 2019-12-21 12:30:51 +01:00
Samweli
d334e4705b refactored wms capabilities files to the project standards 2019-12-21 12:03:58 +03:00
David Marteau
5bf8d2cd26
Pass project when creating relation from Xml
Fix dependency inconsistency to project from QgsRelationManager
    by forcing  'QgsRelation::createFromXml' to rely on project passed
    to 'QgsRelationManager' instead of using 'QgisProject::instance()'
2019-12-20 23:56:17 +01:00
Matthias Kuhn
602febc39f
Merge pull request #33491 from m-kuhn/windows-server-crash-fix
[server][windows] Fix crash on startup
2019-12-20 20:15:48 +01:00
Nyall Dawson
2371b5d50a Don't run a test under proj 6 2019-12-21 05:07:39 +10:00
Nyall Dawson
3b4ccb42c0 Disable test on proj < 6 2019-12-21 05:07:39 +10:00
Nyall Dawson
9902b3cb14 Skip a test on travis 2019-12-21 05:07:39 +10:00
Nyall Dawson
8e64277c1c [FEATURE][processing] Allow selection of specific coordinate operation
to use when reprojecting vector layers via the "Reproject Layer" algorithm

On proj 6+ builds only!

Allows users to set a specific operation to use for a particular reprojection
task, instead of always forcing use of the current project's transformation
settings.

Useful when reprojecting a particular layer and control over the exact transformation
pipeline is required.
2019-12-21 05:07:39 +10:00
Nyall Dawson
6bb1ad034b Auto select operation in processing widget based on project transform context 2019-12-21 05:07:39 +10:00