7539 Commits

Author SHA1 Message Date
Nyall Dawson
86facfb620 Unit tests for callouts 2019-07-11 13:03:12 +10:00
Nyall Dawson
af76025fe5 Unit tests for callout registry 2019-07-11 13:03:12 +10:00
Nyall Dawson
f859957ddd [FEATURE] Show 3D length for LineStringZ features in identify derived attributes
If a 3D linestring is identified, add the 3d length of this line
alongside the existing 2d cartesian and ellipsoidal lengths
2019-07-10 10:05:32 +10:00
Nyall Dawson
6d02c93bd9 Adjust test result 2019-07-10 08:10:49 +10:00
Nyall Dawson
0cdad2307b Add api to allow reading a QgsProject file without loading any layers
This causes the project to be read, but no data providers created for
layers (i.e. the same result as loading a project in the app and
choosing to leave bad layers in the project).

It's intended for occasions when you want to efficiently access properties
of a project without the (often very expensive) cost of actually
loading layers. E.g. to just read project metadata, parse the
layer tree structure, extract print layouts or renderer properties, etc.
2019-07-10 08:10:49 +10:00
Denis Rouzaud
47ad1e8ab0
add missing geos include (#30638) 2019-07-09 12:17:39 +02:00
Nyall Dawson
c828130f9a [FEATURE][processing] New algorithm "Combine style databases"
This algorithm combines multiple QGIS style databases into a
single style database. If any symbols exist with duplicate
names between the different source databases these will be
renamed to have unique names in the output combined database.
2019-07-09 11:22:36 +10:00
Nyall Dawson
e65acadc3a [processing][API] Add methods to retrieve lists of files from
QgsProcessingParameterMultipleInput

These need to be handled differently to map layers, and none of
the existing API works for this use case.
2019-07-09 11:22:36 +10:00
Ismail Sunni
edd921c428 [FEATURE] Measurement tool in 3D map view (#30299)
* Add measurement tool bar.

* Add class for measure line.

* Get coordinate of clicked point.

* Add clicked point to string line.

* Store clicekd points to layer.

* Try to render the measurement line.

* Render the measurement line (with some problems).

* Store points in vector.

* Make identify and measure tool exlusive to each other.

* Add measurement dialog.

* Fix only one action must active.

* Some code suggestion from Martin.

* Revert code to show the line.

* Show segment length and the total.

* Implement close dialog means restart 3d measurement.

* Add new button.

* Add unit combo box.

* Fix shadowing private member of class.

* Add slot to combo box unit changes.

* Hide ellipsoid and cartesian radio button.

* Add measure line for QgsPoint.

* Add unit changes feature.

* Add help (pointed to 2D measurement tool).

* Add finish measurement using right click.

* Remove keypress event, it does not make sense.

* Add remove-last-point with middle button.

* Add crsChanged event.

* Remove confusing tooltip.

* Add pan (camera control) action tool for clear state of 3d map tool.

* Change 3D identify tool cursor.

* Fix distance 2D to 3D.

* Remove unclear method.

* Add unit test for measureLine3D.

* Add 3D measurement setting.

* Add header.

* Make extra 3D renderers refresh the scene when they are updated

+ update the 3D renderer every time the measurement line layer is modified

* Set Altitude clamping to absolute.

* Remove options for 3D measurement line.

* Remove help button in 3D measurement dialog.

* Merge duplicate code for handle clicked position.

* Use color for 3d measure line from 2d one.

* Remove unneeded reimplementation method.

* Remove 2D canvas reference.

* Unify update measurement layer.

Use local variable for feature and line

* Create measurement layer once.

* Use data provider to change the geometry.

* Add length3D for QgsLineString.

* Simplify distance calculation and presentation. Remove QgsDistanceArea measurement.

* Descaled z value based on the terrain vertical scale.

* Remove line when tool is deactivated.

* Enable changing the line color from setting, but after re-activation.

* Update color of measurement line after saving option.

* Remove debug message.

* Remove 3D length calculation from distancearea.

* Handle 2D case for length3D, more unit test, and docstring.

* Fix typos.

* Addressing Martin's and Nyall's review.

* Remove setMeasurement to avoid confussion.
2019-07-08 15:21:00 +02:00
Nyall Dawson
200e203496 [processing][needs-docs] Allow running Style from Project algorithm
on a specific project file

Instead of forcing the algorithm to always use the current project,
add an option parameter allowing users to run the algorithm on a
specific project file instead.
2019-07-08 17:55:26 +10:00
Nyall Dawson
c3b1ff11f1 Fix build: 2019-07-08 15:07:42 +10:00
Nyall Dawson
5a7105af7d [FEATURE][processing] Allow file filter and default value to be set
for file/folder inputs in models
2019-07-08 15:07:42 +10:00
Nyall Dawson
e05572a11d Port file parameter definition widget to new APi 2019-07-08 15:07:42 +10:00
Nyall Dawson
e9a1eab694 [processsing][API] Add api to allow QgsProcessingParameterFile parameters
to have a file filter string defined

Previously only an extension was settable, which prevented use when
multiple extension types are possible. A file filter string allows
for flexible file selection instead.
2019-07-08 15:07:42 +10:00
Nyall Dawson
ac0326a351 [API] Add useful PyQGIS additions to QgsSymbol
Adds:
- __len__ : returns number of symbol layers in symbol
- [ ] getter: returns a specific symbol layer, also allows negative indices to retrieve from end of symbol
- del [ ]: removes a specific symbol layer, also allows negative indices
- raise IndexError when an invalid symbol layer is requested
- allow iteration over symbol layers using
  for layer in symbol:
     print(layer.color())
2019-07-08 08:41:59 +10:00
Nyall Dawson
be33cf2191 Fix test 2019-07-07 16:38:33 +10:00
Nyall Dawson
d737b4c986 Add tests 2019-07-07 16:38:33 +10:00
Nyall Dawson
08a985ac8f [FEATURE][processing] New algorithm "Create style database from project"
Extracts all symbols, color ramps, text formats and label settings from
the current project and stores them in a new style XML database
2019-07-07 16:38:33 +10:00
Nyall Dawson
590d1aae9d [FEATURE][API] Visitor API for style entities
Adds a new visitor pattern API for creation of visitors which visit
all the style entities (symbols, color ramps, text formats, and
label styles) associated with different objects. Can be used on a
renderer, map layer, or project wide level.

E.g. on a project wide level, allows collection of ALL the style
symbols/color ramps/text settings inside a project, including those
in layouts or annotations!
2019-07-06 12:36:54 +10:00
Alessandro Pasotti
3798c48654 Use TemporaryDirectory instead of QT (fails on Travis) 2019-07-05 13:33:27 +02:00
Alessandro Pasotti
75defad55c Remove warning 2019-07-05 13:33:27 +02:00
Alessandro Pasotti
b92012ccae Fix relative storage for GPKG projects
Fixes #30387
2019-07-04 11:23:56 +02:00
rldhont
cd53764b26
Merge pull request #30467 from rldhont/ogcutils-propertyislike-wildcard
QgsOgcUtils: The wildcard attribute of PropertyIsLike OGC Filter Element is not well replaced
2019-07-04 07:38:58 +02:00
rldhont
c402a34368
Merge pull request #30514 from rldhont/server-wmts-getcapabilities-operations
[WMTS] Fixing the WMTS GetCapabilities Get element children
2019-07-04 07:38:23 +02:00
rldhont
52f129821f [Test] Add a expressionFromOgcFilter test with And, Or and PropertyIsLike with wildCard to PyQgsOgcUtils 2019-07-03 17:00:24 +02:00
rldhont
d83d8eef89 [Test] QgsOgcUtils: Add ILIKE with wildcard tests 2019-07-03 16:58:10 +02:00
rldhont
e56e446e50 [Test] QgsOgcUtils: Add simple test for PropertyIsLike wildCard
The test for a different wildcard is to complex and does not test the situation of the wild card at the end.
2019-07-03 16:58:10 +02:00
rldhont
72a708c999
Merge pull request #30511 from rldhont/fix-27262-with-tests
[Tests] Add to PyQgsOgcUtils some tests to interpret specific text as decimal in scientific notation
2019-07-03 10:21:21 +02:00
Nyall Dawson
b9c9ad05bc [processing][needs-docs] Allow string parameters in models to be multi-line input style 2019-07-03 05:11:06 +10:00
rldhont
14883e9c27 [WMTS] Fixing the WMTS GetCapabilities Get element children
The ows Get element has a Constraint child that describe the way to do request to the service. In the case of WMTS, all are KVP.
2019-07-02 14:58:48 +02:00
rldhont
627db1a41b [Tests] Add to PyQgsOgcUtils some tests to interpret specific text as decimal in scientific notation
Fixed #27262
2019-07-02 12:58:08 +02:00
rldhont
4a5c5f2fff
Merge pull request #30378 from rldhont/tests_pyqgsogcutils
[Tests] Add PyQgsOgcUtils
2019-07-02 09:17:32 +02:00
lbartoletti
03e8f870e4 add tests for Python qgsRound 2019-07-02 13:29:30 +10:00
Nyall Dawson
13fe327eb9 Fix cloning a vector layer loses all features if the layer is a memory layer 2019-07-02 10:10:11 +10:00
Nyall Dawson
e9fbe3a498 Fix test 2019-07-02 06:17:37 +10:00
Nyall Dawson
1164d204ee [postgres] Unit tests for citext field type 2019-07-02 06:17:37 +10:00
Nyall Dawson
aa1bc5d1f9 [needs-docs][postgres] Correctly handle binary (bytea) fields
Previously these would be silently dropped from the layers, but
we now have comprehensive support for binary fields and should
expose them.

Fix sponsored by WhereGroup
2019-07-02 06:17:37 +10:00
Nyall Dawson
074c584c54 Don't allow name-less parameters 2019-07-01 17:01:34 +10:00
Nyall Dawson
8e3287a7ee Add modeler parameter config for color parameters 2019-07-01 17:01:34 +10:00
Nyall Dawson
4dc24d1efe Allow serialization of QColor to xml in QgsXmlUtils 2019-07-01 17:01:34 +10:00
Nyall Dawson
a9788339ea Port an item type which has a parent parameter choice (layout items) for reference 2019-07-01 17:01:34 +10:00
Nyall Dawson
d83997c490 Port string parameter to new config widget 2019-07-01 17:01:34 +10:00
Nyall Dawson
477d3b1f1a Port boolean widget config dialog to new API 2019-07-01 17:01:34 +10:00
Nyall Dawson
10d6a8a122 [processing][API] Add API to QgsProcessingGuiRegistry and QgsProcessingParameterWidgetFactoryInterface
to handle creation of parameter definition widgets

Previously, these configuration widgets were all hardcoded into the Python modeler
dialog. This prevented 3rd party, plugin provided, parameters from ever being full
first class citizens in QGIS, as there was no way to allow their use as inputs to
user created models to be customised.

Now, the registry is responsible for creating the configuration widget, allowing
for 3rd party parameter types to provide their own customised configuration
widgets.

Refs #26493
2019-07-01 17:01:34 +10:00
Nyall Dawson
d96c7386b1 Allow creation of color parameters with no opacity control 2019-07-01 06:32:21 +10:00
Nyall Dawson
8fc63bff88 Remove unnecessary translation 2019-07-01 06:32:21 +10:00
Nyall Dawson
38bb5fb260 [FEATURE][processing] New parameter type for colors
Allows for algorithms which require a color value as an input
2019-07-01 06:32:21 +10:00
Blottiere Paul
ee6642477e
Merge pull request #30071 from lbartoletti/wms_tile_buffer
[server]New parameter for WMS service: tile_buffer
2019-06-28 16:22:05 +02:00
rldhont
169de69332
Merge pull request #10034 from rldhont/server-feature-id-primary-keys-revival
[Server] Use primary keys to build feature id
2019-06-28 12:08:12 +02:00
Nyall Dawson
018ca7c447 [FEATURE] New expression function "attributes"
Returns a map containing all attributes from a feature, with field
names as map keys. We've got featureful, robust support for working
with maps in expressions now, so this allows rapid conversion
of all feature attributes to a map to use with these handy
functions.
2019-06-28 13:14:17 +10:00