From 1aeb1fdb5b09908d67907f3c816152bfebfdcc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCrten?= Date: Sun, 11 Jul 2021 11:30:15 +0200 Subject: [PATCH 1/3] First version of the cyclenodes theme based on Seppe Santes' one --- assets/themes/cyclenodes/README.md | 10 ++ assets/themes/cyclenodes/cyclenodes.json | 135 +++++++++++++++++++++++ assets/themes/cyclenodes/logo.svg | 120 ++++++++++++++++++++ 3 files changed, 265 insertions(+) create mode 100644 assets/themes/cyclenodes/README.md create mode 100644 assets/themes/cyclenodes/cyclenodes.json create mode 100644 assets/themes/cyclenodes/logo.svg diff --git a/assets/themes/cyclenodes/README.md b/assets/themes/cyclenodes/README.md new file mode 100644 index 0000000000..6920554931 --- /dev/null +++ b/assets/themes/cyclenodes/README.md @@ -0,0 +1,10 @@ +This is a theme for mapping cycle node networks. +The intention is to make it easy to map the cycle nodes itself while riding +the bike and then continue mapping at home and add the routes itself +and connecting the nodes. + +This theme is based on a version first developed by Seppe Santes here: +https://github.com/seppesantens/MapComplete-Themes/blob/main/cyclenodenetworks/cyclenodenetworks.json + +A description on how to map cycle node networks in OSM can be found +[on the OSM wiki](https://wiki.openstreetmap.org/wiki/Cycle_Node_Network_Tagging). diff --git a/assets/themes/cyclenodes/cyclenodes.json b/assets/themes/cyclenodes/cyclenodes.json new file mode 100644 index 0000000000..5b7ef569f6 --- /dev/null +++ b/assets/themes/cyclenodes/cyclenodes.json @@ -0,0 +1,135 @@ +{ + "id": "cyclenodes", + "title": { + "en": "Cycle Node Networks", + "de": "Fahrrad-Knotenpunktnetzwerke" + }, + "description": { + "en": "This map shows cycle node networks and allows you to add new nodes easily", + "de": "Diese Karte zeigt Knotenpunktnetzwerke für Radfahrer und erlaubt auch neue Knoten zu mappen" + }, + "language": [ + "en", + "de" + ], + "maintainer": "Sebastian Kürten", + "icon": "./assets/themes/cyclenodes/logo.svg", + "version": "0", + "startLat": 51.755515, + "startLon": 14.327545, + "startZoom": 11, + "widenFactor": 0.05, + "roamingRenderings": [], + "layers": [ + { + "id": "node2node", + "name": { + "en": "node to node links" + }, + "source": { + "osmTags": { + "and": [ + "network=rcn", + "network:type=node_network" + ] + } + }, + "minzoom": 12, + "title": { + "render": { + "en": "node to node link" + }, + "mappings": [ + { + "if": "ref~*", + "then": { + "en": "node to node link {ref}" + } + } + ] + }, + "width": { + "render": "4" + }, + "color": { + "render": "#00a703" + }, + "tagRenderings": [ + { + "question": { + "en": "When was this node to node link last surveyed?" + }, + "render": { + "en": "This node to node link was last surveyed on {survey:date}" + }, + "freeform": { + "key": "survey:date", + "type": "date" + }, + "mappings": [ + { + "if": "survey:date:={_now:date}", + "then": "Surveyed today!" + } + ] + } + ] + }, + { + "id": "node", + "name": { + "en": "nodes" + }, + "source": { + "osmTags": "rcn_ref~*" + }, + "minzoom": 12, + "title": { + "render": { + "en": "cycle node {rcn_ref}" + } + }, + "label": { + "mappings": [ + { + "if": "rcn_ref~*", + "then": "
{rcn_ref}
" + } + ] + }, + "tagRenderings": [ + { + "question": { + "en": "When was this cycle node last surveyed?" + }, + "render": { + "en": "This cycle node was last surveyed on {survey:date}" + }, + "freeform": { + "key": "survey:date", + "type": "date" + }, + "mappings": [ + { + "if": "survey:date:={_now:date}", + "then": "Surveyed today!" + } + ] + }, + { + "question": { + "en": "How many other cycle nodes does this node link to?" + }, + "render": { + "en": "This node links to {expected_rcn_route_relations} other cycle nodes." + }, + "freeform": { + "key": "expected_rcn_route_relations", + "type": "int" + } + }, + "images" + ] + } + ] +} \ No newline at end of file diff --git a/assets/themes/cyclenodes/logo.svg b/assets/themes/cyclenodes/logo.svg new file mode 100644 index 0000000000..3dfa3e63b3 --- /dev/null +++ b/assets/themes/cyclenodes/logo.svg @@ -0,0 +1,120 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + 25 + + + From 49f7857eb03e62a5a77c1511ce226cba833630a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCrten?= Date: Sun, 11 Jul 2021 12:46:22 +0200 Subject: [PATCH 2/3] Cyclenodes: add ability to add nodes --- assets/themes/cyclenodes/cyclenodes.json | 35 ++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/assets/themes/cyclenodes/cyclenodes.json b/assets/themes/cyclenodes/cyclenodes.json index 5b7ef569f6..d70eae42ba 100644 --- a/assets/themes/cyclenodes/cyclenodes.json +++ b/assets/themes/cyclenodes/cyclenodes.json @@ -81,12 +81,18 @@ "en": "nodes" }, "source": { - "osmTags": "rcn_ref~*" + "osmTags": { + "or": [ + "network:type=node_network", + "rcn_ref~*" + ] + } }, "minzoom": 12, "title": { "render": { - "en": "cycle node {rcn_ref}" + "en": "cycle node {rcn_ref}", + "de": "Knotenpunkt" } }, "label": { @@ -94,9 +100,32 @@ { "if": "rcn_ref~*", "then": "
{rcn_ref}
" + }, + { + "if": "rcn_ref=", + "then": "
?
" } ] }, + "presets": [ + { + "title": { + "de": "Knotenpunkt" + }, + "tags": [ + "network:type=node_network" + ] + }, + { + "title": { + "de": "Knotenpunkt im Netzwerk Spree-Neiße" + }, + "tags": [ + "network:type=node_network", + "cycle_network=Knotenpunktwegweisung Spree-Neiße" + ] + } + ], "tagRenderings": [ { "question": { @@ -132,4 +161,4 @@ ] } ] -} \ No newline at end of file +} From 8aa35cfc764850d2b55996bf04baf970419d42ac Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 23 Jul 2021 12:54:14 +0200 Subject: [PATCH 3/3] Disable clustering Hi, I used your theme today which is pretty cool. However, I was hindered by the fact that clustering got enabled automatically and hid some cyclenodes, so I disabled it. --- assets/themes/cyclenodes/cyclenodes.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/themes/cyclenodes/cyclenodes.json b/assets/themes/cyclenodes/cyclenodes.json index d70eae42ba..7dedd64611 100644 --- a/assets/themes/cyclenodes/cyclenodes.json +++ b/assets/themes/cyclenodes/cyclenodes.json @@ -20,6 +20,10 @@ "startZoom": 11, "widenFactor": 0.05, "roamingRenderings": [], + "clustering":{ + "maxZoom": 11, + "minNeededElements": 1000000 + }, "layers": [ { "id": "node2node",