6006 Commits

Author SHA1 Message Date
Nyall Dawson
b9e223d802 Add methods to QgsProcessingContext to return the preferred vector and raster formats
These methods return a file extension to use when creating vector/raster outputs (e.g. "tif"). Generally,
it is preferable to use the extension associated with a particular parameter, which can be retrieved through
QgsProcessingDestinationParameter::defaultFileExtension(). However, in some cases, a specific parameter
may not be available to call this method on (e.g. for an algorithm which has only an output folder parameter
and which creates multiple output layers in that folder). In this case, the format returned by this
function should be used when creating these outputs.

It is the algorithm's responsibility to check whether the returned format is acceptable for the algorithm,
and to provide an appropriate fallback when the returned format is not usable.
2019-09-24 16:50:22 +10:00
Nyall Dawson
cfcf580b61 [processing][needs-docs] Resurrect setting for default raster/vector
output format

This setting is still used and required in some circumstances, e.g.
it is used as the default selection in outputs file pickers when
the previously used format is not valid.
2019-09-24 16:50:22 +10:00
Nyall Dawson
d4ce50c2b1 [processing] Add API support for algorithm aliases
Allows us to freely move algorithms between providers without
breaking existing scripts
2019-09-24 16:48:39 +10:00
Nyall Dawson
abc9f47ca4 [legends] Fix missing symbols for inverted polygon layers when using
filter by map content

Fixes #22718
2019-09-21 06:03:47 +10:00
Matthias Kuhn
ff4f32db0d
Merge pull request #31863 from m-kuhn/gapCheckIgnoreMissingLayer
Gap check ignore missing layer
2019-09-20 18:49:38 +02:00
Julien Cabieces
2ab88ad501 fieldIsEditable looks for joined feature to exist if no upsertOnEdit 2019-09-20 09:49:12 +10:00
Julien Cabieces
484ee53899 Add a utils method fieldIsEditable 2019-09-20 09:49:12 +10:00
Denis Rouzaud
cc64787ee6
Merge pull request #31859 from 3nids/layer_tree_insertion_point_v2
[layer tree] dedicated method in QgisApp to determine insertion point
2019-09-19 11:17:58 +02:00
Denis Rouzaud
13119193ba fix API doc and init values 2019-09-19 09:05:40 +02:00
rldhont
7a77d90c52
Merge pull request #31351 from rldhont/server-wms-dimensions
Support WMS dimensions in QGIS Server
2019-09-18 18:26:31 +02:00
Matthias Kuhn
61812648a3 Add API to hook into resolveReferences 2019-09-18 09:32:02 +02:00
Nyall Dawson
fcd21e4850 [reports] Fix predefined scale mode is incompatible with report outputs
Fixes #29196
2019-09-18 10:35:23 +10:00
Nyall Dawson
ffc71c4f57 Remove const_cast 2019-09-18 07:55:46 +10:00
Nyall Dawson
3de0593957 Ensure atlas expression evaluation has access to coverage layer scope
Fixes #31807
2019-09-18 07:55:46 +10:00
Denis Rouzaud
838dbef3c0 [layer tree] dedicated method in QgisApp to determine insertion point
and create bindings to get the current insertion point in QgisInterface
2019-09-17 20:55:40 +02:00
Harrissou Sant-anna
493a8c814f Add empty line for list rendering 2019-09-18 04:13:31 +10:00
Even Rouault
5e70084d32 QgsRasterFileWriter: improve error reporting 2019-09-17 08:58:25 +10:00
rldhont
4823054019 Define an enum for predefined WMS Dimension names 2019-09-16 22:52:32 +02:00
Even Rouault
fdcca14f65
Make sure ellipsoid parameter and definition caches are cleared before app exit (related to #31762)
This should apply to both PROJ < 6 and >=6 builds.

Fixes the following error reported by Valgrind
```
==5848== Invalid read of size 4
==5848==    at 0xE5E4195: internal_pj_ctx_get_errno (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==5848==    by 0xE5E16AE: internal_pj_free (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==5848==    by 0xE5F4E78: internal_proj_destroy (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==5848==    by 0x7F961A7: QgsProjUtils::ProjPJDeleter::operator()(PJconsts*) (qgsprojutils.cpp:76)
==5848==    by 0x7D2D44C: std::unique_ptr<PJconsts, QgsProjUtils::ProjPJDeleter>::~unique_ptr() (unique_ptr.h:239)
==5848==    by 0x7D2C9BD: QgsCoordinateReferenceSystemPrivate::~QgsCoordinateReferenceSystemPrivate() (qgscoordinatereferencesystem_p.h:94)
==5848==    by 0x7D2D6FA: QExplicitlySharedDataPointer<QgsCoordinateReferenceSystemPrivate>::~QExplicitlySharedDataPointer() (qshareddata.h:165)
==5848==    by 0x7CDFA77: QgsCoordinateReferenceSystem::~QgsCoordinateReferenceSystem() (qgscoordinatereferencesystem.cpp:233)
==5848==    by 0x55CC0AF: QgsEllipsoidUtils::EllipsoidParameters::~EllipsoidParameters() (qgsellipsoidutils.h:39)
==5848==    by 0x7D8C40B: QHashNode<QString, QgsEllipsoidUtils::EllipsoidParameters>::~QHashNode() (qhash.h:149)
==5848==    by 0x7D8C43F: QHash<QString, QgsEllipsoidUtils::EllipsoidParameters>::deleteNode2(QHashData::Node*) (qhash.h:536)
==5848==    by 0x9BE3B78: QHashData::free_helper(void (*)(QHashData::Node*)) (in /opt/qt59/lib/libQt5Core.so.5.9.1)
==5848==    by 0x7D8C466: QHash<QString, QgsEllipsoidUtils::EllipsoidParameters>::freeData(QHashData*) (qhash.h:576)
==5848==    by 0x7D8CCED: QHash<QString, QgsEllipsoidUtils::EllipsoidParameters>::~QHash() (qhash.h:254)
==5848==    by 0xA60E369: __cxa_finalize (cxa_finalize.c:56)
==5848==    by 0x77BE742: ??? (in /home/even/qgis/QGIS/build/output/lib/libqgis_core.so.3.9.0)
==5848==    by 0x4010DF6: _dl_fini (dl-fini.c:235)
==5848==    by 0xA60DFF7: __run_exit_handlers (exit.c:82)
==5848==    by 0xA60E044: exit (exit.c:104)
==5848==    by 0xA5F4836: (below main) (libc-start.c:325)
==5848==  Address 0x45db80e0 is 0 bytes inside a block of size 136 free'd
==5848==    at 0x4C2F440: operator delete(void*) (vg_replace_malloc.c:586)
==5848==    by 0xE5F5A3A: internal_proj_context_destroy (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==5848==    by 0x7F9617A: QgsProjContext::~QgsProjContext() (qgsprojutils.cpp:48)
==5848==    by 0xA60E5FE: __call_tls_dtors (cxa_thread_atexit_impl.c:155)
==5848==    by 0xA60DF26: __run_exit_handlers (exit.c:40)
==5848==    by 0xA60E044: exit (exit.c:104)
==5848==    by 0xA5F4836: (below main) (libc-start.c:325)
==5848==  Block was alloc'd at
==5848==    at 0x4C2E709: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:387)
==5848==    by 0xE5E445E: internal_pj_ctx_alloc (in /home/even/proj/install-proj-master/lib/libproj.so.15.2.0)
==5848==    by 0x7F96151: QgsProjContext::QgsProjContext() (qgsprojutils.cpp:39)
==5848==    by 0x7F970A9: __tls_init (qgsprojutils.cpp:31)
==5848==    by 0x7F970F3: TLS wrapper function for QgsProjContext::sProjContext (in /home/even/qgis/QGIS/build/output/lib/libqgis_core.so.3.9.0)
==5848==    by 0x7F96186: QgsProjContext::get() (qgsprojutils.cpp:57)
==5848==    by 0x7D86B13: QgsEllipsoidUtils::definitions() (qgsellipsoidutils.cpp:351)
==5848==    by 0x7D863FE: QgsEllipsoidUtils::ellipsoidParameters(QString const&)::{lambda()#1}::operator()() const (qgsellipsoidutils.cpp:173)
==5848==    by 0x7D87EE1: void std::_Bind_simple<QgsEllipsoidUtils::ellipsoidParameters(QString const&)::{lambda()#1} ()>::_M_invoke<>(std::_Index_tuple<>) (functional:1531)
==5848==    by 0x7D87BC5: std::_Bind_simple<QgsEllipsoidUtils::ellipsoidParameters(QString const&)::{lambda()#1} ()>::operator()() (functional:1520)
==5848==    by 0x7D879A2: void std::__once_call_impl<std::_Bind_simple<QgsEllipsoidUtils::ellipsoidParameters(QString const&)::{lambda()#1} ()> >() (mutex:706)
==5848==    by 0x10A6AA98: __pthread_once_slow (pthread_once.c:116)
==5848==    by 0x7D863CE: __gthread_once(int*, void (*)()) (gthr-default.h:699)
==5848==    by 0x7D8787F: void std::call_once<QgsEllipsoidUtils::ellipsoidParameters(QString const&)::{lambda()#1}>(std::once_flag&, QgsEllipsoidUtils::ellipsoidParameters(QString const&)::{lambda()#1}&&) (mutex:738)
==5848==    by 0x7D86476: QgsEllipsoidUtils::ellipsoidParameters(QString const&) (qgsellipsoidutils.cpp:174)
==5848==    by 0x7E8D572: QgsMapSettings::setEllipsoid(QString const&) (qgsmapsettings.cpp:322)
==5848==    by 0x6A4E5F1: QgsMapCanvas::QgsMapCanvas(QWidget*) (qgsmapcanvas.cpp:143)
==5848==    by 0x5110841: QgisApp::QgisApp(QSplashScreen*, bool, bool, QString const&, QString const&, QWidget*, QFlags<Qt::WindowType>) (qgisapp.cpp:803)
==5848==    by 0x417DB9: main (main.cpp:1339)
==5848==
```
2019-09-14 15:19:02 +02:00
Juergen E. Fischer
99a525c513 translation string fixes [ci skip] 2019-09-13 13:35:40 +02:00
Nyall Dawson
587c011046 [layouts] Fix grids cannot be disabled, ui widgets for grids get incorrectly
disabled blocking the ability to re-enable grids (master only)
2019-09-13 10:36:06 +10:00
Nyall Dawson
f4d407d9ee Add fromBezierCurve method to QgsLineString
Returns a new QgsLineString as a segmentized version of a bezier curve.
2019-09-13 05:37:37 +10:00
Nyall Dawson
c02686dbd0 Add API for volume units to QgsUnitTypes
Complements the existing API for distance and area handling
2019-09-09 20:12:45 +10:00
rldhont
cc58cba93d API: Define QgsVectorLayerServerProperties to manage QGIS Server properties like WMS DImensions 2019-09-07 16:07:10 +02:00
rldhont
3edd081cc1 Update UI to manage QGIS Server WMS Dimensions 2019-09-07 16:05:10 +02:00
Nyall Dawson
2212617f0c Reuse a single expression context when building icons in QgsStyleModel
Whilst usually this is bad practice (reusing an existing expression context),
and instead you should make a new context for every batch of expression evaluations,
we can't do this in the style model and we end up potentially creating
thousands of new contexts. So instead, we use a single one, which is
safe because the actual expression context used here is a very
basic one...
2019-09-07 15:56:40 +10:00
Nyall Dawson
6b1e96c180 Make a shared instance of QgsStyleModel for the default application style
This allows shared caching of symbol icons, greatly speeding up display
of views which use style models
2019-09-07 15:56:40 +10:00
Nyall Dawson
d94329a788 Make QgsProject responsible for project expression context creation,
and cache the project expression context as much as possible

This scope can be expensive to create upfront, but is cheap to copy
2019-09-07 15:56:40 +10:00
Julien Cabieces
50f3a02eca don't beak API and remove QFuture includes 2019-09-06 10:28:27 +02:00
Julien Cabieces
0e98585fee fix spell errors 2019-09-06 09:42:23 +02:00
Julien Cabieces
42be18c40a Improve task management 2019-09-06 09:42:23 +02:00
Julien Cabieces
119106520e Fix doxygen 2019-09-06 09:42:22 +02:00
Julien Cabieces
1fee18479a add the deprecated doxygen tags 2019-09-06 09:42:22 +02:00
Julien Cabieces
4081bea801 Use TaskManager to build index 2019-09-06 09:42:22 +02:00
Julien Cabieces
ba867b46c6 Add asynchronous bool on QgsSnappingUtils/QgsPointLocator API 2019-09-06 09:42:22 +02:00
Julien Cabieces
f475c28753 s/an other/another 2019-09-06 09:42:22 +02:00
Julien Cabieces
ead7481e3f [FEATURE] Parallelize snap index build 2019-09-06 09:36:16 +02:00
Nyall Dawson
3af35b5844 [FEATURE] "Reselect Features" action in Edit -> Select menu
Allows restoration of a layer's selection following a selection
clear operation. Handy for anyone who has ever painstakingly
built a custom selection only to accidently click and clear
this selection...
2019-09-06 13:08:18 +10:00
Nyall Dawson
b533fbaeb2 Allow individual groups of bookmarks to be exported
Also avoids the unfortunate situation where the first item shown
in the right click menu for a bookmark group is the "delete" action
2019-09-06 13:02:04 +10:00
Nyall Dawson
a426fdaea2 [FEATURE] Bookmark groups can be renamed in browser 2019-09-06 13:02:04 +10:00
Nyall Dawson
4619a810e6 [FEATURE] Add import/export bookmarks actions to browser right-click bookmarks menu 2019-09-06 05:28:46 +10:00
nirvn
b5b869b4f4 [FEATURE][browser] Add bookmarks data items to the browser panel 2019-09-04 17:08:15 +07:00
Peter Petrik
635c1b54d8 Allow to use WMS as static provider 2019-09-04 07:49:09 +02:00
Nyall Dawson
4e51938559 Address review comments 2019-09-04 14:19:47 +10:00
Nyall Dawson
62f28f4201 Fix broken see also link 2019-09-04 14:19:47 +10:00
Nyall Dawson
5f68abfa48 Create a sorting proxy model for bookmarks 2019-09-04 14:19:47 +10:00
Nyall Dawson
c46721559b Add some custom roles to model 2019-09-04 14:19:47 +10:00
Nyall Dawson
1afa6a8ec5 New class QgsBookmarkManagerModel
Move bookmark model logic to core, add tests
2019-09-04 14:19:47 +10:00
Nyall Dawson
aa3a83c7bd Add unit test for importing/exporting bookmarks 2019-09-04 14:19:47 +10:00
Nyall Dawson
9d49389271 Improve performance of bookmark storage/loading 2019-09-04 14:19:47 +10:00