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 allows snapping
- Loading branch information
1 parent
c3a978b
commit dae0a01
Showing
9 changed files
with
589 additions
and
15 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
16 changes: 16 additions & 0 deletions
16
python/plugins/processing/tests/testdata/expected/snap_points_to_points.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_points_to_points</Name> | ||
<ElementPath>snap_points_to_points</ElementPath> | ||
<!--POINT--> | ||
<GeometryType>1</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>9</FeatureCount> | ||
<ExtentXMin>0.20114</ExtentXMin> | ||
<ExtentXMax>7.97127</ExtentXMax> | ||
<ExtentYMin>-4.82759</ExtentYMin> | ||
<ExtentYMax>2.74139</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
59 changes: 59 additions & 0 deletions
59
python/plugins/processing/tests/testdata/expected/snap_points_to_points.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,59 @@ | ||
<?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>0</gml:X><gml:Y>-5</gml:Y></gml:coord> | ||
<gml:coord><gml:X>7.971265678449257</gml:X><gml:Y>3</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:snap_points_to_points fid="points.0"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points_to_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points_to_points fid="points.1"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3,3</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points_to_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points_to_points fid="points.2"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2,2</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points_to_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points_to_points fid="points.3"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5,2</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points_to_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points_to_points fid="points.4"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,1</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points_to_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points_to_points fid="points.5"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-5</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points_to_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points_to_points fid="points.6"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7.971265678449257,0.609122006841505</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points_to_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points_to_points fid="points.7"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7,-1</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points_to_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points_to_points fid="points.8"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-1</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points_to_points> | ||
</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
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_points</Name> | ||
<ElementPath>snap_points</ElementPath> | ||
<!--POINT--> | ||
<GeometryType>1</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>9</FeatureCount> | ||
<ExtentXMin>0.20114</ExtentXMin> | ||
<ExtentXMax>7.97127</ExtentXMax> | ||
<ExtentYMin>-4.82759</ExtentYMin> | ||
<ExtentYMax>2.74139</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
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,59 @@ | ||
<?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>0.2011402508551881</gml:X><gml:Y>-4.827594070695552</gml:Y></gml:coord> | ||
<gml:coord><gml:X>7.971265678449257</gml:X><gml:Y>2.74139110604333</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:snap_points fid="points.0"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points fid="points.1"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3.134093500570125,2.74139110604333</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points fid="points.2"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2,2</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points fid="points.3"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5.25860889395667,1.578563283922463</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points fid="points.4"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3.683922462941847,0.961687571265678</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points fid="points.5"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0.201140250855188,-4.827594070695552</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points fid="points.6"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7.971265678449257,0.609122006841505</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points fid="points.7"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7.181984036488029,-1.268187001140251</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:snap_points fid="points.8"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0.220296465222349,-1.210718358038768</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
</ogr:snap_points> | ||
</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
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
Oops, something went wrong.