Skip to content

Commit 027147b

Browse files
committed
Add query for buildings points and centroids
1 parent 922ff1c commit 027147b

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

images/tiler-imposm/queries/mviews_buildings_points.sql renamed to images/tiler-imposm/queries/mviews_buildings_points_centroids.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ BEGIN
3636
(ST_MaximumInscribedCircle(geometry)).center AS geometry,
3737
name,
3838
NULLIF(as_numeric(height), -1) AS height,
39-
ST_Area(geometry) AS area,
39+
ROUND(ST_Area(geometry)::numeric, 2) AS area,
4040
type,
4141
start_date,
4242
end_date,
@@ -65,4 +65,6 @@ $$ LANGUAGE plpgsql;
6565

6666
SELECT create_buildings_materialized_view(1500, 'mview_buildings_points_centroids_z14');
6767
SELECT create_buildings_materialized_view(1000, 'mview_buildings_points_centroids_z15');
68-
SELECT create_buildings_materialized_view(0, 'mview_buildings_points_centroids_z16_20');
68+
SELECT create_buildings_materialized_view(500, 'mview_buildings_points_centroids_z16');
69+
SELECT create_buildings_materialized_view(250, 'mview_buildings_points_centroids_z17');
70+
SELECT create_buildings_materialized_view(0, 'mview_buildings_points_centroids_z18_20');

images/tiler-imposm/refresh_mviews.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,12 @@ other_areas_views=(
8989
mview_buildings_points_centroids_views=(
9090
"mview_buildings_points_centroids_z14"
9191
"mview_buildings_points_centroids_z15"
92-
"mview_buildings_points_centroids_z16_20"
92+
"mview_buildings_points_centroids_z16"
93+
"mview_buildings_points_centroids_z17"
94+
"mview_buildings_points_centroids_z18_20"
9395
)
9496

97+
9598
# Start refreshing in parallel with a sleep interval all of them in average of 4 min refresh
9699
## Benchmark admin refresh those views takes 4 min to complete
97100
refresh_mviews_group "admin" 1 "${admin_views[@]}" &
@@ -103,5 +106,5 @@ refresh_mviews_group "water" 160 "${water_views[@]}" &
103106
refresh_mviews_group "landuse" 220 "${landuse_views[@]}" &
104107
## Benchmark other areas and centroids refresh those views takes 3 secs to complete
105108
refresh_mviews_group "other_areas" 230 "${other_areas_views[@]}" &
106-
## Benchmark: Refreshing building points/centroids takes 31 seconds to complete.
109+
## Benchmark: Refreshing building points/centroids takes 60 seconds to complete.
107110
refresh_mviews_group "buildings_points_centroids" 230 "${mview_buildings_points_centroids_views[@]}" &

images/tiler-imposm/start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ function importData() {
245245
psql $PG_CONNECTION -f queries/mviews_landuse_areas_centroids.sql
246246
psql $PG_CONNECTION -f queries/mviews_other_areas.sql
247247
psql $PG_CONNECTION -f queries/mviews_other_areas_centroids.sql
248+
psql $PG_CONNECTION -f queries/mviews_buildings_points_centroids.sql
248249
# Create INIT_FILE to prevent re-importing
249250
touch $INIT_FILE
250251
}

0 commit comments

Comments
 (0)