Skip to content

Commit

Permalink
Remove obsolete python alg, add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 6, 2017
1 parent 3c4fb26 commit ca75e8c
Show file tree
Hide file tree
Showing 9 changed files with 654 additions and 159 deletions.
157 changes: 0 additions & 157 deletions python/plugins/processing/algs/qgis/Merge.py

This file was deleted.

2 changes: 0 additions & 2 deletions python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
from .ImportIntoSpatialite import ImportIntoSpatialite
from .Intersection import Intersection
from .LinesToPolygons import LinesToPolygons
from .Merge import Merge
from .MinimumBoundingGeometry import MinimumBoundingGeometry
from .NearestNeighbourAnalysis import NearestNeighbourAnalysis
from .OffsetLine import OffsetLine
Expand Down Expand Up @@ -208,7 +207,6 @@ def getAlgs(self):
ImportIntoSpatialite(),
Intersection(),
LinesToPolygons(),
Merge(),
MinimumBoundingGeometry(),
NearestNeighbourAnalysis(),
OffsetLine(),
Expand Down
176 changes: 176 additions & 0 deletions python/plugins/processing/tests/testdata/expected/merged_points.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ merged_points.xsd"
xmlns:ogr="http://ogr.maptools.org/"
xmlns:gml="http://www.opengis.net/gml">
<gml:boundedBy>
<gml:Box>
<gml:coord><gml:X>0</gml:X><gml:Y>-5</gml:Y><gml:Z>0</gml:Z></gml:coord>
<gml:coord><gml:X>8</gml:X><gml:Y>3</gml:Y><gml:Z>5</gml:Z></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:merged_points fid="points.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>1</ogr:id>
<ogr:id2>2</ogr:id2>
<ogr:layer>custom/points.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3,3,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>2</ogr:id>
<ogr:id2>1</ogr:id2>
<ogr:layer>custom/points.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2,2,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>3</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/points.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5,2,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>4</ogr:id>
<ogr:id2>2</ogr:id2>
<ogr:layer>custom/points.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,1,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>5</ogr:id>
<ogr:id2>1</ogr:id2>
<ogr:layer>custom/points.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-5,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>6</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/points.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.6">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8,-1,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>7</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/points.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.7">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7,-1,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>8</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/points.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.8">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-1,0</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>9</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/points.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/points.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>1</ogr:id>
<ogr:id2>2</ogr:id2>
<ogr:layer>custom/pointszm.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/pointszm.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3,3,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>2</ogr:id>
<ogr:id2>1</ogr:id2>
<ogr:layer>custom/pointszm.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/pointszm.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2,2,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>3</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/pointszm.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/pointszm.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5,2,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>4</ogr:id>
<ogr:id2>2</ogr:id2>
<ogr:layer>custom/pointszm.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/pointszm.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.4">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,1,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>5</ogr:id>
<ogr:id2>1</ogr:id2>
<ogr:layer>custom/pointszm.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/pointszm.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.5">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-5,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>6</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/pointszm.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/pointszm.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.6">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8,-1,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>7</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/pointszm.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/pointszm.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.7">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7,-1,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>8</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/pointszm.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/pointszm.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
<gml:featureMember>
<ogr:merged_points fid="points.8">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-1,5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:id>9</ogr:id>
<ogr:id2>0</ogr:id2>
<ogr:layer>custom/pointszm.shp</ogr:layer>
<ogr:path>/home/nyall/dev/QGIS/python/plugins/processing/tests/testdata/custom/pointszm.shp</ogr:path>
</ogr:merged_points>
</gml:featureMember>
</ogr:FeatureCollection>
Loading

0 comments on commit ca75e8c

Please sign in to comment.