From 3cf42393a69c56074e50ed83117fd6703425c89d Mon Sep 17 00:00:00 2001 From: lukasmartinelli Date: Tue, 28 Jun 2016 19:16:33 +0200 Subject: [PATCH] Add motorway_junction layer --- osm2vectortiles.tm2source/data.yml | 54 +++++++++++++++++++-- src/import-sql/layers/motorway_junction.sql | 2 +- src/import-sql/prepare.sh | 1 + src/import-sql/tables.yml | 4 ++ 4 files changed, 56 insertions(+), 5 deletions(-) diff --git a/osm2vectortiles.tm2source/data.yml b/osm2vectortiles.tm2source/data.yml index bb6d969..0f8908d 100644 --- a/osm2vectortiles.tm2source/data.yml +++ b/osm2vectortiles.tm2source/data.yml @@ -4,13 +4,16 @@ _prefs: mapid: '' rev: '' saveCenter: true -attribution: '© OpenStreetMap contributors' +attribution: "© OpenStreetMap contributors" center: - - 8.5388 - - 47.3434 - - 12 + - 8.5391 + - 47.3439 + - 10 description: |- Free global vector tiles from OpenStreetMap compatible with Mapbox Streets v7. + + + http://osm2vectortiles.org Layer: - id: landuse @@ -932,6 +935,49 @@ Layer: properties: "buffer-size": 8 srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over + - id: motorway_junction + Datasource: + dbname: osm + extent: -20037508.34,-20037508.34,20037508.34,20037508.34 + geometry_field: geometry + geometry_table: '' + host: db + key_field: osm_id + key_field_as_attribute: false + max_size: 512 + password: osm + port: 5432 + srid: '' + table: |- + ( + SELECT osm_ids2mbid(osm_id, true) AS osm_id, + geometry, + name, + NULLIF(ref, '') AS ref, + NULLIF(char_length(ref), 0) AS reflen, + type, + road_class(type, NULL, NULL) AS class + FROM ( + SELECT * FROM motorway_junction_z11 + WHERE z(!scale_denominator!) = 11 + UNION ALL + SELECT * FROM motorway_junction_z12toz14 + WHERE z(!scale_denominator!) BETWEEN 12 AND 14 + ) AS t + WHERE geometry && !bbox! + ) AS data + type: postgis + user: osm + description: This layer contains point geometries for labeling motorway junctions (aka highway exits). Classes and types match the types in the road layer. + fields: + class: The class of road the junction is on. Matches the classes in the road layer. + name: A longer name + ref: A short identifier + reflen: Number + type: The type of road the junction is on. Matches the types in the road layer. + properties: + "buffer-size": 8 + srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over - id: waterway_label Datasource: dbname: osm diff --git a/src/import-sql/layers/motorway_junction.sql b/src/import-sql/layers/motorway_junction.sql index b1c212b..28017fa 100644 --- a/src/import-sql/layers/motorway_junction.sql +++ b/src/import-sql/layers/motorway_junction.sql @@ -3,7 +3,7 @@ CREATE OR REPLACE VIEW motorway_junction_z11 AS FROM osm_motorway_junction_point WHERE ref <> '' AND type <> 'trunk'; -CREATE OR REPLACE VIEW motorway_junction_z12_toz14 AS +CREATE OR REPLACE VIEW motorway_junction_z12toz14 AS SELECT id AS osm_id, type, ref, name, geometry FROM osm_motorway_junction_point WHERE ref <> ''; diff --git a/src/import-sql/prepare.sh b/src/import-sql/prepare.sh index 8d87dd6..23811be 100755 --- a/src/import-sql/prepare.sh +++ b/src/import-sql/prepare.sh @@ -52,6 +52,7 @@ function main() { exec_sql_file "${SQL_LAYERS_DIR}mountain_peak_label.sql" exec_sql_file "${SQL_LAYERS_DIR}airport_label.sql" exec_sql_file "${SQL_LAYERS_DIR}rail_station_label.sql" + exec_sql_file "${SQL_LAYERS_DIR}motorway_junction.sql" if [ "$SQL_CREATE_INDIZES" = true ] ; then echo "Create index in $OSM_DB" diff --git a/src/import-sql/tables.yml b/src/import-sql/tables.yml index ddcb79f..bd563ab 100644 --- a/src/import-sql/tables.yml +++ b/src/import-sql/tables.yml @@ -75,3 +75,7 @@ tables: buffer: 64 min_zoom: 14 max_zoom: 14 + motorway_junction_point: + buffer: 8 + min_zoom: 11 + max_zoom: 14