34369 Commits

Author SHA1 Message Date
Nyall Dawson
88047cc984 Merge pull request #3441 from nyalldawson/simplify
Simplify features + fixes
2016-09-01 21:02:09 +10:00
Hugo Mercier
798817eee0 Merge pull request #3442 from mhugo/fix_dependencies
Cleanup layer dependency api
2016-09-01 10:59:44 +02:00
Hugo Mercier
a86611b626 Cleanup layer dependency api 2016-09-01 09:58:37 +02:00
Nyall Dawson
7a8ab40717 Merge pull request #3440 from nirvn/qt5_fix_freeze
Remove composer window visibiliy state restoration upon project load (fixes #15495)
2016-09-01 09:39:00 +10:00
Nyall Dawson
56b77db88c [FEATURE][processing] Add choice of simplification method to simplify
This change allows users to choose which method to use when running
the simplify geometries algorithm, with choices of the existing
distance based (Douglas Peucker) algorithm, area based (Visvalingam)
algorithm and snap-to-grid.

Visvaligam in particular usually results in more cartographically
pleasing simplification over the standard distance based methods.
2016-09-01 08:22:18 +10:00
Nyall Dawson
fbd6618d4a Add missing sip binding 2016-09-01 08:04:39 +10:00
Nyall Dawson
5d97d03ad5 [processing] Fix simplify alg handling of null goemetry, add tests 2016-09-01 07:50:02 +10:00
Nyall Dawson
f9e508c566 [processing] More efficient point count for simplify algorithm 2016-09-01 07:42:29 +10:00
Nyall Dawson
73d8544cec Bump max pixel distance for OTF simplification 2016-09-01 07:40:22 +10:00
Nyall Dawson
72d9e9ae35 Fix crash using Visvalingam simplification, add test 2016-09-01 07:35:30 +10:00
Matthias Kuhn
d5377dbc2e Support pre-CXX11 compilers
I'll update the toolchain one day, I promise!
2016-08-31 18:18:55 +02:00
Hugo Mercier
bd3cf76f5f Merge pull request #3320 from mhugo/fix_snapping2
Data dependency between layers + snapping fix
2016-08-31 15:46:18 +02:00
Hugo Mercier
0749ba43ba Rework layer dependencies
A new class QgsMapLayerDependency allows to represent different kinds
of dependencies between layers.
2016-08-31 14:40:13 +02:00
Matthias Kuhn
504badb41f Fix saving field configurations 2016-08-31 12:35:59 +02:00
Hugo Mercier
1a5a7c5905 [Feature] Data dependencies between layers
This allows to declare data dependencies between layers. A data
dependency occurs when a data modification in a layer, not by direct
user manipulation may modify data of other layers.
This is the case for instance when geometry of a layer is updated by a
database trigger after modification of another layer's geometry.
2016-08-31 09:22:09 +02:00
Juergen E. Fischer
a9464d7c94 db manager: don't consider added layer w/o a dataProvider
(cherry picked from commit 28aa9ebdb75eb099b83a3596b3f3c5c6e5c6f591)
2016-08-30 20:57:00 +02:00
Matthias Kuhn
46ea229049 Fix doxygen 2016-08-30 16:08:53 +02:00
Matthias Kuhn
d6a4ab1c0b Expose QgsCoordinateReferenceSystem to QML 2016-08-30 16:08:18 +02:00
Hugo Mercier
e6fd2e2503 Snapping: destroy index on dataChanged signal
Snapping caches on layers that have been changed by the provider or
by external sources are now invalidated.
2016-08-30 11:08:06 +02:00
nirvn
08f5ae67b1 Remove composer window visibiliy state restoration upon project load
(fixes #15495)
2016-08-30 13:45:37 +07:00
Nyall Dawson
15dd29564c Fix Capitalize First Letter fails with curved labels (fix #14875)
Instead of using QFont's inbuilt capitalization support, which
applies only on rendering and accordingly fails for curved
labels which are drawn one character at a time, we now manually
capitalize label text while registering features.

The capitalize first method from Qt was reimplemented in QgsStringUtils
(together with what I expect is better handling of unicode characters
over the Qt method).

This change also makes it possible to implement other capitalization
methods not directly supported by Qt
2016-08-30 15:34:05 +10:00
Nyall Dawson
0658640fa0 Merge pull request #3418 from nyalldawson/default_values2
[FEATURE] Client side default values
2016-08-30 13:25:37 +10:00
Nyall Dawson
97d7b7339e Move storage of field alias and default value to QgsField
This is a partial implementation - QMaps are still used internally
within QgsVectorLayer to track the alias/default values
between attribute edit operations.

Sponsored by DB Fahrwegdienste GmbH
2016-08-30 12:40:55 +10:00
Nyall Dawson
99405864ca Add a changed signal to QgsEditorConfigWidget
And update default value expression preview whenever editor
config changes

Sponsored by DB Fahrwegdienste GmbH
2016-08-30 12:40:52 +10:00
Nyall Dawson
e35c6b4640 Use widget representValue to preview default expression results
Sponsored by DB Fahrwegdienste GmbH
2016-08-30 12:40:47 +10:00
Nyall Dawson
6d28eb5f2a Optimise expression context creation
Sponsored by DB Fahrwegdienste GmbH
2016-08-30 12:40:42 +10:00
Nyall Dawson
8ae7e3f4ee Use client side default values when creating new features
Sponsored by DB Fahrwegdienste GmbH
2016-08-30 12:40:39 +10:00
Nyall Dawson
66cb422669 Add UI for setting default field value expressions in the
field property dialog

Sponsored by DB Fahrwegdienste GmbH
2016-08-30 12:39:55 +10:00
Nyall Dawson
4d5bae22b8 [FEATURE] Client side default field values
Allows an expression to be set for a vector layer field which
is used to evaluate a default value for this field.

A new method,
QgsVectorLayer::defaultValue( int index,
                              const QgsFeature& feature = QgsFeature(),
                              QgsExpressionContext* context = nullptr )
has been added which evaluates the default value for a given field
using the optionally passed feature and expression context. This
allows default values to utilise properties of the feature
which exist at the time of calling, such as digitized geometries.
The expression context parameter allows variables to be used
in default value expressions, making it easier to eg insert
a user's name, current datetime, project path, etc

Default values are set using QgsVectorLayer::setDefaultValueExpression()
and retrieved using defaultValueExpression()
2016-08-30 12:39:55 +10:00
Nyall Dawson
7dea9700a6 [FEATURE] Substitution list support for labeling
Adds the ability to specify a list of text substitutes to make
which apply to label text. Eg abbrevating street types.

Users can export and import lists of substitutes to make
reuse and sharing easier.
2016-08-30 12:39:54 +10:00
Nyall Dawson
891370fd68 Merge pull request #3438 from nyalldawson/replace
[FEATURE] Substitution list support for labeling
2016-08-30 08:46:35 +10:00
Matthias Kuhn
4a89b7c470 Fix dimension detection in postgres provider 2016-08-29 19:33:32 +02:00
Matthias Kuhn
a529b448e7 Revert "Merge pull request #3338 from pvalsecc/editor_widgets_selection"
This reverts commit bbafbf48872eda48a2be8876cc89a0770552c6ad, reversing
changes made to 13ac0434e10fc7edd1eca665ea7c8b6cb5fd212d.
2016-08-29 19:22:04 +02:00
Matthias Kuhn
b1448233e9 Move QgsMapLayerProxyModel and QgsMapLayerProxyModel to core
Because it's also useful for non-widget applications
2016-08-29 18:43:20 +02:00
Matthias Kuhn
bbafbf4887 Merge pull request #3338 from pvalsecc/editor_widgets_selection
Smarter default edit widgets with plugins to pick them
2016-08-29 17:14:14 +02:00
Juergen E. Fischer
13ac0434e1 creatensis.pl: use passed in version number
(cherry picked from commit 88540c120e933715c397593f498e3a32ff5fb315)
2016-08-29 14:46:47 +02:00
volaya
7884e50c31 [processing] fixed dialog for selecting scripts 2016-08-29 14:13:49 +02:00
Matthias Kuhn
280203e988 If QgsRectangle is empty when combined, replace
It makes no sense to use an empty rectangle to combine with
2016-08-29 13:38:38 +02:00
Nyall Dawson
46fba7ce80 [FEATURE] Substitution list support for labeling
Adds the ability to specify a list of text substitutes to make
which apply to label text. Eg abbrevating street types.

Users can export and import lists of substitutes to make
reuse and sharing easier.
2016-08-29 17:18:34 +10:00
Nyall Dawson
9253228f7f Merge pull request #3434 from pvalsecc/lessWKB
Avoid back and forth with WKB in rendering
2016-08-29 15:54:24 +10:00
Patrick Valsecchi
24bde35ce6 Smarter default edit widgets with plugins to pick them
Now the widgets factories can give a score on how good they could handle
a widget.

Additionaly, plugins can be added to choose a widget factory in function
of an external information. One of them uses a table in PostgresQL to
allow specification of the widget type and configuration.

I took the opportunity to remove a few deprecated method in relation to
this.
2016-08-29 07:42:50 +02:00
Patrick Valsecchi
db91330b66 Avoid back and forth with WKB in rendering 2016-08-29 06:55:52 +02:00
Nyall Dawson
235204fc3d Followup 9ba41e9, SQL convention is sum of no records=NULL 2016-08-29 13:41:13 +10:00
Nyall Dawson
7300cda86b Merge pull request #3435 from nyalldawson/interpolate_angle
Expression functions to Interpolate angle (+ related processing improvements)
2016-08-29 12:54:25 +10:00
Nyall Dawson
9ba41e9f27 Fix calculation of certain aggregates from expressions when no
matching features exist

Eg sum and count should return 0 in this case rather than
null
2016-08-29 12:08:28 +10:00
Nyall Dawson
da78ddeb7c [FEATURE] New expression functions for angle/distance interpolation
angle_at_vertex: returns average (bisector) angle to a geometry
at a specified vertex index
distance_to_vertex: returns distance along geometry to a specified
vertex index
line_interpolate_angle: calculates the angle parallel to a geometry
at the specified distance along the geometry

Sponsored by Andreas Neumann
2016-08-29 11:02:17 +10:00
Nyall Dawson
9fa4e776db [FEATURE][processing] Extract nodes algorithm now saves node
index, distance along line and angle at node

Also correctly handles null geometries
2016-08-29 11:02:14 +10:00
Nyall Dawson
986b5313ed Add QgsGeometry method to get bisector of angle at vertex
Sponsored by Andreas Neumann
2016-08-29 11:01:52 +10:00
Nyall Dawson
8db9284cb3 [FEATURE][processing] Optimised points along geometry algorithm
Supports also polygon geometries, handles null geometries,
and records the original line angle along with the distance
for each point.
2016-08-29 11:01:48 +10:00
Nyall Dawson
9a9a49c16a Make QgsGeometry::interpolate handle polygon geometries 2016-08-29 08:57:10 +10:00