Skip to content
Permalink
Browse files

Merge pull request #6853 from wonder-sk/overlay-alg-fixes-2

Port Difference & Sym.Diff. to C++, cleanups and tests
  • Loading branch information
wonder-sk committed Apr 25, 2018
2 parents b64a958 + 57e5b9f commit d0130d25b29fda79a98616bae7f722d480851783
Showing with 863 additions and 296 deletions.
  1. +0 −9 python/plugins/processing/algs/help/qgis.yaml
  2. +0 −121 python/plugins/processing/algs/qgis/Difference.py
  3. +0 −4 python/plugins/processing/algs/qgis/QgisAlgorithmProvider.py
  4. +0 −162 python/plugins/processing/algs/qgis/SymmetricalDifference.py
  5. +38 −0 python/plugins/processing/tests/testdata/expected/difference1_a_b.gml
  6. +30 −0 python/plugins/processing/tests/testdata/expected/difference1_a_b.xsd
  7. +38 −0 python/plugins/processing/tests/testdata/expected/difference1_b_a.gml
  8. +30 −0 python/plugins/processing/tests/testdata/expected/difference1_b_a.xsd
  9. +70 −0 python/plugins/processing/tests/testdata/expected/symmetrical_difference1_a_b.gml
  10. +37 −0 python/plugins/processing/tests/testdata/expected/symmetrical_difference1_a_b.xsd
  11. +70 −0 python/plugins/processing/tests/testdata/expected/symmetrical_difference1_b_a.gml
  12. +37 −0 python/plugins/processing/tests/testdata/expected/symmetrical_difference1_b_a.xsd
  13. +70 −0 python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
  14. +3 −0 src/analysis/CMakeLists.txt
  15. +88 −0 src/analysis/processing/qgsalgorithmdifference.cpp
  16. +45 −0 src/analysis/processing/qgsalgorithmdifference.h
  17. +90 −0 src/analysis/processing/qgsalgorithmsymmetricaldifference.cpp
  18. +45 −0 src/analysis/processing/qgsalgorithmsymmetricaldifference.h
  19. +4 −0 src/analysis/processing/qgsnativealgorithms.cpp
  20. +123 −0 src/analysis/processing/qgsoverlayutils.cpp
  21. +45 −0 src/analysis/processing/qgsoverlayutils.h
@@ -135,11 +135,6 @@ qgis:densifygeometriesgivenaninterval: >

The distance is expressed in the same units used by the layer CRS.

qgis:difference: >
This algorithm extracts features from the Input layer that fall outside, or partially overlap, features in the Difference layer. Input layer features that partially overlap the difference layer feature(s) are split along the boundary of the difference layer feature(s) and only the portions outside the difference layer features are retained.

Attributes are not modified.

qgis:dissolve: >
This algorithm takes a polygon or line vector layer and combines their geometries into new geometries. One or more attributes can be specified to dissolve only geometries belonging to the same class (having the same value for the specified attributes), alternatively all geometries can be dissolved.

@@ -511,10 +506,6 @@ qgis:sumlinelengths: >

The resulting layer has the same features as the input polygon layer, but with two additional attributes containing the length and count of the lines across each polygon. The names of these two fields can be configured in the algorithm parameters.

qgis:symmetricaldifference: >
This algorithm creates a layer containing features from both the Input and Difference layers but with the overlapping areas between the two layers removed. The attribute table of the Symmetrical Difference layer contains attributes from both the Input and Difference layers.


qgis:texttofloat: >
This algorithm modifies the type of a given attribute in a vector layer, converting a text attribute containing numeric strings into a numeric attribute.

This file was deleted.

@@ -57,7 +57,6 @@
from .DeleteDuplicateGeometries import DeleteDuplicateGeometries
from .DensifyGeometries import DensifyGeometries
from .DensifyGeometriesInterval import DensifyGeometriesInterval
from .Difference import Difference
from .EliminateSelection import EliminateSelection
from .ExecuteSQL import ExecuteSQL
from .ExportGeometryInfo import ExportGeometryInfo
@@ -134,7 +133,6 @@
from .SpatialJoinSummary import SpatialJoinSummary
from .StatisticsByCategories import StatisticsByCategories
from .SumLines import SumLines
from .SymmetricalDifference import SymmetricalDifference
from .TextToFloat import TextToFloat
from .TinInterpolation import TinInterpolation
from .TopoColors import TopoColor
@@ -175,7 +173,6 @@ def getAlgs(self):
DeleteDuplicateGeometries(),
DensifyGeometries(),
DensifyGeometriesInterval(),
Difference(),
EliminateSelection(),
ExecuteSQL(),
ExportGeometryInfo(),
@@ -252,7 +249,6 @@ def getAlgs(self):
SpatialJoinSummary(),
StatisticsByCategories(),
SumLines(),
SymmetricalDifference(),
TextToFloat(),
TinInterpolation(),
TopoColor(),

This file was deleted.

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ difference1_a_b.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>1</gml:X><gml:Y>3</gml:Y></gml:coord>
<gml:coord><gml:X>9</gml:X><gml:Y>11</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:difference1_a_b fid="difference1_a_b.0">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3857"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,5 2,3 1,3 1,5 2,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1,6 1,11 8,11 8,10 2,10 2,6 1,6</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:id_a>A1</ogr:id_a>
</ogr:difference1_a_b>
</gml:featureMember>
<gml:featureMember>
<ogr:difference1_a_b fid="difference1_a_b.1">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3857"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,3 3,4 4,4 4,3 3,3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:id_a>A4</ogr:id_a>
</ogr:difference1_a_b>
</gml:featureMember>
<gml:featureMember>
<ogr:difference1_a_b fid="difference1_a_b.2">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3857"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4,6 6,6 6,5 4,5 4,6</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:id_a>A2</ogr:id_a>
</ogr:difference1_a_b>
</gml:featureMember>
<gml:featureMember>
<ogr:difference1_a_b fid="difference1_a_b.3">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:3857"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>7,7 6,7 6,8 7,8 7,7</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8,8 9,8 9,7 8,7 8,8</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:id_a>A3</ogr:id_a>
</ogr:difference1_a_b>
</gml:featureMember>
</ogr:FeatureCollection>

0 comments on commit d0130d2

Please sign in to comment.
You can’t perform that action at this time.