@@ -3,6 +3,16 @@ Feature: Import and update of multipolygon areas
33 Background :
44 Given the input file 'test_multipolygon.osm'
55
6+ Given the SQL statement grouped_polygons
7+ """
8+ SELECT osm_id,
9+ count(*) as count,
10+ round(sum(ST_Area(way))) as area,
11+ round(sum(way_area::numeric)) as way_area
12+ FROM planet_osm_polygon
13+ GROUP BY osm_id
14+ """
15+
616 Scenario Outline : Import and update slim
717 Given <lua> lua tagtransform
818 When running osm2pgsql pgsql with parameters
@@ -35,15 +45,15 @@ Feature: Import and update of multipolygon areas
3545 | osm_id | landuse | name | ST_NumInteriorRing (way ) |
3646 | -3 | residential | Name_rel11 | 2 |
3747
38- Then SELECT osm_id, round(sum(ST_Area(way))), round(sum(way_area::numeric)) FROM planet_osm_polygon GROUP BY osm_id
48+ Then statement grouped_polygons returns
3949 | osm_id | area | way_area |
4050 | -13 | 17581 | 17581 |
4151 | -7 | 16169 | 16169 |
4252 | -29 | 68494 | 68494 |
4353 | -39 | 10377 | 10378 |
4454 | -40 | 12397 | 12397 |
4555
46- Then SELECT osm_id, count(*) FROM planet_osm_polygon GROUP BY osm_id
56+ Then statement grouped_polygons returns
4757 | osm_id | count |
4858 | -25 | 1 |
4959 | 113 | 1 |
@@ -63,7 +73,15 @@ Feature: Import and update of multipolygon areas
6373 | osm_id | "natural " |
6474 | -33 | water |
6575
66- Then SELECT osm_id, CASE WHEN '<param1>' = '-G' THEN min(ST_NumGeometries(way)) ELSE count(*) END FROM planet_osm_polygon GROUP BY osm_id
76+ Given the SQL statement geometries_polygon
77+ """
78+ SELECT osm_id,
79+ CASE WHEN '<param1>' = '-G' THEN min(ST_NumGeometries(way))
80+ ELSE count(*) END as count
81+ FROM planet_osm_polygon
82+ GROUP BY osm_id
83+ """
84+ Then statement geometries_polygon returns
6785 | osm_id | count |
6886 | -13 | 2 |
6987 | -7 | 2 |
@@ -99,15 +117,15 @@ Feature: Import and update of multipolygon areas
99117 | osm_id | landuse | name | ST_NumInteriorRing (way ) |
100118 | -3 | residential | Name_rel11 | 2 |
101119
102- Then SELECT osm_id, round(sum(ST_Area(way))), round(sum(way_area::numeric)) FROM planet_osm_polygon GROUP BY osm_id
120+ Then statement grouped_polygons returns
103121 | osm_id | area | way_area |
104122 | -13 | 17581 | 17581 |
105123 | -7 | 16169 | 16169 |
106124 | -29 | 29155 | 29155 |
107125 | -39 | 10377 | 10378 |
108126 | -40 | 12397 | 12397 |
109127
110- Then SELECT osm_id, count(*) FROM planet_osm_polygon GROUP BY osm_id
128+ Then statement grouped_polygons returns
111129 | osm_id | count |
112130 | 113 | 1 |
113131 | 118 | 1 |
0 commit comments