34 Commits

Author SHA1 Message Date
Jorge Gustavo Rocha
38c8e757aa References to issues.qgis.org updated 2019-06-12 00:10:43 +01:00
Alessandro Pasotti
63711510b6 Dear Qt, I love you but ...
... you are too slow and QJson API is so ugly.

Now using this wonderful json lib:
https://github.com/nlohmann/json

Results in release mode (QJson tests are not shown but
QJson was even slower than string concat).

PASS   : TestQgsJsonUtils::testExportAttributesJson(Use json)
RESULT : TestQgsJsonUtils::testExportAttributesJson():"Use json":
     0.0022 msecs per iteration (total: 75, iterations: 32768)
PASS   : TestQgsJsonUtils::testExportAttributesJson(Use old string concat)
RESULT : TestQgsJsonUtils::testExportAttributesJson():"Use old string concat":
     0.0032 msecs per iteration (total: 54, iterations: 16384)
PASS   : TestQgsJsonUtils::testExportFeatureJson(Use json)
RESULT : TestQgsJsonUtils::testExportFeatureJson():"Use json":
     0.011 msecs per iteration (total: 96, iterations: 8192)
PASS   : TestQgsJsonUtils::testExportFeatureJson(Use old string concat)
RESULT : TestQgsJsonUtils::testExportFeatureJson():"Use old string concat":
     0.015 msecs per iteration (total: 64, iterations: 4096)
PASS   : TestQgsJsonUtils::testExportGeomToJson(Use json)
RESULT : TestQgsJsonUtils::testExportGeomToJson():"Use json":
     0.76 msecs per iteration (total: 98, iterations: 128)
PASS   : TestQgsJsonUtils::testExportGeomToJson(Use old string concat)
RESULT : TestQgsJsonUtils::testExportGeomToJson():"Use old string concat":
     0.85 msecs per iteration (total: 55, iterations: 64)
PASS   : TestQgsJsonUtils::cleanupTestCase()
2019-04-18 17:04:30 +02:00
Matthias Kuhn
87686cdd45
Update tests 2019-03-18 13:19:45 +01:00
Nyall Dawson
d6aa46cfe7 Add some notes to test, additional test with empty line 2018-11-10 07:24:02 +10:00
Nyall Dawson
df81e554f8 Fix crash in geometry checker
Fixes #20408
2018-11-09 12:57:42 +10:00
Matthias Kuhn
8da2910993
Add some tests for QgsVectorLayerFeaturePool 2018-10-15 17:29:21 +02:00
Matthias Kuhn
0bb6a16145
Standardize geometry checker tests 2018-10-15 15:25:45 +02:00
Matthias Kuhn
6a94033487
Make feedback a required parameter for geometry checks 2018-10-15 14:28:02 +02:00
Matthias Kuhn
2a5692a520
Add test for overlap check with no area size restriction 2018-10-15 14:28:02 +02:00
Matthias Kuhn
bee5470e10
Python bindings for QgsGeometryCheck and co
Adds

 - python bindings
 - geometry check factory
 - geometry check registry
 - QgsFeedback for geometry checks (lots of potential still)
 - An IsValid geometry check
 - Splits classes into their own files
 - Decouples feature pools from the configuration context
2018-09-28 13:33:24 +02:00
Matthias Kuhn
2275853ce6
Merge pull request #8008 from m-kuhn/missingVertexCheck
Add QgsGeometryMissingVertexCheck
2018-09-27 10:50:27 +02:00
Matthias Kuhn
3c379d36e6
Fix test 2018-09-27 10:12:08 +02:00
Matthias Kuhn
fd869d83d4
Add test for missing vertex check 2018-09-26 14:23:04 +02:00
Matthias Kuhn
ed86d1255f
Add QgsSingleGeometryCheck
This class is a new subclass of QgsGeometryCheck that implements an interface that works on isolated geometries.
It has no dependency on a context, apart from a configuration that can be passed in. This makes it suitable
for checks that only work on in-memory information like self-intersection and other isValid checks.

For reference the classes QgsGeometrySelfIntersectionCheck, QgsGeometryMultipartCheck, QgsGeometryTypeCheck
and QgsGeometrySelfContactCheck have been ported to this interface.
2018-09-17 22:49:25 +02:00
Matthias Kuhn
6d2ec207e1
Calculate layer to map conversion on the fly 2018-09-11 09:08:28 +02:00
Matthias Kuhn
e0926e4445 Rename get() to getFeature() 2018-09-10 13:32:54 +02:00
Matthias Kuhn
cdc7d39a14 Refactor QgsFeaturePool
QgsFeaturePool is now an abstract baseclass, with a new inherited class QgsVectorDataProviderFeaturePool. This allows creating other subclasses, most notably a QgsVectorLayerFeaturePool subclass, that is able to also work on uncommitted features.

Critical calls to methods which are not threadsafe have been protected by executing them on the main thread.
2018-09-05 16:22:53 +02:00
Nyall Dawson
d8c36233e8 Remove some more redundant include directories 2018-04-26 17:28:59 +12:00
Nyall Dawson
3f6e411edb Remove some redundant geos includes 2018-04-26 17:28:59 +12:00
Nyall Dawson
3e1b99be69 Remove a bunch of Qt4 compatibility code 2018-02-06 22:39:42 +11:00
Nyall Dawson
0a9c107fcc Fix build 2017-12-15 14:14:08 +10:00
Nyall Dawson
439ef20088 Prepare for removal of QgsCoordinateTransformCache 2017-12-15 14:13:59 +10:00
Nyall Dawson
70361063d8 Rename QgsGeometry::geometry as QgsGeometry::get()
Because feature.geometry().geometry() is confusing, and impossible
to search for in python code (e.g. is input.geometry() a QgsGeometry
or a QgsAbstractGeometry?)

But more importantantly: also add a const version
QgsGeometry::constGet(). The non-const
version is slow, since it now forces a detach to avoid corrupting
geometries (since QgsGeometry is shared, it's not safe to directly
access its primitive QgsAbstractGeometry and start messing with
it without first detaching). This is a big risk in the 2.x API
which could potentially corrupt feature geometries with unexpected
outcomes.

Update all uses to constGet where possible.
2017-10-26 07:06:34 +10:00
Sandro Mani
9a2393ea92 [Geometry checker] Qt < 5.9 compatibility fix 2017-10-23 17:25:08 +02:00
Sandro Mani
15b5da8fea [Geometry checker] Fix incorrect change parametrization in QgsGeometryCheck::replaceFeatureGeometryPart 2017-10-23 17:25:08 +02:00
Sandro Mani
084660a47f [Geometry checker] More change tracking tests 2017-10-23 17:25:08 +02:00
Sandro Mani
876418c44e [Geometry checker] Add more fixError tests 2017-10-23 17:25:08 +02:00
Sandro Mani
4a6cdbe36b [Geometry checker] Add a first series of fixError tests 2017-10-23 17:25:08 +02:00
Sandro Mani
0ffd00da98 [Geometry checker] Add TestQgsGeometryChecks::createTestContext variant which copies the testdata to a temporary dir 2017-10-23 17:25:08 +02:00
Sandro Mani
d71f62c711 [Geometry checker] Make TestQgsGeometryChecks::searchCheckErrors return the list of matching errors instead of just the number of matches 2017-10-23 17:25:08 +02:00
Sandro Mani
1372536297 [Geometry checker] Add follow boundaries check 2017-10-23 17:25:08 +02:00
Sandro Mani
c44fa1da5c [Geometry checker] Finish gap check test 2017-10-23 17:25:08 +02:00
Sandro Mani
6b3309cd45 [Geometry checker] Add more tests 2017-10-23 17:25:08 +02:00
Sandro Mani
07dc429573 [Geometry checker] Some initial tests 2017-10-23 17:25:07 +02:00