6892 Commits

Author SHA1 Message Date
rldhont
3955c1e047 [Test] PyQgsPointClusterRenderer: add usedAttributes test 2019-07-29 09:52:18 +10:00
rldhont
26442d4edb [Test] PyQgsRulebasedRenderer: add usedAttributes test 2019-07-29 09:52:18 +10:00
rldhont
629c3e64d2 [Test] PyQgsSingleSymbolRenderer: add usedAttributes test 2019-07-29 09:52:18 +10:00
rldhont
96e012eb43 [Test] PyQgsSymbolLayer: add usedAttributes tests 2019-07-29 09:52:18 +10:00
Nyall Dawson
ab7106ae99 [labeling][FEATURE] Allow data defined control over "label every
part of multipart features" setting
2019-07-27 20:22:50 +10:00
Nyall Dawson
3484a0246d [labeling] Add API to allow curved labels to overrun features 2019-07-26 18:24:20 +10:00
Nyall Dawson
056f1e4f3c Add method to extend a pal pointset line by a set start and end distance 2019-07-26 18:24:20 +10:00
Nyall Dawson
f2d3bdd486 [proj6] Always normalize operations, even when we are using predefined
proj coordinate operation (e.g. those stored in a project)

Fixes #30643
2019-07-26 12:52:02 +10:00
Nyall Dawson
ca13055770 Add unit tests from #30643 2019-07-26 12:52:02 +10:00
Nyall Dawson
68c4a814b4 Add unit tests from #30569 2019-07-26 12:52:02 +10:00
Matthias Kuhn
4e33bc1fcf
Merge pull request #30610 from signedav/fix_valuerelation
Fix multi-selection on value relation widget using string fields
2019-07-25 18:16:25 +02:00
David Signer
7166f77dfa handle variant as list (instead of string) when the field.type() is QVariant::List - since these values are not stored as string, the tests don't need to check the GDAL version (what shouldn't have been done before anyway because it only concerns geopackages, where this version is checked on storing data...) 2019-07-25 09:46:04 +02:00
Nyall Dawson
fe4a82939e [labeling] Fix empty segment sometimes created when using repeated labels 2019-07-25 15:11:16 +10:00
Nyall Dawson
35a35fbbb1 [labeling] Fix repeated line labels gravitate to start of line
Avoids situations like

1. Line length of 3cm
2. Repeat distance of 2cm
3. Label size is 1.5 cm

    2cm    1cm
/--Label--/----/

i.e. the labels are off center and gravitate toward line starts

Instead, we first calculate how many complete repeats we can fit
in, and then divide the line into even sections of this length,
avoiding the situation where some leftover segment of the line
end isn't big enough for the label to fit.
2019-07-25 15:11:16 +10:00
Nyall Dawson
03d561b199 [labeling] Ensure short lines (wrt font size) still generate sufficient
candidates to ensure centered placement of labels
2019-07-25 12:11:45 +10:00
Nyall Dawson
83a842d44f Ensure ownership of path preprocessor is transferred 2019-07-25 08:41:28 +10:00
Nyall Dawson
2237c6ae99 [API][FEATURE] Allow setting a custom path pre-processor for QgsPathResolver
QgsPathResolver::setPathPreprocessor allows setting a custom path pre-processor
function, which allows for manipulation of paths and data sources prior
to resolving them to file references or layer sources.

The processor function must accept a single string argument (representing the
original file path or data source), and return a processed version of this path.

The path pre-processor function is called before any bad layer handler.

Example - replace an outdated folder path with a new one:

  def my_processor(path):
    return path.replace('c:/Users/ClintBarton/Documents/Projects', 'x:/Projects/')

  QgsPathResolver.setPathPreprocessor(my_processor)

Example - replace a stored database host with a new one:

  def my_processor(path):
    return path.replace('host=10.1.1.115', 'host=10.1.1.116')

  QgsPathResolver.setPathPreprocessor(my_processor)

Example - replace stored database credentials with new ones:

  def my_processor(path):
    path= path.replace("user='gis_team'", "user='team_awesome'")
    path = path.replace("password='cats'", "password='g7as!m*'")
    return path

  QgsPathResolver.setPathPreprocessor(my_processor)
2019-07-25 08:41:28 +10:00
Nyall Dawson
bbd2f65a6c Direct conversion from ogr multilinestrings to QgsGeometry
Avoid expense of converting to/from wkb
2019-07-24 16:41:37 +10:00
Nyall Dawson
4b79efcb19 Optimise reading of multipoints from OGR
Avoid WKB conversion on OGR side, and parsing on QGIS side, and
just handle the direct conversion of OGR geometries instead
2019-07-24 04:10:14 +10:00
Julien Cabieces
0dfa77ddb3 Add a new settings noProxyUrls and change UI to edit this setting 2019-07-23 19:03:51 +10:00
Julien Cabieces
906c8a1de0 fixes #28034 : Return NoProxy instead of DefaultProxy when url matches
excludes list
2019-07-23 19:03:51 +10:00
Nyall Dawson
45b23fd5b2 [callouts] Allow callout types to have icons, and use them in the type combobox
...and pick ugly icons to prompt @nirvn into action ;)
2019-07-23 12:12:18 +10:00
nirvn
aab8e511bd [FEATURE][callouts] Allow specifying an offset from label area distance 2019-07-22 18:29:05 +07:00
Nyall Dawson
2b554d8bab [FEATURE][callouts] Allow specifying an offset from feature distance
which controls a distance from the feature where callout lines end

Makes for visually more appealing callouts vs drawing them right
up against the edges of features
2019-07-22 18:40:08 +10:00
Nyall Dawson
f8cd54288c Improve appearance of multiline tooltips 2019-07-22 13:38:47 +10:00
Nyall Dawson
8f6f04885b [FEATURE] Add @scale_value expression variable for use when evaluating
data defined text format properties while rendering scale bar text

Allows for per-label customisation of the text format inside scale bars
2019-07-22 11:34:32 +10:00
Nyall Dawson
19a2b0e5d5 [api] Allow data defined properties to be set in QgsTextFormat, so
that these are automatically respected whenever the format is
rendered using QgsTextRenderer

This is done transparently to the caller - so by porting away
from the raw QPainter text apis to use QgsTextRenderer instead,
then they immediately gain the ability to use data defined
properties in their text formats.
2019-07-22 11:34:32 +10:00
Nyall Dawson
859d9a7233 Add test for drawing unplaced for a feature with no candidates 2019-07-21 20:29:34 +10:00
Nyall Dawson
c3b2f77a64 [FEATURE][labeling] Allow display of unplaced labels
This setting (accessed through the project label settings dialog)
allows unplaced labels to be shown on the map. These are rendered
using a red color by default (but the color can be changed from
the label settings dialog too), allowing users to determine whether
any important labels are missing from their maps (e.g. due to
overlaps or other constraints).
2019-07-21 20:29:34 +10:00
Nyall Dawson
39d4145aae Append additional "QgsCalloutContext" member to callout rendering virtual
methods

While unused for now, this gives us flexibility in future to specify
additional useful contextual information about how a callout should
be rendered without breaking API (e.g. label text alignment, label
font settings, etc)
2019-07-21 20:29:34 +10:00
Matthias Kuhn
4e0102f3b1
Merge pull request #30816 from m-kuhn/ellipsoid_from_first_layer
Update the project ellipsoid if CRS is taken from first layer
2019-07-20 10:29:54 +02:00
Matthias Kuhn
22dbeee989 Add test for QgsGeometryCheckError::contextBoundingBox() 2019-07-19 11:59:08 +02:00
Matthias Kuhn
ce8004446a Update the project ellipsoid if CRS is taken from first layer
Fix #30815
2019-07-19 11:08:39 +02:00
Matthias Kuhn
b1e5eb09cf
Merge pull request #30748 from troopa81/fix_referencerelationwidget_addEntry
Fix addEntry for reference relation widget
2019-07-19 07:08:11 +02:00
Nyall Dawson
dbe7e6156e Append additional "QgsCalloutContext" member to callout rendering virtual
methods

While unused for now, this gives us flexibility in future to specify
additional useful contextual information about how a callout should
be rendered without breaking API (e.g. label text alignment, label
font settings, etc)
2019-07-19 13:38:49 +10:00
Julien Cabieces
9a60f17565 Replace setted with set 2019-07-19 09:11:41 +10:00
Julien Cabieces
29883f18e5 fixes #29667 end feature setting mode before warning attribute form interface 2019-07-19 09:11:41 +10:00
David Signer
b4dab2df38 made QgsPostgresStringUtils namespace to class because of private functions we use there and possibly in future there are more coming and renamed the methods
fixed indents and comments
2019-07-18 09:25:34 +02:00
Nyall Dawson
83168d3a02 [FEATURE] Add a separate unit choice for milliradians (SI definition) vs mil (NATO definition)
Allows angular measurements in either of these units
2019-07-18 15:06:52 +10:00
Nyall Dawson
8cc54aed45 Correct definition of miliradians to 1/1000 radian, not 3200/pi radians
And add missing unit tests
2019-07-18 15:06:52 +10:00
David Signer
201dd0850b renamed QgsArrayUtils to QgsPostgresStringUtils 2019-07-17 16:50:58 +02:00
David Signer
109b4d7f21 improved parsing and building function to handle multidimensional arrays
code mostly taken from this integration in the postgresprovider / postgresconn
x
2019-07-17 16:24:42 +02:00
Julien Cabieces
8515bb81d9 Convert QVariant to int before QCOMPARE 2019-07-17 08:56:28 +02:00
David Signer
98a271b365 tests for arrayutils creating lists and parsing back 2019-07-17 07:47:54 +02:00
Nyall Dawson
9f219e0ca2 Spelling 2019-07-17 11:07:01 +10:00
Nyall Dawson
4ab51b02fc [labeling] Fix labels 'jump' when using move label tool and alignment
is set to a non-field based value
2019-07-17 11:07:01 +10:00
Nyall Dawson
e1bfb857da [labeling] When label map tools are used to select a label and the
user clicks on overlapping labels, prioritise either the labels in
the current layer OR fallback to picking the smallest candidate
label (since it will be the most difficult to select)
2019-07-17 11:07:01 +10:00
Matthias Kuhn
a51fbd6057 Add angle unit tests for mil 2019-07-17 04:26:29 +10:00
Julien Cabieces
dc51505541 Fix addEntry for reference relation widget and use referenced field
index and not referencing one
2019-07-16 15:55:14 +02:00
Nyall Dawson
1e4114a634 Fix creating auxilary field fails if _ present in field name 2019-07-16 20:53:35 +10:00