Skip to content

Open Infrastructure Map, a view of infrastructure data in OpenStreetMap

More construction fixes

Russ Garrettaac929c9f6a3
diff --git a/config.toml b/config.toml
index 59faf45..4e1b5b7 100644
--- a/config.toml
+++ b/config.toml
@@ -174,7 +174,7 @@ sql = "SELECT osm_id AS gid, ST_AsBinary(ST_Centroid(geometry)) AS geom, tags ->
[[providers.layers]]
name = "telecoms_communication_line"
geometry_type = "LineString"
-sql = "SELECT osm_id AS gid, ST_AsBinary(ST_Simplify(geometry, ZRes(!ZOOM!) / 5, true)) AS geom, tags -> 'operator' AS operator, tags -> 'name' AS name, tags -> 'location' AS location FROM osm_telecom_cable WHERE construction != '' AND geometry && !BBOX! AND 1 < !ZOOM! AND ST_Length(geometry) > ZRes(!ZOOM!) * 2"
+sql = "SELECT osm_id AS gid, ST_AsBinary(ST_Simplify(geometry, ZRes(!ZOOM!) / 5, true)) AS geom, tags -> 'operator' AS operator, tags -> 'name' AS name, tags -> 'location' AS location FROM osm_telecom_cable WHERE tags -> 'construction' != '' AND geometry && !BBOX! AND 1 < !ZOOM! AND ST_Length(geometry) > ZRes(!ZOOM!) * 2"
[[providers.layers]]
name = "telecoms_data_center"
diff --git a/views.sql b/views.sql
index 3e6ecdd..0c07ee8 100644
--- a/views.sql
+++ b/views.sql
@@ -23,7 +23,7 @@ CREATE OR REPLACE VIEW substation AS
CREATE MATERIALIZED VIEW power_plant_relation AS
SELECT rel.osm_id, ST_ConvexHull(ST_Union(mem.geometry)) AS geometry,
- (rel.tags -> 'name') AS name, rel.output, rel.source, rel.tags
+ (rel.tags -> 'name') AS name, rel.output, rel.source, rel.tags, rel.construction
FROM osm_power_plant_relation as rel, osm_power_plant_relation_member as mem
WHERE mem.osm_id = rel.osm_id
GROUP BY rel.osm_id, rel.tags -> 'name', rel.output, rel.source, rel.tags;
@@ -33,10 +33,10 @@ CREATE INDEX power_plant_relation_geom ON power_plant_relation USING GIST (geome
ANALYZE power_plant_relation;
CREATE OR REPLACE VIEW power_plant AS
- SELECT osm_id, geometry, tags -> 'name' AS name, output, source, tags
+ SELECT osm_id, geometry, tags -> 'name' AS name, output, source, tags, construction
FROM osm_power_plant
UNION
- SELECT osm_id, geometry, name, output, source, tags
+ SELECT osm_id, geometry, name, output, source, tags, construction
FROM power_plant_relation;