Skip to content

Commit d742478

Browse files
committed
[processing] Add tests for create points from table alg
1 parent 69e8e4a commit d742478

File tree

5 files changed

+287
-0
lines changed

5 files changed

+287
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>create_points</Name>
4+
<ElementPath>create_points</ElementPath>
5+
<GeometryType>100</GeometryType>
6+
<DatasetSpecificInfo>
7+
<FeatureCount>9</FeatureCount>
8+
</DatasetSpecificInfo>
9+
<PropertyDefn>
10+
<Name>id</Name>
11+
<ElementPath>id</ElementPath>
12+
<Type>Integer</Type>
13+
</PropertyDefn>
14+
<PropertyDefn>
15+
<Name>id2</Name>
16+
<ElementPath>id2</ElementPath>
17+
<Type>Integer</Type>
18+
</PropertyDefn>
19+
<PropertyDefn>
20+
<Name>xcoord</Name>
21+
<ElementPath>xcoord</ElementPath>
22+
<Type>Real</Type>
23+
</PropertyDefn>
24+
<PropertyDefn>
25+
<Name>ycoord</Name>
26+
<ElementPath>ycoord</ElementPath>
27+
<Type>Real</Type>
28+
</PropertyDefn>
29+
<PropertyDefn>
30+
<Name>zcoord</Name>
31+
<ElementPath>zcoord</ElementPath>
32+
<Type>Real</Type>
33+
</PropertyDefn>
34+
<PropertyDefn>
35+
<Name>mcoord</Name>
36+
<ElementPath>mcoord</ElementPath>
37+
<Type>Real</Type>
38+
</PropertyDefn>
39+
</GMLFeatureClass>
40+
</GMLFeatureClassList>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy><gml:null>missing</gml:null></gml:boundedBy>
8+
9+
<gml:featureMember>
10+
<ogr:create_points fid="points.0">
11+
<ogr:id>1</ogr:id>
12+
<ogr:id2>2</ogr:id2>
13+
<ogr:xcoord>1.00000</ogr:xcoord>
14+
<ogr:ycoord>1.00000</ogr:ycoord>
15+
<ogr:zcoord>1.00000</ogr:zcoord>
16+
</ogr:create_points>
17+
</gml:featureMember>
18+
<gml:featureMember>
19+
<ogr:create_points fid="points.1">
20+
<ogr:id>2</ogr:id>
21+
<ogr:id2>1</ogr:id2>
22+
<ogr:xcoord>3.00000</ogr:xcoord>
23+
<ogr:ycoord>3.00000</ogr:ycoord>
24+
<ogr:zcoord>2.00000</ogr:zcoord>
25+
<ogr:mcoord>4.00000</ogr:mcoord>
26+
</ogr:create_points>
27+
</gml:featureMember>
28+
<gml:featureMember>
29+
<ogr:create_points fid="points.2">
30+
<ogr:id>3</ogr:id>
31+
<ogr:id2>0</ogr:id2>
32+
<ogr:xcoord>2.00000</ogr:xcoord>
33+
<ogr:ycoord>2.00000</ogr:ycoord>
34+
<ogr:zcoord>3.00000</ogr:zcoord>
35+
<ogr:mcoord>5.00000</ogr:mcoord>
36+
</ogr:create_points>
37+
</gml:featureMember>
38+
<gml:featureMember>
39+
<ogr:create_points fid="points.3">
40+
<ogr:id>4</ogr:id>
41+
<ogr:id2>2</ogr:id2>
42+
<ogr:xcoord>5.00000</ogr:xcoord>
43+
<ogr:ycoord>2.00000</ogr:ycoord>
44+
</ogr:create_points>
45+
</gml:featureMember>
46+
<gml:featureMember>
47+
<ogr:create_points fid="points.4">
48+
<ogr:id>5</ogr:id>
49+
<ogr:id2>1</ogr:id2>
50+
</ogr:create_points>
51+
</gml:featureMember>
52+
<gml:featureMember>
53+
<ogr:create_points fid="points.5">
54+
<ogr:id>6</ogr:id>
55+
<ogr:id2>0</ogr:id2>
56+
<ogr:ycoord>-5.00000</ogr:ycoord>
57+
<ogr:mcoord>8.00000</ogr:mcoord>
58+
</ogr:create_points>
59+
</gml:featureMember>
60+
<gml:featureMember>
61+
<ogr:create_points fid="points.6">
62+
<ogr:id>7</ogr:id>
63+
<ogr:id2>0</ogr:id2>
64+
<ogr:xcoord>8.00000</ogr:xcoord>
65+
</ogr:create_points>
66+
</gml:featureMember>
67+
<gml:featureMember>
68+
<ogr:create_points fid="points.7">
69+
<ogr:id>8</ogr:id>
70+
<ogr:id2>0</ogr:id2>
71+
<ogr:xcoord>7.00000</ogr:xcoord>
72+
<ogr:ycoord>-1.00000</ogr:ycoord>
73+
<ogr:zcoord>4.00000</ogr:zcoord>
74+
<ogr:mcoord>6.00000</ogr:mcoord>
75+
</ogr:create_points>
76+
</gml:featureMember>
77+
<gml:featureMember>
78+
<ogr:create_points fid="points.8">
79+
<ogr:id>9</ogr:id>
80+
<ogr:id2>0</ogr:id2>
81+
<ogr:xcoord>0.00000</ogr:xcoord>
82+
<ogr:ycoord>-1.00000</ogr:ycoord>
83+
<ogr:zcoord>5.00000</ogr:zcoord>
84+
<ogr:mcoord>7.00000</ogr:mcoord>
85+
</ogr:create_points>
86+
</gml:featureMember>
87+
</ogr:FeatureCollection>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>create_points</Name>
4+
<ElementPath>create_points</ElementPath>
5+
<!--POINTZ-->
6+
<GeometryType>-2147483647</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>9</FeatureCount>
10+
<ExtentXMin>0.00000</ExtentXMin>
11+
<ExtentXMax>7.00000</ExtentXMax>
12+
<ExtentYMin>-1.00000</ExtentYMin>
13+
<ExtentYMax>3.00000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>id</Name>
17+
<ElementPath>id</ElementPath>
18+
<Type>Integer</Type>
19+
</PropertyDefn>
20+
<PropertyDefn>
21+
<Name>id2</Name>
22+
<ElementPath>id2</ElementPath>
23+
<Type>Integer</Type>
24+
</PropertyDefn>
25+
<PropertyDefn>
26+
<Name>xcoord</Name>
27+
<ElementPath>xcoord</ElementPath>
28+
<Type>Integer</Type>
29+
</PropertyDefn>
30+
<PropertyDefn>
31+
<Name>ycoord</Name>
32+
<ElementPath>ycoord</ElementPath>
33+
<Type>Integer</Type>
34+
</PropertyDefn>
35+
<PropertyDefn>
36+
<Name>zcoord</Name>
37+
<ElementPath>zcoord</ElementPath>
38+
<Type>Integer</Type>
39+
</PropertyDefn>
40+
<PropertyDefn>
41+
<Name>mcoord</Name>
42+
<ElementPath>mcoord</ElementPath>
43+
<Type>Integer</Type>
44+
</PropertyDefn>
45+
</GMLFeatureClass>
46+
</GMLFeatureClassList>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ogr:FeatureCollection
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation=""
5+
xmlns:ogr="http://ogr.maptools.org/"
6+
xmlns:gml="http://www.opengis.net/gml">
7+
<gml:boundedBy>
8+
<gml:Box>
9+
<gml:coord><gml:X>0</gml:X><gml:Y>-1</gml:Y><gml:Z>0</gml:Z></gml:coord>
10+
<gml:coord><gml:X>7</gml:X><gml:Y>3</gml:Y><gml:Z>5</gml:Z></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:create_points fid="points.0">
16+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>1,1,1</gml:coordinates></gml:Point></ogr:geometryProperty>
17+
<ogr:id>1</ogr:id>
18+
<ogr:id2>2</ogr:id2>
19+
<ogr:xcoord>1</ogr:xcoord>
20+
<ogr:ycoord>1</ogr:ycoord>
21+
<ogr:zcoord>1</ogr:zcoord>
22+
</ogr:create_points>
23+
</gml:featureMember>
24+
<gml:featureMember>
25+
<ogr:create_points fid="points.1">
26+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>3,3,2</gml:coordinates></gml:Point></ogr:geometryProperty>
27+
<ogr:id>2</ogr:id>
28+
<ogr:id2>1</ogr:id2>
29+
<ogr:xcoord>3</ogr:xcoord>
30+
<ogr:ycoord>3</ogr:ycoord>
31+
<ogr:zcoord>2</ogr:zcoord>
32+
<ogr:mcoord>4</ogr:mcoord>
33+
</ogr:create_points>
34+
</gml:featureMember>
35+
<gml:featureMember>
36+
<ogr:create_points fid="points.2">
37+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>2,2,3</gml:coordinates></gml:Point></ogr:geometryProperty>
38+
<ogr:id>3</ogr:id>
39+
<ogr:id2>0</ogr:id2>
40+
<ogr:xcoord>2</ogr:xcoord>
41+
<ogr:ycoord>2</ogr:ycoord>
42+
<ogr:zcoord>3</ogr:zcoord>
43+
<ogr:mcoord>5</ogr:mcoord>
44+
</ogr:create_points>
45+
</gml:featureMember>
46+
<gml:featureMember>
47+
<ogr:create_points fid="points.3">
48+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>5,2,0</gml:coordinates></gml:Point></ogr:geometryProperty>
49+
<ogr:id>4</ogr:id>
50+
<ogr:id2>2</ogr:id2>
51+
<ogr:xcoord>5</ogr:xcoord>
52+
<ogr:ycoord>2</ogr:ycoord>
53+
</ogr:create_points>
54+
</gml:featureMember>
55+
<gml:featureMember>
56+
<ogr:create_points fid="points.4">
57+
<ogr:id>5</ogr:id>
58+
<ogr:id2>1</ogr:id2>
59+
</ogr:create_points>
60+
</gml:featureMember>
61+
<gml:featureMember>
62+
<ogr:create_points fid="points.5">
63+
<ogr:id>6</ogr:id>
64+
<ogr:id2>0</ogr:id2>
65+
<ogr:ycoord>-5</ogr:ycoord>
66+
<ogr:mcoord>8</ogr:mcoord>
67+
</ogr:create_points>
68+
</gml:featureMember>
69+
<gml:featureMember>
70+
<ogr:create_points fid="points.6">
71+
<ogr:id>7</ogr:id>
72+
<ogr:id2>0</ogr:id2>
73+
<ogr:xcoord>8</ogr:xcoord>
74+
</ogr:create_points>
75+
</gml:featureMember>
76+
<gml:featureMember>
77+
<ogr:create_points fid="points.7">
78+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>7,-1,4</gml:coordinates></gml:Point></ogr:geometryProperty>
79+
<ogr:id>8</ogr:id>
80+
<ogr:id2>0</ogr:id2>
81+
<ogr:xcoord>7</ogr:xcoord>
82+
<ogr:ycoord>-1</ogr:ycoord>
83+
<ogr:zcoord>4</ogr:zcoord>
84+
<ogr:mcoord>6</ogr:mcoord>
85+
</ogr:create_points>
86+
</gml:featureMember>
87+
<gml:featureMember>
88+
<ogr:create_points fid="points.8">
89+
<ogr:geometryProperty><gml:Point srsName="EPSG:4326"><gml:coordinates>0,-1,5</gml:coordinates></gml:Point></ogr:geometryProperty>
90+
<ogr:id>9</ogr:id>
91+
<ogr:id2>0</ogr:id2>
92+
<ogr:xcoord>0</ogr:xcoord>
93+
<ogr:ycoord>-1</ogr:ycoord>
94+
<ogr:zcoord>5</ogr:zcoord>
95+
<ogr:mcoord>7</ogr:mcoord>
96+
</ogr:create_points>
97+
</gml:featureMember>
98+
</ogr:FeatureCollection>

python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -1576,3 +1576,19 @@ tests:
15761576
OUTPUT:
15771577
name: expected/delete_column.gml
15781578
type: vector
1579+
1580+
- algorithm: qgis:createpointslayerfromtable
1581+
name: Create points from table
1582+
params:
1583+
INPUT:
1584+
name: create_points.gml
1585+
type: table
1586+
MFIELD: mcoord
1587+
TARGET_CRS: EPSG:4326
1588+
XFIELD: xcoord
1589+
YFIELD: ycoord
1590+
ZFIELD: zcoord
1591+
results:
1592+
OUTPUT:
1593+
name: expected/create_points.gml
1594+
type: vector

0 commit comments

Comments
 (0)