Skip to content

Commit

Permalink
Completely switch over to gml for processing test data
Browse files Browse the repository at this point in the history
The different gdal versions have issues with geojson wrt null attribute types
  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent 1640906 commit 9ad69ad
Show file tree
Hide file tree
Showing 23 changed files with 319 additions and 91 deletions.
12 changes: 6 additions & 6 deletions python/plugins/processing/tests/testdata/algorithm_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tests:
algorithm: qgis:polygoncentroids # Algorithm name
params: # A list of parameters (only 1 here)
- type: vector # Param is a vector layer
name: polys.geojson # file name
name: polys.gml # file name
results: # A map of results (only one here)
OUTPUT_LAYER:
type: vector # Expected result is a vector layer
Expand All @@ -17,7 +17,7 @@ tests:
- name: Delete Holes
algorithm: qgis:deleteholes
params:
- name: polys.geojson
- name: polys.gml
type: vector
results:
OUTPUT:
Expand All @@ -33,10 +33,10 @@ tests:
algorithm: qgis:intersection
params:
INPUT:
name: multipolys.geojson
name: multipolys.gml
type: vector
INPUT2:
name: polys.geojson
name: polys.gml
type: vector
results:
OUTPUT:
Expand All @@ -46,7 +46,7 @@ tests:
- name: Densify geometries
algorithm: qgis:densifygeometries
params:
- name: multipolys.geojson
- name: multipolys.gml
type: vector
- '4'
results:
Expand All @@ -57,7 +57,7 @@ tests:
- name: Polygons to Lines
algorithm: qgis:polygonstolines
params:
- name: multipolys.geojson
- name: multipolys.gml
type: vector
results:
OUTPUT:
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@
</gml:boundedBy>

<gml:featureMember>
<ogr:multipolys_densify fid="multipolys_densify.0">
<ogr:multipolys_densify fid="multipolys.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:multipolys_densify fid="multipolys.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:multipolys_densify fid="multipolys.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:multipolys_densify fid="multipolys.3">
<ogr:Bname>Test</ogr:Bname>
<ogr:Bintval>3</ogr:Bintval>
<ogr:Bfloatval>0</ogr:Bfloatval>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<xs:element name="Bname" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255"/>
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,37 @@
</gml:boundedBy>

<gml:featureMember>
<ogr:polys_centroid fid="polys_centroid.0">
<ogr:polys_centroid fid="polys.0">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0.653846153846154,1.11538461538462</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:name>aaaaa</ogr:name>
<ogr:intval>33</ogr:intval>
<ogr:floatval>44.123456</ogr:floatval>
</ogr:polys_centroid>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_centroid fid="polys_centroid.1">
<ogr:polys_centroid fid="polys.1">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5.0,4.33333333333333</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:name>Aaaaa</ogr:name>
<ogr:intval>-33</ogr:intval>
<ogr:floatval>0</ogr:floatval>
</ogr:polys_centroid>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_centroid fid="polys_centroid.2">
<ogr:polys_centroid fid="polys.2">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2.5,5.5</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:name>bbaaa</ogr:name>
<ogr:floatval>0.123</ogr:floatval>
</ogr:polys_centroid>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_centroid fid="polys_centroid.3">
<ogr:polys_centroid fid="polys.3">
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>8,-1</gml:coordinates></gml:Point></ogr:geometryProperty>
<ogr:name>ASDF</ogr:name>
<ogr:intval>0</ogr:intval>
</ogr:polys_centroid>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_centroid fid="polys_centroid.4">
<ogr:polys_centroid fid="polys.4">
<ogr:intval>120</ogr:intval>
<ogr:floatval>-100291.43213</ogr:floatval>
</ogr:polys_centroid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<xs:element name="name" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255"/>
<xs:maxLength value="5"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,37 @@
</gml:boundedBy>

<gml:featureMember>
<ogr:polys_deleteholes fid="polys_deleteholes.0">
<ogr:polys_deleteholes fid="polys.0">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-1 2,-1 2,2 3,2 3,3 -1,3 -1,-1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:name>aaaaa</ogr:name>
<ogr:intval>33</ogr:intval>
<ogr:floatval>44.123456</ogr:floatval>
</ogr:polys_deleteholes>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_deleteholes fid="polys_deleteholes.1">
<ogr:polys_deleteholes fid="polys.1">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,5 4,4 6,4 5,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:name>Aaaaa</ogr:name>
<ogr:intval>-33</ogr:intval>
<ogr:floatval>0</ogr:floatval>
</ogr:polys_deleteholes>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_deleteholes fid="polys_deleteholes.2">
<ogr:polys_deleteholes 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>bbaaa</ogr:name>
<ogr:floatval>0.123</ogr:floatval>
</ogr:polys_deleteholes>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_deleteholes fid="polys_deleteholes.3">
<ogr:polys_deleteholes fid="polys.3">
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>6,1 10,1 10,-3 6,-3 6,1</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
<ogr:name>ASDF</ogr:name>
<ogr:intval>0</ogr:intval>
</ogr:polys_deleteholes>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_deleteholes fid="polys_deleteholes.4">
<ogr:polys_deleteholes fid="polys.4">
<ogr:intval>120</ogr:intval>
<ogr:floatval>-100291.43213</ogr:floatval>
</ogr:polys_deleteholes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<xs:element name="name" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255"/>
<xs:maxLength value="5"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
</gml:boundedBy>

<gml:featureMember>
<ogr:polys_to_lines fid="polys_to_lines.0">
<ogr:polys_to_lines fid="multipolys.0">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2,1 2,2 3,2 3,3 4,3 4,1 2,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:Bname>Test</ogr:Bname>
<ogr:Bintval>1</ogr:Bintval>
<ogr:Bfloatval>0.123</ogr:Bfloatval>
</ogr:polys_to_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_to_lines fid="polys_to_lines.1">
<ogr:polys_to_lines fid="multipolys.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,-1 8,-1 8,3 7,3 7,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:polys_to_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_to_lines fid="polys_to_lines.2">
<ogr:polys_to_lines fid="multipolys.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,6 7,5 7,4 8,4 9,5 9,6 7,6</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:polys_to_lines>
</gml:featureMember>
<gml:featureMember>
<ogr:polys_to_lines fid="polys_to_lines.3">
<ogr:polys_to_lines fid="multipolys.2">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>0,0 0,1 1,1 1,0 0,0</gml:coordinates></gml:LineString></ogr:geometryProperty>
<ogr:Bname>Test</ogr:Bname>
<ogr:Bintval>2</ogr:Bintval>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<xs:element name="Bname" nillable="true" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255"/>
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Expand Down
11 changes: 0 additions & 11 deletions python/plugins/processing/tests/testdata/lines.geojson

This file was deleted.

16 changes: 16 additions & 0 deletions python/plugins/processing/tests/testdata/lines.gfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>lines</Name>
<ElementPath>lines</ElementPath>
<!--LINESTRING-->
<GeometryType>2</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>6</FeatureCount>
<ExtentXMin>-1.00000</ExtentXMin>
<ExtentXMax>11.00000</ExtentXMax>
<ExtentYMin>-3.00000</ExtentYMin>
<ExtentYMax>5.00000</ExtentYMax>
</DatasetSpecificInfo>
</GMLFeatureClass>
</GMLFeatureClassList>
44 changes: 44 additions & 0 deletions python/plugins/processing/tests/testdata/lines.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?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>11</gml:X><gml:Y>5</gml:Y></gml:coord>
</gml:Box>
</gml:boundedBy>

<gml:featureMember>
<ogr:lines fid="lines.0">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,2 9,2 9,3 11,5</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines fid="lines.1">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>-1,-1 1,-1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines fid="lines.2">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>2,0 2,2 3,2 3,3</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines fid="lines.3">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>3,1 5,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines fid="lines.4">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>7,-3 10,-3</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
<gml:featureMember>
<ogr:lines fid="lines.5">
<ogr:geometryProperty><gml:LineString srsName="EPSG:4326"><gml:coordinates>6,-3 10,1</gml:coordinates></gml:LineString></ogr:geometryProperty>
</ogr:lines>
</gml:featureMember>
</ogr:FeatureCollection>
10 changes: 0 additions & 10 deletions python/plugins/processing/tests/testdata/multipolys.geojson

This file was deleted.

32 changes: 32 additions & 0 deletions python/plugins/processing/tests/testdata/multipolys.gfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<GMLFeatureClassList>
<GMLFeatureClass>
<Name>multipolys</Name>
<ElementPath>multipolys</ElementPath>
<!--MULTIPOLYGON-->
<GeometryType>6</GeometryType>
<SRSName>EPSG:4326</SRSName>
<DatasetSpecificInfo>
<FeatureCount>4</FeatureCount>
<ExtentXMin>0.00000</ExtentXMin>
<ExtentXMax>9.00000</ExtentXMax>
<ExtentYMin>-1.00000</ExtentYMin>
<ExtentYMax>6.00000</ExtentYMax>
</DatasetSpecificInfo>
<PropertyDefn>
<Name>Bname</Name>
<ElementPath>Bname</ElementPath>
<Type>String</Type>
<Width>4</Width>
</PropertyDefn>
<PropertyDefn>
<Name>Bintval</Name>
<ElementPath>Bintval</ElementPath>
<Type>Integer</Type>
</PropertyDefn>
<PropertyDefn>
<Name>Bfloatval</Name>
<ElementPath>Bfloatval</ElementPath>
<Type>Real</Type>
</PropertyDefn>
</GMLFeatureClass>
</GMLFeatureClassList>
42 changes: 42 additions & 0 deletions python/plugins/processing/tests/testdata/multipolys.gml
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=""
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 fid="multipolys.0">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>2,1 2,2 3,2 3,3 4,3 4,1 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>
</gml:featureMember>
<gml:featureMember>
<ogr:multipolys fid="multipolys.1">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>7,-1 8,-1 8,3 7,3 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,5 7,4 8,4 9,5 9,6 7,6</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon></ogr:geometryProperty>
</ogr:multipolys>
</gml:featureMember>
<gml:featureMember>
<ogr:multipolys fid="multipolys.2">
<ogr:geometryProperty><gml:MultiPolygon srsName="EPSG:4326"><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,0 0,1 1,1 1,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>
</gml:featureMember>
<gml:featureMember>
<ogr:multipolys fid="multipolys.3">
<ogr:Bname>Test</ogr:Bname>
<ogr:Bintval>3</ogr:Bintval>
<ogr:Bfloatval>0</ogr:Bfloatval>
</ogr:multipolys>
</gml:featureMember>
</ogr:FeatureCollection>
Loading

0 comments on commit 9ad69ad

Please sign in to comment.