-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small tweaks to processing split algorithm, add tests
- Loading branch information
1 parent
0e2ef06
commit 38a0ea0
Showing
9 changed files
with
222 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
python/plugins/processing/tests/testdata/expected/split_lines_with_lines.gfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<GMLFeatureClassList> | ||
<GMLFeatureClass> | ||
<Name>split_lines_with_lines</Name> | ||
<ElementPath>split_lines_with_lines</ElementPath> | ||
<!--LINESTRING--> | ||
<GeometryType>2</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>11</FeatureCount> | ||
<ExtentXMin>-1.00000</ExtentXMin> | ||
<ExtentXMax>11.00000</ExtentXMax> | ||
<ExtentYMin>-3.00000</ExtentYMin> | ||
<ExtentYMax>5.00000</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
68 changes: 68 additions & 0 deletions
68
python/plugins/processing/tests/testdata/expected/split_lines_with_lines.gml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="" | ||
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>11</gml:X><gml:Y>5</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.0"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,2 9,2 9,3 11,5</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.1"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1,-1 1,-1</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.2"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2.0,1.86331771490359 2,2 3,2 3,3</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.2"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2,0 2.0,1.86331771490359</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.3"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>4.21601489757914,1.0 5,1</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.3"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>3,1 4.21601489757914,1.0</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.4"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>8.5655671605538,-3.0 10,-3</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.4"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,-3 8.5655671605538,-3.0</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.5"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6.91202704418487,-2.08797295581513 10,1</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.5"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,-3 6.91202704418487,-2.08797295581513</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines fid="lines.6"> | ||
</ogr:split_lines_with_lines> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
16 changes: 16 additions & 0 deletions
16
python/plugins/processing/tests/testdata/expected/split_lines_with_lines_same.gfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<GMLFeatureClassList> | ||
<GMLFeatureClass> | ||
<Name>split_lines_with_lines_same</Name> | ||
<ElementPath>split_lines_with_lines_same</ElementPath> | ||
<!--LINESTRING--> | ||
<GeometryType>2</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>7</FeatureCount> | ||
<ExtentXMin>-1.00000</ExtentXMin> | ||
<ExtentXMax>11.00000</ExtentXMax> | ||
<ExtentYMin>-3.00000</ExtentYMin> | ||
<ExtentYMax>5.00000</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
48 changes: 48 additions & 0 deletions
48
python/plugins/processing/tests/testdata/expected/split_lines_with_lines_same.gml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="" | ||
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>11</gml:X><gml:Y>5</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:split_lines_with_lines_same fid="lines.0"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,2 9,2 9,3 11,5</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines_same> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines_same fid="lines.1"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1,-1 1,-1</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines_same> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines_same fid="lines.2"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2,0 2,2 3,2 3,3</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines_same> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines_same fid="lines.3"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>3,1 5,1</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines_same> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines_same fid="lines.4"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,-3 10,-3</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines_same> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines_same fid="lines.5"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,-3 10,1</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:split_lines_with_lines_same> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:split_lines_with_lines_same fid="lines.6"> | ||
</ogr:split_lines_with_lines_same> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
12 changes: 3 additions & 9 deletions
12
...tdata/expected/polys_split_with_lines.gfs → ...tdata/expected/split_polys_with_lines.gfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters