Skip to content

Commit

Permalink
[processing] Test densify with multipolygons
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent f0629ea commit 163894d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 59 deletions.
6 changes: 3 additions & 3 deletions python/plugins/processing/tests/testdata/algorithm_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ tests:
- name: Densify geometries
algorithm: qgis:densifygeometries
params:
- name: expected/polys_densify.gml
- name: multipolys.geojson
type: vector
- 4
- '4'
results:
OUTPUT:
name: expected/polys_densify.gml
name: expected/multipolys_densify.gml
type: vector

- name: Polygons to Lines
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<ogr:FeatureCollection
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ogr.maptools.org/ multipolys_densify.xsd"
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>-1</gml:Y></gml:coord>
<gml:coord><gml:X>9</gml:X><gml:Y>6</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:multipolys_densify fid="multipolys_densify.0">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,1 2.0,1.2 2.0,1.4 2.0,1.6 2.0,1.8 2,2 2.2,2.0 2.4,2.0 2.6,2.0 2.8,2.0 3,2 3.0,2.2 3.0,2.4 3.0,2.6 3.0,2.8 3,3 3.2,3.0 3.4,3.0 3.6,3.0 3.8,3.0 4,3 4.0,2.6 4.0,2.2 4.0,1.8 4.0,1.4 4,1 3.6,1.0 3.2,1.0 2.8,1.0 2.4,1.0 2,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:Bname>Test</ogr:Bname>
<ogr:Bintval>1</ogr:Bintval>
<ogr:Bfloatval>0.123</ogr:Bfloatval>
</ogr:multipolys_densify>
</gml:featureMember>
<gml:featureMember>
<ogr:multipolys_densify fid="multipolys_densify.1">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>7,-1 7.2,-1.0 7.4,-1.0 7.6,-1.0 7.8,-1.0 8,-1 8.0,-0.2 8.0,0.6 8.0,1.4 8.0,2.2 8,3 7.8,3.0 7.6,3.0 7.4,3.0 7.2,3.0 7,3 7.0,2.2 7.0,1.4 7.0,0.6 7.0,-0.2 7,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>7,6 7.0,5.8 7.0,5.6 7.0,5.4 7.0,5.2 7,5 7.0,4.8 7.0,4.6 7.0,4.4 7.0,4.2 7,4 7.2,4.0 7.4,4.0 7.6,4.0 7.8,4.0 8,4 8.2,4.2 8.4,4.4 8.6,4.6 8.8,4.8 9,5 9.0,5.2 9.0,5.4 9.0,5.6 9.0,5.8 9,6 8.6,6.0 8.2,6.0 7.8,6.0 7.4,6.0 7,6</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multipolys_densify>
</gml:featureMember>
<gml:featureMember>
<ogr:multipolys_densify fid="multipolys_densify.2">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,0 0.0,0.2 0.0,0.4 0.0,0.6 0.0,0.8 0,1 0.2,1.0 0.4,1.0 0.6,1.0 0.8,1.0 1,1 1.0,0.8 1.0,0.6 1.0,0.4 1.0,0.2 1,0 0.8,0.0 0.6,0.0 0.4,0.0 0.2,0.0 0,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
<ogr:Bname>Test</ogr:Bname>
<ogr:Bintval>2</ogr:Bintval>
<ogr:Bfloatval>-0.123</ogr:Bfloatval>
</ogr:multipolys_densify>
</gml:featureMember>
<gml:featureMember>
<ogr:multipolys_densify fid="multipolys_densify.3">
<ogr:Bname>Test</ogr:Bname>
<ogr:Bintval>3</ogr:Bintval>
<ogr:Bfloatval>0</ogr:Bfloatval>
</ogr:multipolys_densify>
</gml:featureMember>
</ogr:FeatureCollection>
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="polys_densify" type="ogr:polys_densify_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="polys_densify_Type">
<xs:element name="multipolys_densify" type="ogr:multipolys_densify_Type" substitutionGroup="gml:_Feature"/>
<xs:complexType name="multipolys_densify_Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="geometryProperty" type="gml:PolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="name" nillable="true" minOccurs="0" maxOccurs="1">
<xs:element name="geometryProperty" type="gml:MultiPolygonPropertyType" nillable="true" minOccurs="0" maxOccurs="1"/>
<xs:element name="Bname" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="intval" nillable="true" minOccurs="0" maxOccurs="1">
<xs:element name="Bintval" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="floatval" nillable="true" minOccurs="0" maxOccurs="1">
<xs:element name="Bfloatval" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:decimal">
</xs:restriction>
Expand Down

This file was deleted.

0 comments on commit 163894d

Please sign in to comment.