Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE][processing] Snap Geometries algorithm can now snap
within the same layer Allows closure of gaps within a layer
- Loading branch information
1 parent
ece3991
commit 92249c1
Showing
7 changed files
with
148 additions
and
14 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/custom/snap_internal.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>snap_internal</Name> | ||
<ElementPath>snap_internal</ElementPath> | ||
<!--LINESTRING--> | ||
<GeometryType>2</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>4</FeatureCount> | ||
<ExtentXMin>-1.00000</ExtentXMin> | ||
<ExtentXMax>8.50000</ExtentXMax> | ||
<ExtentYMin>-1.00000</ExtentYMin> | ||
<ExtentYMax>4.50000</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
34 changes: 34 additions & 0 deletions
34
python/plugins/processing/tests/testdata/custom/snap_internal.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,34 @@ | ||
<?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>-1</gml:Y></gml:coord> | ||
<gml:coord><gml:X>8.5</gml:X><gml:Y>4.5</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:snap_internal fid="snap_internal.0"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1,-1 -1,3 3,3 4.1,4.5 7.9,4.5</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:snap_internal> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_internal fid="snap_internal.1"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-0.5,-1.0 3.3,-1.0 3.3,2.8</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:snap_internal> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_internal fid="snap_internal.2"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>8.4,1.5 8.5,-0.9 5.8,-0.9</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:snap_internal> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_internal fid="snap_internal.3"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>3.5,3.0 8.4,3.0 8.4,1.6</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:snap_internal> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
16 changes: 16 additions & 0 deletions
16
python/plugins/processing/tests/testdata/expected/snap_internal.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>snap_internal</Name> | ||
<ElementPath>snap_internal</ElementPath> | ||
<!--LINESTRING--> | ||
<GeometryType>2</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>4</FeatureCount> | ||
<ExtentXMin>-1.00000</ExtentXMin> | ||
<ExtentXMax>8.50000</ExtentXMax> | ||
<ExtentYMin>-1.00000</ExtentYMin> | ||
<ExtentYMax>4.50000</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
34 changes: 34 additions & 0 deletions
34
python/plugins/processing/tests/testdata/expected/snap_internal.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,34 @@ | ||
<?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>-1</gml:Y></gml:coord> | ||
<gml:coord><gml:X>8.5</gml:X><gml:Y>4.5</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:snap_internal fid="snap_internal.0"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1,-1 -1,3 3,3 4.1,4.5 7.9,4.5</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:snap_internal> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_internal fid="snap_internal.1"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1,-1 3.3,-1.0 3,3</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:snap_internal> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_internal fid="snap_internal.2"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>8.4,1.5 8.5,-0.9 5.8,-0.9</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:snap_internal> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_internal fid="snap_internal.3"> | ||
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>3,3 8.4,3.0 8.4,1.5</gml:coordinates></gml:LineString></ogr:geometryProperty> | ||
</ogr:snap_internal> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
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