3824 Commits

Author SHA1 Message Date
rldhont
faa7c750bc Merge pull request #4699 from pblottiere/getlegendgraphic
[Server] WMS GetLegendGraphics refactoring
2017-06-12 09:40:57 +02:00
Nyall Dawson
63611b1d8f Port script code functions to c++ classes
Restore logging executed algorithms
2017-06-12 15:59:56 +10:00
Nyall Dawson
60ea095d01 Port calculation of iterating destination to c++ 2017-06-12 13:35:17 +10:00
Nyall Dawson
40cae29228 Merge pull request #4702 from nyalldawson/processing_pt31
More processing goodness, restore algs
2017-06-12 11:17:47 +10:00
Nyall Dawson
0ceeb297f8 Merge pull request #4706 from nyalldawson/id
Use uuid instead of timestamp when generating layer ids
2017-06-12 10:21:09 +10:00
Nyall Dawson
9f018e67e2 Fix handling optional multiple table field parameter with no fields set 2017-06-12 09:16:10 +10:00
Nyall Dawson
2d2c229332 Port checkInputCRS to c++, and allow algorithms to flag when they
require all input layers to be in the same CRS

The default behaviour is to assume that algorithms are well behaved
and can handle multi-CRS inputs, but algs have the option to
flag that they do not allow this and require the input CRS check.

Those algs should document that they require all inputs to have
matching CRS - processing 3.0 behaviour is to assume that algs
can handle this.
2017-06-12 07:26:02 +10:00
Nyall Dawson
74ce5550ad Remove duplicate QgsRectangle::unionRect method
QgsRectangle::combineExtentWith does the exact same thing
2017-06-12 07:03:08 +10:00
Nyall Dawson
10341310c2 Add a provider unit test checking extent after adding/deleting features 2017-06-11 13:02:49 +02:00
Matthias Kuhn
cc877c39eb No more QgsGeometry pointers in the public API
Geometries are passed as const reference and returned by value.
This make using the API easier and reduces the risk of ownership
problems.

The overhead is minimal due to implicit sharing.

Fix https://github.com/qgis/qgis3.0_api/issues/68
2017-06-11 09:13:16 +02:00
Nyall Dawson
e839ab1dab Indentation 2017-06-10 19:38:33 +10:00
Nyall Dawson
03bfe9bfbc Use uuid instead of timestamp when generating layer ids
Timestamps can result in duplicate layer ids when layers
are created rapidly or in different threads.

Fix #14390
2017-06-10 19:07:27 +10:00
Nyall Dawson
326e442548 Fix crash when saving vector layer in background task 2017-06-10 18:53:01 +10:00
Blottiere Paul
7b844837bb [Server] Fonts used in GetLegendGraphics tests are bolded and increased 2017-06-09 12:55:27 +01:00
Blottiere Paul
c1657ac853 [Server] Add/update tests 2017-06-09 12:55:27 +01:00
Stéphane Brunner
9d9e94e6b9 Fix the mandatory OnlineResource 2017-06-09 13:32:47 +02:00
Stéphane Brunner
2346f59f56 More verbose response 2017-06-09 13:32:47 +02:00
Denis Rouzaud
00b2d24247 sipiy gui symbology 2017-06-09 10:16:08 +02:00
Denis Rouzaud
58674146af sipify gui effects + layertree 2017-06-09 10:16:08 +02:00
Denis Rouzaud
532b9a142a sipify gui part n 2017-06-09 10:16:08 +02:00
Nyall Dawson
d4acdac618 Merge pull request #4701 from nyalldawson/processing_pt31
[processing] allow optional feature sink parameters
2017-06-09 14:54:10 +10:00
Nyall Dawson
57a6735810 Merge pull request #4672 from nyalldawson/scale
Unify scale widgets API, pt 1
2017-06-09 14:51:39 +10:00
Nyall Dawson
a8ca3b28ae Port test to new API 2017-06-09 14:26:35 +10:00
Nyall Dawson
6b55300fbc If a feature sink parameter is optional and not set, don't create the sink
This adds a lot of flexibility to algorithms, as it makes output
sinks truely optional. For instance, the various "Extract by..."
algorithms could add a new optional sink for features which
'fail' the extraction criteria. This effectively allows these
algorithms to become feature 'routers', directing features onto
other parts of a model depending on whether they pass or fail
the test.

But in this situation we don't always care about these failing
features, and we don't want to force them to always be fetched
from the provider. By making the outputs truely optional,
the algorithm can tweak its logic to either fetch all features
and send them to the correct output, or only fetch
matching features from the provider in the first place (a big
speed boost).
2017-06-09 14:22:29 +10:00
Nyall Dawson
32ecbcfa21 Merge pull request #4693 from nyalldawson/request_crs
Allow specifying a destination CRS in QgsFeatureRequest
2017-06-09 10:49:02 +10:00
Nyall Dawson
37f86f5f04 Unify diagram scale API with rest of scale API 2017-06-09 10:34:34 +10:00
Nyall Dawson
e0d29e782f Update tests for new API 2017-06-09 09:42:20 +10:00
Nyall Dawson
b07726592c Flip remaining scale API from real to denominators 2017-06-09 09:12:42 +10:00
Nyall Dawson
08a9bcba0a Unify scale widgets API
Flip all scale based widgets to use scale denominators instead
of actual scales (ie 100.0 instead of 0.01 for 1:100).

This is done for consistency with the rest of the API, which
predominantly uses scale denominators. It also helps
precision loss as a result of multiple 1.0 / scale conversions
throughout the code.

Refs #15337
2017-06-09 09:11:10 +10:00
Nyall Dawson
e437812a68 Return an invalid iterator if a transform exception occurs
when projecting filter rects from destination crs
2017-06-09 08:57:00 +10:00
Nyall Dawson
9f71156a13 Merge pull request #4678 from nyalldawson/layer_scale
Swap QgsMapLayer min/max scale API definitions (unify scale api, pt 2)
2017-06-09 07:44:01 +10:00
Martin Dobias
91be49a163 Fix python tests after previous commit 2017-06-08 23:02:02 +02:00
Martin Dobias
2964c33d63 Reshape tool: use default Z value for 3D geometries 2017-06-08 21:56:21 +02:00
Nyall Dawson
8ef6722e9a Indentation 2017-06-08 19:20:07 +10:00
Nyall Dawson
b6e1eea4c7 Handle request destinationCrs in QgsVectorLayerFeatureIterator 2017-06-08 19:20:07 +10:00
Nyall Dawson
a98923507e Allow specifying a destination CRS in QgsFeatureRequest
If set, all geometries will be reprojected from their original
coordinate reference system to the destination CRS while
iterating over features.

If a CRS has been set as the destination CRS, then the filterRect
parameter should be specified in the same CRS as this destination
CRS.

Additionally, a callback function can be specified on the request
to be called if a transform exception is encountered while
iterating over features.

This is designed to make it easier for scripts and plugins to
correctly reproject layers in an efficient and robust way, instead
of having to implement lots of repeated code themselves and
potentially missing some of the important considerations which
come with reprojecting geometries & bounding boxes.

Now, if a script wants the features from a layer in a specific
CRS, they can call:

    crs = QgsCoordinateReferenceSystem('epsg:4326')
    request = QgsFeatureRequest().setDestinationCrs(crs)
    for f in layer.getFeatures(reqeuest):
        print('geometry in 4326 is {}.format(f.geometry().exportToWkt()))
2017-06-08 19:20:07 +10:00
Nyall Dawson
7651f9fb71 Merge pull request #4698 from nyalldawson/cache_test
Add feature source test for QgsVectorLayerCache
2017-06-08 17:39:14 +10:00
Nyall Dawson
fbad91165c Add feature source test for QgsVectorLayerCache
While it's not a QgsFeatureSource subclass (yet), it behaves
just like one so when can run the feature source conformance
test suite over it.

Fix a few minor issues identified by the test suite, and one
potential crash (requesting an invalid id from a cache iterator
crashes qgis)
2017-06-08 16:59:21 +10:00
Denis Rouzaud
ed915e75a2 sipify gui part 1 2017-06-08 08:52:02 +02:00
Nyall Dawson
342897c6ae Add source test for vector layer with deleted features in buffer 2017-06-08 06:42:09 +10:00
Nyall Dawson
3f81fc0913 Add feature source unit tests for vector layer with edits in buffer
Run the feature source tests over a layer with added, edited
geometries, and edited attributes unsaved in an edit buffer

Fix identified issues when iterating over these edited features
2017-06-07 22:26:11 +10:00
Denis Rouzaud
9a40754fb8 sipify Qgis, QgsDxfExport 2017-06-07 12:03:22 +02:00
Nyall Dawson
5f1a78ddab Update inverted polygon test mask 2017-06-07 05:46:56 +10:00
Martin Dobias
9cd3ef02ac Use invalid CRS as default in map settings
I have got caught by the default set to WGS 84 when I loaded a layer
in projected CRS, set extent to layer's extent and... nothing got rendered
because map renderer was reprojecting to WGS 84.

This default is closer to the default in 2.x where reprojection is turned off.
2017-06-06 15:06:01 +02:00
Martin Dobias
39b5f4e5b3 Update acceptable missing doc 2017-06-06 13:16:58 +02:00
Sandro Santilli
eddf23c381 Make the check rule use xvfb-run, drop check-no-x
I see no reason for anyone wanting to see popping windows during
a `make check` run. Closes #12172.
2017-06-06 12:39:35 +02:00
rldhont
dbedd7e190 Merge pull request #4683 from rldhont/server-string-list-exceptions
[Server] bulk enhancements: string, list and exceptions
2017-06-06 10:09:52 +02:00
Sandro Santilli
38d905f694 Add a notice about service=qgis_test being used by some tests 2017-06-06 09:51:30 +02:00
Sandro Santilli
7af47c2afa Add a raster table to the test postgis setup, use it from dbmanager test 2017-06-06 09:51:30 +02:00
Nyall Dawson
c1d35a043b Port getHTMLOutputsCount to c++ API 2017-06-06 15:39:54 +10:00