From cf91e4fe54108aad379c9738ae4f3f5f17113d17 Mon Sep 17 00:00:00 2001 From: Robin van der Linde Date: Mon, 12 Sep 2022 10:33:52 +0200 Subject: [PATCH] Basic station map --- .../railway_platforms/railway_platforms.json | 69 +++++ assets/themes/stations/license_info.json | 22 ++ .../stations/public_transport_tickets.svg | 3 + assets/themes/stations/rail-light-15.svg | 12 + assets/themes/stations/stations.json | 264 ++++++++++++++++++ 5 files changed, 370 insertions(+) create mode 100644 assets/layers/railway_platforms/railway_platforms.json create mode 100644 assets/themes/stations/license_info.json create mode 100644 assets/themes/stations/public_transport_tickets.svg create mode 100644 assets/themes/stations/rail-light-15.svg create mode 100644 assets/themes/stations/stations.json diff --git a/assets/layers/railway_platforms/railway_platforms.json b/assets/layers/railway_platforms/railway_platforms.json new file mode 100644 index 0000000000..0b09a6f7f5 --- /dev/null +++ b/assets/layers/railway_platforms/railway_platforms.json @@ -0,0 +1,69 @@ +{ + "id": "railway_platforms", + "name": { + "en": "Railway Platforms" + }, + "description": { + "en": "Find every platform in the station, and the train routes that use them." + }, + "title": { + "render": { + "en": "Platform" + }, + "mappings": [ + { + "if": "ref~*", + "then": { + "en": "Platform {ref}" + } + } + ] + }, + "source": { + "osmTags": { + "or": [ + "railway=platform" + ] + } + }, + "minzoom": 18, + "tagRenderings": [ + { + "id": "ref", + "question": { + "en": "What is the number for this platform?" + }, + "freeform": { + "key": "ref", + "type": "string", + "placeholder": { + "en": "Platform number" + } + }, + "render": { + "en": "Platform {ref}" + } + }, + "level" + ], + "mapRendering": [ + { + "color": "gray" + }, + { + "icon": "./assets/svg/bug.svg", + "location": [ + "point", + "centroid" + ], + "label": { + "mappings": [ + { + "if": "ref~*", + "then": "
{ref}
" + } + ] + } + } + ] +} diff --git a/assets/themes/stations/license_info.json b/assets/themes/stations/license_info.json new file mode 100644 index 0000000000..19fdb45210 --- /dev/null +++ b/assets/themes/stations/license_info.json @@ -0,0 +1,22 @@ +[ + { + "path": "public_transport_tickets.svg", + "license": "CC0", + "authors": [ + "Jérémy Ragusa" + ], + "sources": [ + "https://github.com/gravitystorm/openstreetmap-carto/blob/master/symbols/amenity/public_transport_tickets.svg" + ] + }, + { + "path": "rail-light-15.svg", + "license": "CC0", + "authors": [ + "Maki" + ], + "sources": [ + "https://labs.mapbox.com/maki-icons/" + ] + } +] \ No newline at end of file diff --git a/assets/themes/stations/public_transport_tickets.svg b/assets/themes/stations/public_transport_tickets.svg new file mode 100644 index 0000000000..132830c222 --- /dev/null +++ b/assets/themes/stations/public_transport_tickets.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/themes/stations/rail-light-15.svg b/assets/themes/stations/rail-light-15.svg new file mode 100644 index 0000000000..6a67b1935e --- /dev/null +++ b/assets/themes/stations/rail-light-15.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/assets/themes/stations/stations.json b/assets/themes/stations/stations.json new file mode 100644 index 0000000000..473724f874 --- /dev/null +++ b/assets/themes/stations/stations.json @@ -0,0 +1,264 @@ +{ + "id": "stations", + "title": { + "en": "Train Stations" + }, + "description": { + "en": "View, edit and add details to a train station" + }, + "icon": "./assets/themes/stations/rail-light-15.svg", + "startLat": 0, + "startLon": 0, + "startZoom": 0, + "hideFromOverview": true, + "defaultBackgroundId": "CartoDB.Positron", + "layers": [ + { + "builtin": "indoors", + "override": { + "minzoom": 19, + "passAllFeatures": true, + "mapRendering": [ + { + "label": { + "render": null + }, + "iconSize": "0,0,bottom" + } + ] + } + }, + { + "builtin": [ + "entrance", + "elevator", + "bench", + "toilet", + "waste_basket" + ], + "override": { + "minzoom": 19 + } + }, + { + "builtin": "pedestrian_path", + "override": { + "mapRendering": [ + {}, + { + "color": { + "render": "#b33", + "mappings": [ + { + "if": "highway=steps", + "then": "gray" + } + ] + }, + "width": { + "render": 4, + "mappings": [ + { + "if": "highway=steps", + "then": 10 + } + ] + }, + "dashArray": { + "render": "12 6", + "mappings": [ + { + "if": "highway=steps", + "then": "2 2" + } + ] + } + } + ], + "minzoom": 19 + } + }, + { + "id": "train_station", + "minzoom": 12, + "minzoomVisible": 17, + "source": { + "osmTags": { + "or": [ + "railway=station", + "railway=halt" + ] + } + }, + "mapRendering": [ + { + "icon": "./assets/themes/stations/rail-light-15.svg", + "location": [ + "point", + "centroid" + ], + "label": { + "mappings": [ + { + "if": "name~*", + "then": "
{name}
" + } + ] + } + }, + { + "color": "green" + } + ] + }, + { + "builtin": "shops", + "override": { + "source": { + "osmTags": { + "and": [ + "shop~*", + "indoor=room" + ] + } + }, + "presets": null, + "minzoom": 19 + } + }, + "railway_platforms", + { + "id": "ticket_machine", + "source": { + "osmTags": { + "and": [ + "amenity=vending_machine", + "vending=public_transport_tickets" + ] + } + }, + "title": { + "render": { + "en": "Ticket Machine" + } + }, + "tagRenderings": [ + "images", + "level", + { + "id": "operator", + "question": { + "en": "Who is the operator of this ticket machine?" + }, + "render": { + "en": "This ticket machine is operated by {operator}" + }, + "freeform": { + "key": "operator", + "type": "string", + "placeholder": { + "en": "Name of the operator" + } + } + } + ], + "presets": [ + { + "tags": ["amenity=vending_machine", "vending=public_transport_tickets"], + "title": { + "en": "a ticket machine" + } + } + ], + "mapRendering": [ + { + "icon": "circle:white;./assets/themes/stations/public_transport_tickets.svg", + "iconSize": "20,20,center", + "location": [ + "point", + "centroid" + ] + } + ] + }, + { + "id": "departures_board", + "name": { + "en": "Departures boards" + }, + "description": { + "en": "Displays showing the trains that will leave from this station" + }, + "title": { + "render": { + "en": "Departures board" + } + }, + "minzoom": 19, + "source": { + "osmTags": { + "and": [ + "departures_board~*", + "departures_board!=no", + "public_transport=" + ] + } + }, + "tagRenderings": [ + { + "id": "type", + "question": { + "en": "What kind of departures board is this?" + }, + "mappings": [ + { + "if": "departures_board=yes", + "then": { + "en": "This is a departures board of an unknown type" + } + }, + { + "if": "departures_board=realtime", + "then": { + "en": "This is an electronic board, showing the next departures in realtime" + } + }, + { + "if": "departures_board=timetable", + "then": { + "en": "This is a paper timetable" + } + }, + { + "if": "departures_board=delay", + "then": { + "en": "There is a sign showing the frequency of the trains" + } + } + ] + }, + "level" + ], + "presets": [ + { + "tags": ["departures_board=yes"], + "title": { + "en": "a departures board" + }, + "description": { + "en": "Add a board showing departures, either electronic or paper" + } + } + ], + "mapRendering": [ + { + "icon": "./assets/svg/bug.svg", + "location": [ + "point", + "centroid" + ] + } + ] + } + ] +}