-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[processing] Add test for dissolve using field values
(cherry-picked from ccfd4c3)
- Loading branch information
1 parent
d9a1ce8
commit ebc4a74
Showing
4 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
python/plugins/processing/tests/testdata/dissolve_polys.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,31 @@ | ||
<GMLFeatureClassList> | ||
<GMLFeatureClass> | ||
<Name>dissolve_polys</Name> | ||
<ElementPath>dissolve_polys</ElementPath> | ||
<GeometryType>3</GeometryType> | ||
<SRSName>EPSG:4326</SRSName> | ||
<DatasetSpecificInfo> | ||
<FeatureCount>10</FeatureCount> | ||
<ExtentXMin>-1.00000</ExtentXMin> | ||
<ExtentXMax>9.16296</ExtentXMax> | ||
<ExtentYMin>-3.00000</ExtentYMin> | ||
<ExtentYMax>6.08868</ExtentYMax> | ||
</DatasetSpecificInfo> | ||
<PropertyDefn> | ||
<Name>name</Name> | ||
<ElementPath>name</ElementPath> | ||
<Type>String</Type> | ||
<Width>2</Width> | ||
</PropertyDefn> | ||
<PropertyDefn> | ||
<Name>intval</Name> | ||
<ElementPath>intval</ElementPath> | ||
<Type>Integer</Type> | ||
</PropertyDefn> | ||
<PropertyDefn> | ||
<Name>floatval</Name> | ||
<ElementPath>floatval</ElementPath> | ||
<Type>Real</Type> | ||
</PropertyDefn> | ||
</GMLFeatureClass> | ||
</GMLFeatureClassList> |
87 changes: 87 additions & 0 deletions
87
python/plugins/processing/tests/testdata/dissolve_polys.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,87 @@ | ||
<?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>9.162955854126682</gml:X><gml:Y>6.088675623800385</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.0"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 -1,3 3,3 3,2 2,2 2,-1 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>aa</ogr:name> | ||
<ogr:intval>1</ogr:intval> | ||
<ogr:floatval>44.123455999999997</ogr:floatval> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.1"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.241458733205375,-0.054510556621882 7.241458733205375,-1.054510556621882 5.241458733205375,-1.054510556621882 6.241458733205375,-0.054510556621882</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>dd</ogr:name> | ||
<ogr:floatval>0.000000000000000</ogr:floatval> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.2"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,5 2,6 3,6 3,5 2,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>bb</ogr:name> | ||
<ogr:intval>1</ogr:intval> | ||
<ogr:floatval>0.123000000000000</ogr:floatval> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.3"> | ||
<ogr:intval>120</ogr:intval> | ||
<ogr:floatval>-100291.432130000001052</ogr:floatval> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.4"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 2,2 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>aa</ogr:name> | ||
<ogr:intval>1</ogr:intval> | ||
<ogr:floatval>3.330000000000000</ogr:floatval> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.5"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.443378119001919,4.423608445297505 2.443378119001919,5.423608445297505 3.443378119001919,5.423608445297505 3.443378119001919,4.423608445297505 2.443378119001919,4.423608445297505</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>bb</ogr:name> | ||
<ogr:intval>1</ogr:intval> | ||
<ogr:floatval>0.123000000000000</ogr:floatval> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.6"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.172552783109405,4.822648752399233 4.172552783109405,5.822648752399233 5.172552783109405,5.822648752399233 5.172552783109405,4.822648752399233 4.172552783109405,4.822648752399233</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>bb</ogr:name> | ||
<ogr:intval>1</ogr:intval> | ||
<ogr:floatval>0.123000000000000</ogr:floatval> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.7"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8.162955854126682,2.738771593090211 8.162955854126682,3.738771593090211 9.162955854126682,3.738771593090211 9.162955854126682,2.738771593090211 8.162955854126682,2.738771593090211</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>cc</ogr:name> | ||
<ogr:floatval>0.123000000000000</ogr:floatval> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.9"> | ||
<ogr:name>dd</ogr:name> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_polys fid="polys.8"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.620729366602688,5.088675623800385 2.620729366602688,6.088675623800385 3.620729366602688,6.088675623800385 3.620729366602688,5.088675623800385 2.620729366602688,5.088675623800385</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>bb</ogr:name> | ||
<ogr:intval>2</ogr:intval> | ||
<ogr:floatval>0.123000000000000</ogr:floatval> | ||
</ogr:dissolve_polys> | ||
</gml:featureMember> | ||
</ogr:FeatureCollection> |
50 changes: 50 additions & 0 deletions
50
python/plugins/processing/tests/testdata/expected/dissolve_field.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,50 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ogr:FeatureCollection | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://ogr.maptools.org/ dissolve_field.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>-3</gml:Y></gml:coord> | ||
<gml:coord><gml:X>9.162955854126682</gml:X><gml:Y>6.088675623800385</gml:Y></gml:coord> | ||
</gml:Box> | ||
</gml:boundedBy> | ||
|
||
<gml:featureMember> | ||
<ogr:dissolve_field fid="polys.0"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>3,2 6,1 6,-3 2,-1 -1,-1 -1,3 3,3 3,2</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>aa</ogr:name> | ||
<ogr:intval>1</ogr:intval> | ||
<ogr:floatval>44.123456</ogr:floatval> | ||
</ogr:dissolve_field> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_field fid="polys.7"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>8.162955854126682,2.738771593090211 8.162955854126682,3.738771593090211 9.162955854126682,3.738771593090211 9.162955854126682,2.738771593090211 8.162955854126682,2.738771593090211</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>cc</ogr:name> | ||
<ogr:floatval>0.123</ogr:floatval> | ||
</ogr:dissolve_field> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_field fid="polys.1"> | ||
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6.241458733205375,-0.054510556621882 7.241458733205375,-1.054510556621882 5.241458733205375,-1.054510556621882 6.241458733205375,-0.054510556621882</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty> | ||
<ogr:name>dd</ogr:name> | ||
<ogr:floatval>0</ogr:floatval> | ||
</ogr:dissolve_field> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_field fid="polys.3"> | ||
<ogr:intval>120</ogr:intval> | ||
<ogr:floatval>-100291.43213</ogr:floatval> | ||
</ogr:dissolve_field> | ||
</gml:featureMember> | ||
<gml:featureMember> | ||
<ogr:dissolve_field fid="polys.2"> | ||
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>4.172552783109405,4.822648752399233 4.172552783109405,5.822648752399233 5.172552783109405,5.822648752399233 5.172552783109405,4.822648752399233 4.172552783109405,4.822648752399233</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2.443378119001919,4.423608445297505 2.443378119001919,5.0 2,5 2,6 2.620729366602688,6.0 2.620729366602688,6.088675623800385 3.620729366602688,6.088675623800385 3.620729366602688,5.088675623800385 3.443378119001919,5.088675623800385 3.443378119001919,4.423608445297505 2.443378119001919,4.423608445297505</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty> | ||
<ogr:name>bb</ogr:name> | ||
<ogr:intval>1</ogr:intval> | ||
<ogr:floatval>0.123</ogr:floatval> | ||
</ogr:dissolve_field> | ||
</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