Skip to content

Commit 590abf0

Browse files
ghtmttm-kuhn
authored andcommitted
processing qgis countsuniquepoints test
1 parent 1a6b977 commit 590abf0

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>count_unique_points</Name>
4+
<ElementPath>count_unique_points</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>6</FeatureCount>
10+
<ExtentXMin>-1.00000</ExtentXMin>
11+
<ExtentXMax>10.00000</ExtentXMax>
12+
<ExtentYMin>-3.00000</ExtentYMin>
13+
<ExtentYMax>6.00000</ExtentYMax>
14+
</DatasetSpecificInfo>
15+
<PropertyDefn>
16+
<Name>name</Name>
17+
<ElementPath>name</ElementPath>
18+
<Type>String</Type>
19+
<Width>5</Width>
20+
</PropertyDefn>
21+
<PropertyDefn>
22+
<Name>intval</Name>
23+
<ElementPath>intval</ElementPath>
24+
<Type>Integer</Type>
25+
</PropertyDefn>
26+
<PropertyDefn>
27+
<Name>floatval</Name>
28+
<ElementPath>floatval</ElementPath>
29+
<Type>Real</Type>
30+
</PropertyDefn>
31+
<PropertyDefn>
32+
<Name>NUMPOINTS</Name>
33+
<ElementPath>NUMPOINTS</ElementPath>
34+
<Type>Integer</Type>
35+
</PropertyDefn>
36+
</GMLFeatureClass>
37+
</GMLFeatureClassList>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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>-1</gml:X><gml:Y>-3</gml:Y></gml:coord>
10+
<gml:coord><gml:X>10</gml:X><gml:Y>6</gml:Y></gml:coord>
11+
</gml:Box>
12+
</gml:boundedBy>
13+
14+
<gml:featureMember>
15+
<ogr:count_unique_points fid="polys.0">
16+
<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>
17+
<ogr:name>aaaaa</ogr:name>
18+
<ogr:intval>33</ogr:intval>
19+
<ogr:floatval>44.123456</ogr:floatval>
20+
<ogr:NUMPOINTS>1</ogr:NUMPOINTS>
21+
</ogr:count_unique_points>
22+
</gml:featureMember>
23+
<gml:featureMember>
24+
<ogr:count_unique_points fid="polys.1">
25+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>5,5 6,4 4,4 5,5</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
26+
<ogr:name>Aaaaa</ogr:name>
27+
<ogr:intval>-33</ogr:intval>
28+
<ogr:floatval>0</ogr:floatval>
29+
<ogr:NUMPOINTS>0</ogr:NUMPOINTS>
30+
</ogr:count_unique_points>
31+
</gml:featureMember>
32+
<gml:featureMember>
33+
<ogr:count_unique_points fid="polys.2">
34+
<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>
35+
<ogr:name>bbaaa</ogr:name>
36+
<ogr:floatval>0.123</ogr:floatval>
37+
<ogr:NUMPOINTS>0</ogr:NUMPOINTS>
38+
</ogr:count_unique_points>
39+
</gml:featureMember>
40+
<gml:featureMember>
41+
<ogr:count_unique_points fid="polys.3">
42+
<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:innerBoundaryIs><gml:LinearRing><gml:coordinates>7,0 7,-2 9,-2 9,0 7,0</gml:coordinates></gml:LinearRing></gml:innerBoundaryIs></gml:Polygon></ogr:geometryProperty>
43+
<ogr:name>ASDF</ogr:name>
44+
<ogr:intval>0</ogr:intval>
45+
<ogr:NUMPOINTS>0</ogr:NUMPOINTS>
46+
</ogr:count_unique_points>
47+
</gml:featureMember>
48+
<gml:featureMember>
49+
<ogr:count_unique_points fid="polys.4">
50+
<ogr:intval>120</ogr:intval>
51+
<ogr:floatval>-100291.43213</ogr:floatval>
52+
<ogr:NUMPOINTS>0</ogr:NUMPOINTS>
53+
</ogr:count_unique_points>
54+
</gml:featureMember>
55+
<gml:featureMember>
56+
<ogr:count_unique_points fid="polys.5">
57+
<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>
58+
<ogr:name>elim</ogr:name>
59+
<ogr:intval>2</ogr:intval>
60+
<ogr:floatval>3.33</ogr:floatval>
61+
<ogr:NUMPOINTS>1</ogr:NUMPOINTS>
62+
</ogr:count_unique_points>
63+
</gml:featureMember>
64+
</ogr:FeatureCollection>

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,3 +2145,19 @@ tests:
21452145
name: points.gml
21462146
type: vector
21472147
results: {}
2148+
2149+
- algorithm: qgis:countuniquepointsinpolygon
2150+
name: Test (qgis:countuniquepointsinpolygon)
2151+
params:
2152+
CLASSFIELD: id2
2153+
FIELD: NUMPOINTS
2154+
POINTS:
2155+
name: points.gml
2156+
type: vector
2157+
POLYGONS:
2158+
name: polys.gml
2159+
type: vector
2160+
results:
2161+
OUTPUT:
2162+
name: expected/count_unique_points.gml
2163+
type: vector

0 commit comments

Comments
 (0)