56318 Commits

Author SHA1 Message Date
nirvn
818f99674b Fix startup crasher due to auth. error calling non-initialized message bar
(fixes #30366)
2019-07-10 11:19:02 +07: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
142308e712 Add a start/stopRender method to QgsPalLayerSettings
This allows us a chance to correctly call start/stopRender on all
symbols which are used as part of the labels and ensure they are
nicely prepared and cleaned up.

Also adapt labeling engine to add calls to startRender/stopRender where
appropriate.
2019-07-10 10:05:06 +10:00
Nyall Dawson
4f8ca98a06 Ensure the render context has the correct expression context available
(including original feature) when drawing labels as part of a map render
2019-07-10 10:05:06 +10:00
Nyall Dawson
be23525a5e Use a non-const QgsRenderContext& when preparing labeling providers,
for compatibility with symbology (which requires non-const context)
2019-07-10 10:05:06 +10:00
Nyall Dawson
6d02c93bd9 Adjust test result 2019-07-10 08:10:49 +10:00
Nyall Dawson
13be186b90 Use QgsMapLayer::providerType() instead of dataProvider()->name(),
as it's more robust in handling invalid layers
2019-07-10 08:10:49 +10:00
Nyall Dawson
cf22a8d3a2 Use fast project reading in some algorithms, browser project provider 2019-07-10 08:10:49 +10:00
Nyall Dawson
8aa9263413 Fix restoration of vector layer renderers when project has bad layer sources 2019-07-10 08:10:49 +10:00
Nyall Dawson
51ed8c95b2 Dox++ 2019-07-10 08:10:49 +10:00
Nyall Dawson
458a247997 Dox 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
549da3dddb
update error message, Qt 4 is goooone 2019-07-09 15:21:09 +02:00
Denis Rouzaud
47ad1e8ab0
add missing geos include (#30638) 2019-07-09 12:17:39 +02:00
Alexander Bruy
c7d062a078
Merge pull request #30633 from alexbruy/color-description
[processing] make color parameter available to description-based algs
2019-07-09 08:09:12 +03:00
Alexander Bruy
84c530b97b [processing] make color parameter available to description-based algs 2019-07-09 06:14:48 +03:00
nirvn
f6b5d5f8b3 [layouts] Default to right alignment when adding a label item for right-to-left locale 2019-07-09 10:11:45 +07: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
Nyall Dawson
ec246e3ddb [processing] Fix batch mode 'fill with parameter values' option for outputs
Fixes #30543
2019-07-09 07:20:20 +10:00
Ismail Sunni
2850683205 Always enable 3d model material for non 3D model shape. 2019-07-08 16:28:04 +02: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
nirvn
3d2d269e04 Fix crash when using rotation tool with selected feature(s) (fixes #30592) 2019-07-08 10:45:56 +07:00
Nyall Dawson
aa8d5cd22e [processing] Fix API break which breaks some 3rd party providers (e.g. R and Javascript providers) 2019-07-08 13:26:55 +10:00
Nyall Dawson
ed2a0ed098 Use intersection of source, destination CRS AND operation crs as
preview bounds for operation candidates

See justification at https://github.com/OSGeo/PROJ/issues/1549
2019-07-08 12:42:02 +10:00
Nyall Dawson
78d77b74ac Don't allow no-crs options in datum transform dialog 2019-07-08 12:42:02 +10:00
Nyall Dawson
1c0a92d01d Dialog tweaks 2019-07-08 12:42:02 +10:00
Nyall Dawson
fb359049ee Fix dox 2019-07-08 12:42:02 +10:00
Nyall Dawson
d03c9d5053 Show bounds of operations in transform selection dialog 2019-07-08 12:42:02 +10:00
Nyall Dawson
337f1d95f5 Move coordinate bounds map to its own reusable widget 2019-07-08 12:42:02 +10:00
Nyall Dawson
e6ac0e2cbd Add explanatory text to top of transform select dialog 2019-07-08 12:42:02 +10:00
Nyall Dawson
dd9dfb0d08 Show authority:code identifiers on transform selection dialog
Many scopes/remark cross reference these, so by showing them in the
table of available operations we give users more clues how to pick
the correct one.
2019-07-08 12:42:02 +10:00
Nyall Dawson
f74bd3454d Remove hardcoded heading 2019-07-08 12:41:17 +10:00
Nyall Dawson
ea3e0aa252 Fix totally inaccurate message always shows at the top of CRS
selector dialogs in totally inappropriate occasions
2019-07-08 12:41:17 +10:00
Alessandro Pasotti
34ad0b1dfd Do not reset ok to false when opening a GPKG
Fixes #30590
2019-07-08 09:59:07 +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
81e82ac1be Warn users when min zoom > max zoom in xyz connection properties
This results in a situation where no tiles can be loaded
2019-07-08 08:41:21 +10:00
Nyall Dawson
900d970a28 [xyz] Don't crash on empty tilesets, instead return empty images
This situation can validly arise e.g. if a user puts in a greater min
tile zoom level then is actually available
2019-07-08 08:41:21 +10:00
nirvn
9345e9ea1a Fix crash when triple-clicking on the vertex tool button (fixes #30577) 2019-07-07 14:00:05 +07:00
Nyall Dawson
1c51d34ca1 [FEATURE] Add "extract symbols" action to QGS/QGZ project file context menu in browser
Opens the style manager dialog showing all symbols, colorramps, text formats
and label settings from the selected project.
2019-07-07 16:38:33 +10:00
Nyall Dawson
be1af1aeb9 Fix qt warning 2019-07-07 16:38:33 +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
f3dcd8211e Dox, comments 2019-07-06 12:36:54 +10:00