MapComplete/assets/themes/zhv/zhv.json

198 lines
No EOL
5.9 KiB
JSON

{
"id": "zhv",
"title": {
"en": "ZHV Import Tool"
},
"description": {
"en": "Small theme allowing import of bus stops from the Zentrales Haltestellenverzeichnis in Germany."
},
"icon": "./assets/layers/transit_stops/bus_stop.svg",
"hideFromOverview": true,
"layers": [
{
"id": "zhv",
"name": {
"en": "Public transport stops in ZHV"
},
"title": {
"render": {
"en": "Public transport stop in ZHV"
}
},
"minzoom": 15,
"source": {
"geoJson": "https://robinlinde.github.io/tiles/zhv_haltestellen/{z}/{x}/{y}.json",
"geoJsonZoomLevel": 15,
"osmTags": "Type~Q"
},
"tagRenderings": [
{
"id": "name",
"render": {
"en": "This stop is called {Name}"
}
},
{
"id": "id",
"render": {
"en": "The ID of this stop is {_ifopt}"
}
},
{
"id": "closest_stop",
"render": {
"en": "The closest stop in OSM is <a href=#{_closest_osm_stop}>{_closest_osm_stop_name}</a>."
}
},
{
"id": "import",
"render": {
"special": {
"type": "import_button",
"targetLayer": "transit_stops",
"tags": "_tags",
"text": {
"en": "Add this stop"
}
}
},
"condition": {
"or": [
"_has_closeby_feature=no",
"_has_closeby_feature=maybe"
]
}
},
{
"id": "tag-hint",
"render": {
"en": "This stop will get the following tags: <b>{_tags}</b>"
},
"condition": {
"or": [
"_has_closeby_feature=no",
"_has_closeby_feature=maybe"
]
}
},
{
"id": "imported",
"render": {
"en": "This stop is (probably) already added. <a href=#{_closest_osm_stop_id}>View the point</a>."
},
"condition": {
"or": [
"_has_closeby_feature=yes",
"_has_closeby_feature=maybe"
]
}
},
{
"id": "minimap_with_poi",
"render": "{minimap(18, id, _closest_osm_stop_id):height:10rem}"
}
],
"pointRendering": [
{
"marker": [
{
"icon": "circle",
"color": {
"render": "red",
"mappings": [
{
"if": "_has_closeby_feature=yes",
"then": "green"
},
{
"if": "_has_closeby_feature=maybe",
"then": "orange"
}
]
}
}
],
"location": [
"point",
"centroid"
],
"iconSize": "20,20"
}
],
"calculatedTags": [
"_closest_osm_stop_id=closest(feat)('transit_stops')?.properties?.id",
"_closest_osm_stop_distance=distanceTo(feat)(feat.properties._closest_osm_stop_id)",
"_closest_osm_stop_name=closest(feat)('transit_stops')?.properties?.name",
"_closest_osm_stop_ifopt=closest(feat)('transit_stops')?.properties?.['ref:IFOPT']",
"_has_closeby_feature=(feat.properties._closest_osm_stop_ifopt === feat.properties._ifopt) ? 'yes' : (feat.properties._closest_osm_stop_distance < 15 ? 'yes' : (feat.properties._closest_osm_stop_distance > 25 ? 'no' : 'maybe'))",
"_ifopt=feat.properties.DHID",
"_tags='public_transport=platform;ref:IFOPT='+feat.properties._ifopt+';name='+feat.properties.Name"
]
},
{
"builtin": "transit_stops",
"override": {
"name": {
"en": "Public transport stops in OSM"
},
"tagRenderings+": [
{
"id": "ifopt",
"question": {
"en": "What is the IFOPT reference of this stop?"
},
"render": {
"en": "The IFOPT reference of this stop is {ref:IFOPT}."
},
"freeform": {
"key": "ref:IFOPT",
"type": "string",
"placeholder": {
"en": "e.g. NL:Q:15003950 or de:03457:15801::2"
}
}
},
{
"id": "zhv_stop",
"condition": "_has_closeby_feature=yes",
"render": {
"en": "There is a ZHV stop nearby: <a href=#{_closest_zhv_stop_id}>{_closest_zhv_stop_name}</a>."
}
},
{
"id": "zhv_apply",
"condition": {
"and": [
"_has_closeby_feature=yes",
"ref:IFOPT!~*"
]
},
"render": {
"special": {
"type": "tag_apply",
"tags_to_apply": "ref:IFOPT=$_ifopt",
"id_of_object_to_apply_this_one": "_closest_osm_stop_id",
"message": {
"en": "Add IFOPT to this stop"
},
"image": "./assets/svg/addSmall.svg"
}
}
},
{
"id": "minimap_with_poi",
"condition": "_has_closeby_feature=yes",
"render": "{minimap(18, id, _closest_zhv_stop_id):height:10rem}"
}
],
"calculatedTags": [
"_closest_zhv_stop_id=closest(feat)('zhv')?.properties?.id",
"_closest_zhv_stop_distance=distanceTo(feat)(feat.properties._closest_zhv_stop_id)",
"_closest_zhv_stop_name=closest(feat)('zhv')?.properties?.Name",
"_has_closeby_feature=feat.properties._closest_zhv_stop_distance < 25",
"_ifopt=closest(feat)('zhv')?.properties?.DHID"
]
}
}
]
}