63869 Commits

Author SHA1 Message Date
Alessandro Pasotti
4304d8636d Fix precision in test 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
50f66ba3cb Increase tolerance when comparing floats in processing tests 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
e0514de0cd Break on first error 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
7fa6f38689 Memory provider: roll back on errors
Long story short: calling provider's addFeatures
is implemented for some providers in a way that
will roll back all changes on errors, leaving
the backend storage unchanged.

Adding a QgsFeatureSink flag to control this
behavior allows certain providers to support
partial feature addition.

The issue comes from QgsVectorDataProvider::commitChanges
that is documented to leave the provider unchanged (roll
back) on any error, giving the client code the possibility
to fix errors (in the editing buffer) and re-commit.

Without a full rollback implementation in the memory
provider and after the type check introduction in this
PR we ended up with situations like this:

vl = ... an empty memory layer
self.assertTrue(vl.addFeatures([valid, invalid]))
self.assertFalse(vl.commitChanges())
self.assertEqual(vl.featureCount(), 1)  <--- fails!
We actually had 3 features from vl.getFeatures():
[valid, invalid, valid] (the first from the provider
the second and third from the editing buffer).

On the other hand, QgsFeatureSink would probably assume
that addFeatures will allow partial additions.

BTW: This is for sure the longest commit message I've ever
     written.
2020-06-20 04:30:18 +10:00
Alessandro Pasotti
64675ca090 File writer: better error message formatting 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
e629f8bdb3 Add zero test case 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
9da3ba383e Processing: don't crash if no feedback 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
6d15140454 Fix test data 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
fb9de10016 Skip check if value is NULL 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
f3bbc4d81c Use QgsField::convertCompatible to check for errors 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
39068c1cd5 Sipify 2020-06-20 04:30:18 +10:00
Alessandro Pasotti
3a22d35ce8 Update src/core/qgsvectorlayerutils.h
Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
2020-06-20 04:30:18 +10:00
Alessandro Pasotti
68baf74906 Add type check to file writer an memory layer
Fixes #36715

Adds a method to check for QVariant conversions, also
check for integral type narrowing so that for example
floating point 123.45 does not get down casted to integer
without raising an error.
2020-06-20 04:30:18 +10:00
Even Rouault
9163100cb7 UI: rename Average zoomed-out resampling method to Bilinear to reflect real implementation 2020-06-20 04:29:36 +10:00
Even Rouault
689efad71b Early raster resampling: fix issue with zoomed-in cubic on RGB+mask datasets 2020-06-20 04:29:36 +10:00
Even Rouault
458b825d35 Raster resampling: add cubic resampling for zoomed out 2020-06-20 04:29:36 +10:00
Even Rouault
c6f36503d3 qgsgdalprovider.cpp: add getGDALResamplingAlg() function 2020-06-20 04:29:36 +10:00
Even Rouault
93bc7c2f04 Raster rendering: enable provider-side resampling when available, and reprojection is done 2020-06-20 04:29:36 +10:00
Even Rouault
df8dd11e40 Early resampling: replicate behaviour similar to QgsRasterResampleFilter when zooming out beyond the max oversampling factor 2020-06-20 04:29:36 +10:00
Even Rouault
aaaf0f7dc4 Raster reprojector: do not use full resolution hint when provider resampling is enabled
Credits @nirvn
2020-06-20 04:29:36 +10:00
Even Rouault
904a337804 Raster layer properties dock panel: add 'Early resampling' checkbox, and move common code with raster properties dialog into a QgsResamplingUtils class 2020-06-20 04:29:36 +10:00
Even Rouault
d2497c8212 Early resampling: fix requests typical of pixel identification 2020-06-20 04:29:36 +10:00
Even Rouault
47da98c070 Raster resampling: add provider-level settings, and a switch at rasterpipe level between resamplingFilter and provider resampling
Also
* in settings UI, add a 'Early resampling' checkbox
* in raster properties UI, add similar checkbox
* serialize/deserialize new settings in QgsRasterLayer XML
2020-06-20 04:29:36 +10:00
Even Rouault
f32026c8e0 [GDAL provider] Fix misalignment of raster with overviews
Fixes #36820

The way QGIS is currently handling resampling is sub-optimal given GDAL >= 2
capability of having sub-pixel accuracy. So when a QgsRasterResampleFilter
is set, make it try to delegate resampling back to the underlying input interface,
and implement that improved resampling in the GDAL provider.

The GDAL resampling will take into account the settings of the QGIS resample
filter: zoom-in resampling kernel, zoom-out resampling kernel and max resampling
factor. The later is important to avoid performance issues if not enough overview
levels are generated (in the case, we will fallback to the generic method, which
may introduce sub-pixel shifts)
2020-06-20 04:29:36 +10:00
Even Rouault
e7cdc70f24 Revert "QgsGdalProvider::readBlock(): simplify call to GDALRasterIO()"
This reverts commit 3081f2a85c53da24f1022c0057077b1cba71d9d7.

Revert the commit. It causes too much failures on Travis-CI. See
https://api.travis-ci.org/v3/job/694715036/log.txt
Furthermore for the failed cases, I don't have locally the same differences
as on Travis-CI. So might be GDAL dependent or something else.

Not worth the huge trouble to update for nearest neighbour resampling
changes.
2020-06-20 04:29:36 +10:00
Even Rouault
45539cf124 QgsGdalProvider::readBlock(): simplify call to GDALRasterIO()
Instead of doing our own nearest neighbour resampling, use directly the
one of GDAL to avoid creating a temporary buffer. Should hopefully be
slightly more performant, and at least less complicated on QGIS side.

Update a few test cases that are sensitive to the difference in
resampling
2020-06-20 04:29:36 +10:00
Even Rouault
5cd56e35c6 QgsGdalProvider::readBlock(): code cleanups/clarifications
* Remove old / confusing comments
* Rename various variables to be hopefully clearer

Should result in no functional change, but acts as a preparation
for follow-up changes
2020-06-20 04:29:36 +10:00
Harrissou Sant-anna
f2f7236fc8
Layout new name dialog
Make the new layout dialog use the qgsnewnamedialog class
Add/enable help button to open user manual chapters
2020-06-20 04:28:18 +10:00
Nyall Dawson
847295758c [feature][gps] Add option to calculate bearing based on travel direction
For devices which report faulty bearing measurements, this option can
be used to instead calculate the GPS bearing based on the previous
two recorded locations
2020-06-20 04:26:30 +10:00
Alessandro Pasotti
66ce30c446 Code layout 2020-06-20 04:24:55 +10:00
Alessandro Pasotti
e55751bc95 Apply suggestions from code review
Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
2020-06-20 04:24:55 +10:00
Alessandro Pasotti
4b362629e8 GPKG and spatialite AUTOINCREMENT: get next value from sequence
for PK default value, fixes #37222

Also, fix dangling transactions for spatialite.
2020-06-20 04:24:55 +10:00
Alessandro Pasotti
2e6fdbe615 Evaluate defaults when adding new features in transaction group
Fixes #37222
2020-06-20 04:24:55 +10:00
Nyall Dawson
4dc9b38142 Add API to retrieve QGIS version used to save a QgsProject
project.lastSaveVersion()

now returns the version number used to save the project.
Also cleanup QgsProjectVersion code

Fixes #37288
2020-06-20 04:21:53 +10:00
Juergen E. Fischer
0ac73f4fe4 Bump version to 3.15 2020-06-19 14:17:00 +02:00
Juergen E. Fischer
2559994397 changelog and news update for 3.14 2020-06-19 14:15:52 +02:00
Juergen E. Fischer
3ff0592905 translation update for 3.14.0 from transifex 2020-06-19 14:15:45 +02:00
Mathieu Pellerin
714b2ef9f2
[wms] Fix broken WMS layers from servers using relative OnlineResource paths 2020-06-19 17:55:23 +07:00
Martin Dobias
21c6573db6 Review fixes + comment about merging of multi-part geometries 2020-06-19 12:54:21 +02:00
Martin Dobias
00a102c6b9 Fix performance issue when splitting polygons (fixes #34326)
Using test data with a HUGE polygon with several hundreds of thousands
of vertices and nearly a thousand of holes, split geometry was taking
really long time. On my laptop ~67 seconds for a simple split line.

With this fix, the time went down to ~10 seconds for the test polygon.

The issue was that split tool was doing an expensive exact intersection
calculation for each polygon part returned from polygonize, and then
calculating areas to see whether the original polygon part and intersected
part were more or less the same. I think that can be replaced by a much
simpler point in polygon test to figure out whether the particular
polygon part from polygonize is falls inside the original geometry
or whether it falls into a hole or exterior.

In my tests the time could be further improved to ~3 seconds by disabling
mergeGeometriesMultiTypeSplit() function - it is a bit of a mistery to me
what problem does it solve, however it has N^2 running time with N being
number of rings - but I did not feel adventurous enough to poke into it.
(mainly because there are no unit tests that would verify its behavior)
2020-06-19 12:54:21 +02:00
Denis Rouzaud
0cb8408425
more flags warnings fixes for Qt 5.15 (#37309)
* more flags warnings fixes for Qt 5.15

* fix sip compilation
2020-06-19 12:02:00 +02:00
Alessandro Pasotti
359498091e
Merge pull request #37277 from elpaso/bugfix-29264-spatialite-wrong-feature-count
Fix spatialite wrong feature count
2020-06-19 09:12:40 +02:00
nirvn
f7bb4b8f98 [temporal] Insure the output directory exists when exporting animation 2020-06-19 12:37:37 +07:00
Vincent Cloarec
f5a7d90cf2
another active vector settings trouble (#37306) 2020-06-19 07:29:27 +02:00
Denis Rouzaud
fe14dc9bb7
fix feature list combo box having identifier value further than fetching limit (#37280)
* test for feature list combo box having identifier value further than fetching limit

* fix feature list combo box having identifier value further than fetching limit

fixes #37266

* make the test a bit more robust

* fix compilation with older Qt

* correctly keep current value

* determine if keep current entry using the current index

* Revert "determine if keep current entry using the current index"

This reverts commit ff3658ba471450bc333a0a24f86e32f85da43c7f.
2020-06-19 06:54:20 +02:00
Juernjakob Dugge
1dc05957ad Explain rationale for increasing field width for reals 2020-06-19 12:35:17 +10:00
Juernjakob Dugge
9b53ca645c Don't alter the field specification for types other than real
Fixes #37254
2020-06-19 12:35:17 +10:00
Nyall Dawson
3dd267c91a Fix setting a layer's Display Name field to a field name containing
spaces or other special characters

Because we actually store the field name as an expression, we need
to make sure we correctly represent these field names as valid
expressions and not just the raw name string
2020-06-19 12:34:50 +10:00
uclaros
1e72b44721 Fix georeferencer help button 2020-06-19 09:20:41 +10:00
Denis Rouzaud
7fb552d62d fix layout 2020-06-19 08:47:23 +10:00