Open Infrastructure Map, a view of infrastructure data in OpenStreetMap
More construction fixes
Russ Garrettaac929c9f6a3
diff --git a/config.toml b/config.tomlindex 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.sqlindex 3e6ecdd..0c07ee8 100644--- a/views.sql+++ b/views.sql@@ -23,7 +23,7 @@ CREATE OR REPLACE VIEW substation ASCREATE MATERIALIZED VIEW power_plant_relation ASSELECT 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.constructionFROM osm_power_plant_relation as rel, osm_power_plant_relation_member as memWHERE mem.osm_id = rel.osm_idGROUP 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 (geomeANALYZE 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, constructionFROM osm_power_plantUNION- SELECT osm_id, geometry, name, output, source, tags+ SELECT osm_id, geometry, name, output, source, tags, constructionFROM power_plant_relation;