Skip to content

Commit 34b277a

Browse files
ghtmttm-kuhn
authored andcommitted
[processing] test poly_from_extent (#4149)
1 parent 13e7cd9 commit 34b277a

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<GMLFeatureClassList>
2+
<GMLFeatureClass>
3+
<Name>polygon_from_extent</Name>
4+
<ElementPath>polygon_from_extent</ElementPath>
5+
<!--POLYGON-->
6+
<GeometryType>3</GeometryType>
7+
<SRSName>EPSG:4326</SRSName>
8+
<DatasetSpecificInfo>
9+
<FeatureCount>1</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>MINX</Name>
17+
<ElementPath>MINX</ElementPath>
18+
<Type>Integer</Type>
19+
</PropertyDefn>
20+
<PropertyDefn>
21+
<Name>MINY</Name>
22+
<ElementPath>MINY</ElementPath>
23+
<Type>Integer</Type>
24+
</PropertyDefn>
25+
<PropertyDefn>
26+
<Name>MAXX</Name>
27+
<ElementPath>MAXX</ElementPath>
28+
<Type>Integer</Type>
29+
</PropertyDefn>
30+
<PropertyDefn>
31+
<Name>MAXY</Name>
32+
<ElementPath>MAXY</ElementPath>
33+
<Type>Integer</Type>
34+
</PropertyDefn>
35+
<PropertyDefn>
36+
<Name>CNTX</Name>
37+
<ElementPath>CNTX</ElementPath>
38+
<Type>Real</Type>
39+
</PropertyDefn>
40+
<PropertyDefn>
41+
<Name>CNTY</Name>
42+
<ElementPath>CNTY</ElementPath>
43+
<Type>Real</Type>
44+
</PropertyDefn>
45+
<PropertyDefn>
46+
<Name>AREA</Name>
47+
<ElementPath>AREA</ElementPath>
48+
<Type>Integer</Type>
49+
</PropertyDefn>
50+
<PropertyDefn>
51+
<Name>PERIM</Name>
52+
<ElementPath>PERIM</ElementPath>
53+
<Type>Integer</Type>
54+
</PropertyDefn>
55+
<PropertyDefn>
56+
<Name>HEIGHT</Name>
57+
<ElementPath>HEIGHT</ElementPath>
58+
<Type>Integer</Type>
59+
</PropertyDefn>
60+
<PropertyDefn>
61+
<Name>WIDTH</Name>
62+
<ElementPath>WIDTH</ElementPath>
63+
<Type>Integer</Type>
64+
</PropertyDefn>
65+
</GMLFeatureClass>
66+
</GMLFeatureClassList>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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:polygon_from_extent fid="polygon_from_extent.0">
16+
<ogr:geometryProperty><gml:Polygon srsName="EPSG:4326"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>-1,-3 -1,6 10,6 10,-3 -1,-3</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></ogr:geometryProperty>
17+
<ogr:MINX>-1</ogr:MINX>
18+
<ogr:MINY>-3</ogr:MINY>
19+
<ogr:MAXX>10</ogr:MAXX>
20+
<ogr:MAXY>6</ogr:MAXY>
21+
<ogr:CNTX>4.5</ogr:CNTX>
22+
<ogr:CNTY>1.5</ogr:CNTY>
23+
<ogr:AREA>99</ogr:AREA>
24+
<ogr:PERIM>40</ogr:PERIM>
25+
<ogr:HEIGHT>9</ogr:HEIGHT>
26+
<ogr:WIDTH>11</ogr:WIDTH>
27+
</ogr:polygon_from_extent>
28+
</gml:featureMember>
29+
</ogr:FeatureCollection>

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,3 +2361,14 @@ tests:
23612361
name: expected/find_projection.html
23622362
type: file
23632363

2364+
- algorithm: qgis:polygonfromlayerextent
2365+
name: Standard polygon from layer extent
2366+
params:
2367+
BY_FEATURE: false
2368+
INPUT_LAYER:
2369+
name: polys.gml
2370+
type: vector
2371+
results:
2372+
OUTPUT:
2373+
name: expected/polygon_from_extent.gml
2374+
type: vector

0 commit comments

Comments
 (0)