-
-
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.
Port Points Displacement algorithm to new API
Rework algorithm to use same approach as points displacement renderer. Also maintain Z/M values, and add tests and docs.
- Loading branch information
1 parent
69c991e
commit c8ac784
Showing
9 changed files
with
245 additions
and
49 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
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
26 changes: 26 additions & 0 deletions
26
python/plugins/processing/tests/testdata/custom/displace_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,26 @@ | ||
<GMLFeatureClassList> | ||
<GMLFeatureClass> | ||
<Name>displace_points</Name> | ||
<ElementPath>displace_points</ElementPath> | ||
<!--POINT--> | ||
<GeometryType>1</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>4</FeatureCount> | ||
<ExtentXMin>1.00000</ExtentXMin> | ||
<ExtentXMax>4.00000</ExtentXMax> | ||
<ExtentYMin>1.00000</ExtentYMin> | ||
<ExtentYMax>1.00000</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
<PropertyDefn> | ||
<Name>id</Name> | ||
<ElementPath>id</ElementPath> | ||
<Type>Integer</Type> | ||
</PropertyDefn> | ||
<PropertyDefn> | ||
<Name>id2</Name> | ||
<ElementPath>id2</ElementPath> | ||
<Type>Integer</Type> | ||
</PropertyDefn> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
41 changes: 41 additions & 0 deletions
41
python/plugins/processing/tests/testdata/custom/displace_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,41 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://ogr.maptools.org/ displace_points.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>1</gml:Y></gml:coord> | ||
<gml:coord><gml:X>4</gml:X><gml:Y>1</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:displace_points fid="points.4"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,1</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:id>5</ogr:id> | ||
<ogr:id2>1</ogr:id2> | ||
</ogr:displace_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:displace_points fid="points.3"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,1</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:id>4</ogr:id> | ||
<ogr:id2>2</ogr:id2> | ||
</ogr:displace_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:displace_points fid="points.0"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:id>1</ogr:id> | ||
<ogr:id2>2</ogr:id2> | ||
</ogr:displace_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:displace_points fid="points.1"> | ||
<ogr:id>2</ogr:id> | ||
<ogr:id2>1</ogr:id2> | ||
</ogr:displace_points> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
26 changes: 26 additions & 0 deletions
26
python/plugins/processing/tests/testdata/expected/displaced_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,26 @@ | ||
<GMLFeatureClassList> | ||
<GMLFeatureClass> | ||
<Name>displaced_points</Name> | ||
<ElementPath>displaced_points</ElementPath> | ||
<!--POINT--> | ||
<GeometryType>1</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>3</FeatureCount> | ||
<ExtentXMin>1.00000</ExtentXMin> | ||
<ExtentXMax>4.86603</ExtentXMax> | ||
<ExtentYMin>0.50000</ExtentYMin> | ||
<ExtentYMax>2.00000</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
<PropertyDefn> | ||
<Name>id</Name> | ||
<ElementPath>id</ElementPath> | ||
<Type>Integer</Type> | ||
</PropertyDefn> | ||
<PropertyDefn> | ||
<Name>id2</Name> | ||
<ElementPath>id2</ElementPath> | ||
<Type>Integer</Type> | ||
</PropertyDefn> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
35 changes: 35 additions & 0 deletions
35
python/plugins/processing/tests/testdata/expected/displaced_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,35 @@ | ||
<?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>0</gml:Y></gml:coord> | ||
<gml:coord><gml:X>4</gml:X><gml:Y>2</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:displaced_points fid="points.4"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,2</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:id>5</ogr:id> | ||
<ogr:id2>1</ogr:id2> | ||
</ogr:displaced_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:displaced_points fid="points.3"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>4,0</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:id>4</ogr:id> | ||
<ogr:id2>2</ogr:id2> | ||
</ogr:displaced_points> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:displaced_points fid="points.0"> | ||
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1</gml:coordinates></gml:Point></ogr:geometryProperty> | ||
<ogr:id>1</ogr:id> | ||
<ogr:id2>2</ogr:id2> | ||
</ogr:displaced_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
Oops, something went wrong.