diff --git a/mobility_on_demand/explore.ipynb b/mobility_on_demand/explore.ipynb index 3feda7e..d2502e1 100644 --- a/mobility_on_demand/explore.ipynb +++ b/mobility_on_demand/explore.ipynb @@ -2,14 +2,45 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T03:14:53.243107Z", - "start_time": "2020-05-19T03:14:51.486925Z" + "end_time": "2020-07-09T22:39:10.910409Z", + "start_time": "2020-07-09T22:39:09.275751Z" } }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/code/venvs/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n", + "/code/venvs/venv/lib/python3.6/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n", + " np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n" + ] + } + ], "source": [ "from __future__ import print_function\n", "from IPython.display import display, clear_output\n", @@ -31,26 +62,23 @@ "%matplotlib inline" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## H3 Coordinates" + ] + }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T03:14:55.028176Z", - "start_time": "2020-05-19T03:14:53.244526Z" + "end_time": "2020-05-28T18:22:14.295963Z", + "start_time": "2020-05-28T18:22:12.556108Z" } }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Looking in indexes: https://pypi.org/simple, https://pypi.lyft.net/pypi/\n", - "Requirement already satisfied: h3 in /code/venvs/venv/lib/python3.6/site-packages (3.4.3)\n", - "Note: you may need to restart the kernel to use updated packages.\n" - ] - } - ], + "outputs": [], "source": [ "%pip install h3\n", "\n", @@ -66,11 +94,11 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T03:14:55.032259Z", - "start_time": "2020-05-19T03:14:55.029834Z" + "end_time": "2020-05-28T18:22:14.300001Z", + "start_time": "2020-05-28T18:22:14.297629Z" } }, "outputs": [], @@ -78,13 +106,20 @@ "bounding_box = ([30.727818,104.043333],[30.726490,104.129076],[30.655191,104.129591],[30.652828,104.042102])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Given Hex Coordinates" + ] + }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 43, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T03:14:55.090205Z", - "start_time": "2020-05-19T03:14:55.033480Z" + "end_time": "2020-06-10T18:18:17.843042Z", + "start_time": "2020-06-10T18:18:17.718004Z" } }, "outputs": [], @@ -92,6 +127,7 @@ "import csv\n", "\n", "coords = []\n", + "polygon = dict()\n", "ids = []\n", "\n", "lats = 0\n", @@ -103,35 +139,24 @@ " lng = sum([float(row[i]) for i in range(1, 13, 2)]) / 6\n", " lat = sum([float(row[i]) for i in range(2, 13, 2)]) / 6\n", " coords.append((lat, lng))\n", - " lats += lat\n" + " polygon[row[0]] = (list(zip([float(row[i]) for i in range(2, 13, 2)], \n", + " [float(row[i]) for i in range(1, 13, 2)])))\n" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T03:14:55.130540Z", - "start_time": "2020-05-19T03:14:55.091271Z" + "end_time": "2020-05-28T18:22:14.412262Z", + "start_time": "2020-05-28T18:22:14.373163Z" } }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "5973d1e3fdf1f878 5973d1e3fdf1f878\n", - "27471aff3df268a1 27471aff3df268a1\n", - "15948343c6223064 15948343c6223064\n", - "386c78bc3c226d88 (30.65924666666667, 104.12614)\n", - "926d27c14e84f5d0 (30.73054666666667, 104.04442)\n", - "111297464a0c9cc8 (30.725296666666665, 104.13031000000001)\n" - ] - } - ], + "outputs": [], "source": [ "from scipy.spatial import KDTree\n", "\n", + "\n", "tree = KDTree(coords)\n", "_, i = tree.query((30.71, 104.50))\n", "print('5973d1e3fdf1f878', ids[i])\n", @@ -149,13 +174,20 @@ "print(ids[i], coords[i])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Cancellation Probability" + ] + }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T03:15:29.896385Z", - "start_time": "2020-05-19T03:14:55.131615Z" + "end_time": "2020-07-09T22:39:56.289379Z", + "start_time": "2020-07-09T22:39:21.216590Z" } }, "outputs": [ @@ -180,6 +212,9 @@ } ], "source": [ + "import csv\n", + "\n", + "\n", "cancel_rates = [0] * 10\n", "total_rows = 0\n", "for date in range(1,31):\n", @@ -199,8 +234,8 @@ "execution_count": 7, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T03:15:30.028094Z", - "start_time": "2020-05-19T03:15:29.897871Z" + "end_time": "2020-07-09T22:39:56.421438Z", + "start_time": "2020-07-09T22:39:56.291133Z" } }, "outputs": [ @@ -214,7 +249,7 @@ { "data": { "text/plain": [ - "[]" + "[]" ] }, "execution_count": 7, @@ -223,7 +258,7 @@ }, { "data": { - "image/png": "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\n", + "image/png": "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\n", "text/plain": [ "
" ] @@ -249,13 +284,225 @@ " " ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Time" + ] + }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-05-28T18:22:17.498117Z", + "start_time": "2020-05-28T18:21:42.657Z" + } + }, + "outputs": [], + "source": [ + "import time\n", + "\n", + "time.gmtime(148865000).tm_hour" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Online Search Hyperparameters" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-05-28T18:22:17.498772Z", + "start_time": "2020-05-28T18:21:43.424Z" + } + }, + "outputs": [], + "source": [ + "import random\n", + "\n", + "# dql: {true, false}\n", + "dql = random.random() < 0.5\n", + "# alpha: [0.0001, 0.1] (log)\n", + "alpha = 10 ** -(3 * random.random() + 1)\n", + "# gamma: [0.99, 0.99999] (log)\n", + "gamma = 1 - 10 ** -(3 * random.random() + 2)\n", + "# idle reward: [-1e-2, 0] (log)\n", + "penalize_idle = random.random() < 0.5\n", + "idle_reward = -1e-2 * random.random() if penalize_idle else 0\n", + "# open_request_reward: [0, 0.1] (log)\n", + "open_request_reward = 10 ** (random.random() - 2)\n", + "\n", + "# Random hyperparameter search\n", + "f'd={dql}, a={alpha:.4f}, g={gamma:.6f}, ir={idle_reward:.3f}, orr={open_request_reward:.2f}'" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-05-26T06:41:37.206780Z", + "start_time": "2020-05-26T06:41:37.204512Z" + } + }, + "outputs": [], + "source": [ + "# Default\n", + "f'd=False, a=2/(5*60), g=0.9999, ir=-2/(60*60), orr=-2/(60*60)'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Offline Search (orders)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-22T05:30:23.492644Z", + "start_time": "2020-06-22T05:30:20.759711Z" + } + }, + "outputs": [], + "source": [ + "import sys\n", + "\n", + "sys.path.append(\"model\")\n", + "\n", + "import model.grid\n", + "\n", + "\n", + "if 'grid' not in locals():\n", + " grid = model.grid.Grid()\n", + "if 'grid_cache' not in locals():\n", + " grid_cache = dict()\n", + "if 'dither_cache' not in locals():\n", + " dither_cache = dict()\n", + "\n", + "\n", + "def cached_lookup(lng, lat):\n", + " if (lng, lat) in grid_cache:\n", + " return grid_cache[(lng, lat)]\n", + " grid_id = grid.lookup(lng, lat)\n", + " grid_cache[(lng, lat)] = grid_id\n", + " return grid_id" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-22T05:30:29.488665Z", + "start_time": "2020-06-22T05:30:29.483529Z" + } + }, + "outputs": [], + "source": [ + "import collections\n", + "import time\n", + "\n", + "\n", + "def _get_state(grid_id: str, t: float):\n", + " t = time.gmtime(t)\n", + " return grid_id #, 24 * t.tm_wday + t.tm_hour\n", + "\n", + "\n", + "def state_value(grid_id: str, t: float, state_values) -> float:\n", + " # TODO: time/space kernel\n", + " u = (t % 3600) / 3600\n", + " #print(f'{time.asctime(time.gmtime(t))}: {(1 - u)} * {_get_state(grid_id, t)} + {u} * {_get_state(grid_id, t + 3600)}')\n", + " return (1 - u) * state_values[_get_state(grid_id, t)] + \\\n", + " u * state_values[_get_state(grid_id, t + 3600)]\n", + "\n", + "\n", + "def update_state_value(grid_id: str, t: float, delta: float, state_values, counts) -> None:\n", + " # TODO: time/space kernel\n", + " u = (t % 3600) / 3600\n", + " state_values[_get_state(grid_id, t)] += (1 - u) * delta\n", + " state_values[_get_state(grid_id, t + 3600)] += u * delta\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-22T05:30:30.274903Z", + "start_time": "2020-06-22T05:30:30.265169Z" + } + }, + "outputs": [], + "source": [ + "import collections\n", + "import csv\n", + "import math\n", + "\n", + "\n", + "def fetch_examples():\n", + " dates, start_grids, start_times, end_grids, end_times, rewards = [], [], [], [], [], []\n", + " for date in range(1, 31):\n", + " with open(f'data/total_ride_request/order_201611{date:02d}', 'r') as csvfile:\n", + " for row in csv.reader(csvfile):\n", + " dates.append(date)\n", + " order_id, start_sec, end_sec, start_lng, start_lat, end_lng, end_lat, reward = row\n", + " start_times.append(float(start_sec))\n", + " end_times.append(float(end_sec))\n", + " rewards.append(float(reward))\n", + " start_grid = cached_lookup(float(start_lng), float(start_lat)) \n", + " end_grid = cached_lookup(float(end_lng), float(end_lat))\n", + " start_grids.append(start_grid)\n", + " end_grids.append(end_grid)\n", + " data = {\n", + " 'date': dates,\n", + " 'start_grid': start_grids,\n", + " 'start_time': start_times,\n", + " 'end_grid': end_grids,\n", + " 'end_time': end_times,\n", + " 'reward': rewards, \n", + " }\n", + " return pd.DataFrame(data)\n", + "\n", + "\n", + "def hp_search(alpha, gamma, examples, state_values=None, counts=None, eval_start_date=24):\n", + " if state_values is None:\n", + " state_values = collections.defaultdict(float)\n", + " counts = collections.defaultdict(float)\n", + " \n", + " updates = []\n", + " for i, row in examples.iterrows():\n", + " s0 = state_values[row.start_grid]\n", + " s1 = state_values[row.end_grid]\n", + " \n", + " # One-step TD Error (this is Learnable, unlike Bellman Error or Value Error)\n", + " update = (row.reward + gamma * s1 - s0)\n", + " state_values[row.start_grid] = s0 + alpha * update\n", + " #update_state_value[row.start_grid, row.start_time, alpha * update, state_values)\n", + " \n", + " if row.date >= eval_start_date:\n", + " updates.append(update)\n", + " return state_values, pd.Series(updates)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T03:15:30.037654Z", - "start_time": "2020-05-19T03:15:30.029578Z" + "end_time": "2020-06-22T05:39:32.210689Z", + "start_time": "2020-06-22T05:30:31.178891Z" } }, "outputs": [ @@ -263,84 +510,6416 @@ "name": "stdout", "output_type": "stream", "text": [ - "['0', '8bc6f140185f6d4d', '8bc6f140185f6d4d', '1.0']\n" + "(2458,)\n" ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
datestart_timeend_timereward
count7.065937e+067.065937e+067.065937e+067.065937e+06
mean1.581136e+011.479261e+091.479263e+094.224453e+00
std8.618927e+007.447905e+057.447896e+052.854039e+00
min1.000000e+001.477930e+091.477930e+091.000000e-02
25%8.000000e+001.478612e+091.478613e+092.190000e+00
50%1.600000e+011.479279e+091.479280e+093.410000e+00
75%2.300000e+011.479903e+091.479904e+095.180000e+00
max3.000000e+011.480522e+091.480582e+091.074600e+02
\n", + "
" + ], + "text/plain": [ + " date start_time end_time reward\n", + "count 7.065937e+06 7.065937e+06 7.065937e+06 7.065937e+06\n", + "mean 1.581136e+01 1.479261e+09 1.479263e+09 4.224453e+00\n", + "std 8.618927e+00 7.447905e+05 7.447896e+05 2.854039e+00\n", + "min 1.000000e+00 1.477930e+09 1.477930e+09 1.000000e-02\n", + "25% 8.000000e+00 1.478612e+09 1.478613e+09 2.190000e+00\n", + "50% 1.600000e+01 1.479279e+09 1.479280e+09 3.410000e+00\n", + "75% 2.300000e+01 1.479903e+09 1.479904e+09 5.180000e+00\n", + "max 3.000000e+01 1.480522e+09 1.480582e+09 1.074600e+02" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ - "with open('data/idle_transition_probability', 'r') as csvfile:\n", - " for row in csv.reader(csvfile):\n", - " print(row)\n", - " break" + "examples = fetch_examples()\n", + "print(examples.start_grid.unique().shape)\n", + "examples.describe()" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 6, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T03:15:30.041349Z", - "start_time": "2020-05-19T03:15:30.038766Z" + "end_time": "2020-06-14T04:03:02.767179Z", + "start_time": "2020-06-14T03:49:19.415475Z" } }, "outputs": [ { - "data": { - "text/plain": [ - "23" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "0.033333, 0.900000: 0.0769331667887762, 3.760957583882774, 14.150712474732426\n", + "3404\n" + ] } ], "source": [ - "import time\n", - "\n", - "time.gmtime(148865000).tm_hour" + "alpha = 10/(5*60)\n", + "gamma = 0.9\n", + "state_values, updates = hp_search(alpha, gamma, examples)\n", + "print(f'{alpha:.6f}, {gamma:.6f}: {updates.mean()}, {updates.std()}, {np.power(updates, 2).mean()}')\n", + "print(len(state_values))" ] }, { "cell_type": "code", - "execution_count": 148, + "execution_count": 8, "metadata": { "ExecuteTime": { - "end_time": "2020-05-19T06:05:26.102985Z", - "start_time": "2020-05-19T06:05:26.099404Z" + "end_time": "2020-06-22T15:52:15.673611Z", + "start_time": "2020-06-22T06:15:19.963634Z" } }, "outputs": [ { - "data": { - "text/plain": [ - "'dql=False, alpha=0.0584, gamma=0.996014, idle_reward=-0.009'" - ] - }, - "execution_count": 148, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "0.247138, 0.900000: 0.014700675819376877, 4.049081828850633, 16.39527027925193\n", + "0.328591, 0.900000: 0.011533344545831232, 4.251275242950836, 18.07346375084675\n", + "0.276340, 0.900000: 0.013371481023723972, 4.11780121874731, 16.95645586151205\n", + "0.089446, 0.900000: 0.034270731087465284, 3.7551106302801416, 14.102022168897454\n", + "0.323559, 0.900000: 0.011686911505330053, 4.237802816876659, 17.95909890629363\n", + "0.016518, 0.900000: 0.1415514245093175, 3.887451427318619, 15.132306660506547\n", + "0.004539, 0.900000: 0.4600728529161816, 4.499384851638774, 20.456119358264992\n", + "0.160528, 0.900000: 0.021128654042381425, 3.868777953598702, 14.9678806130496\n", + "0.309930, 0.900000: 0.012125416745002194, 4.201991275187454, 17.65686748504674\n", + "0.194976, 0.900000: 0.01795346330311523, 3.9362169736826482, 15.494117424938654\n", + "0.113260, 0.900000: 0.02822887719912342, 3.7877591666092805, 14.347908071480225\n", + "0.173030, 0.900000: 0.019844250689444544, 3.8925586810752693, 15.152398111871026\n", + "0.192145, 0.900000: 0.018175365819868797, 3.9304533128298873, 15.448784648682208\n", + "0.338169, 0.900000: 0.011252473702829906, 4.277302764285072, 18.295434968556748\n", + "0.038913, 0.900000: 0.06761283096212156, 3.7468596160315646, 14.043520353223247\n", + "0.095432, 0.900000: 0.03250003367516706, 3.7625293465098393, 14.157675143508703\n", + "0.161028, 0.900000: 0.02107382579581601, 3.869713061608672, 14.975114619907584\n", + "0.331940, 0.900000: 0.011433470993326422, 4.260318400061216, 18.15043309110149\n", + "0.049626, 0.900000: 0.05535809471584207, 3.734024513730513, 13.94599551941805\n", + "0.113327, 0.900000: 0.028215048754118333, 3.7878615850870436, 14.348683174044991\n", + "0.294317, 0.900000: 0.012672635793455081, 4.162153481136272, 17.323672171615158\n", + "0.384587, 0.900000: 0.010072362083762946, 4.410944095214889, 19.456518004720753\n", + "0.077621, 0.900000: 0.03847429376259614, 3.742646483073449, 14.008874862866469\n", + "0.171847, 0.900000: 0.01995855275648763, 3.8902729388245785, 15.134613124644419\n", + "0.058916, 0.900000: 0.0481382429301283, 3.7321397942823022, 13.931176674267878\n", + "0.077228, 0.900000: 0.03863381324177051, 3.7422924714434638, 14.00623740920524\n", + "0.290771, 0.900000: 0.012804297012143081, 4.153278043698201, 17.249872476377647\n", + "0.304699, 0.900000: 0.012303101031539502, 4.1885055455692255, 17.543719919600903\n", + "0.131216, 0.900000: 0.024991434483427676, 3.8166029360024782, 14.567074113715151\n", + "0.257532, 0.900000: 0.014196385496084138, 4.073077578407975, 16.590152896963517\n", + "0.157000, 0.900000: 0.02152446318980814, 3.862219549272524, 14.917194517415407\n", + "0.232532, 0.900000: 0.015477888072112025, 4.016210660588538, 16.13017830131285\n", + "0.012493, 0.900000: 0.18221701157512235, 3.9728631353169774, 15.816835397734202\n", + "0.327640, 0.900000: 0.011562032572855846, 4.248719256001781, 18.05173855097332\n", + "0.375148, 0.900000: 0.010290819716586182, 4.382716906517473, 19.208302268414087\n", + "0.357471, 0.900000: 0.010728020934762708, 4.331323388602773, 18.760466531015126\n", + "0.033563, 0.900000: 0.07648998125851357, 3.760233891748323, 14.145201455850335\n", + "0.084489, 0.900000: 0.03590489598159237, 3.7494899486690314, 14.0599559013797\n", + "0.284839, 0.900000: 0.01303116726422509, 4.138570132804173, 17.127922644121384\n", + "0.329984, 0.900000: 0.011491574542014648, 4.255029741343489, 18.105399679005785\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0malpha\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0.4\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mrandom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mgamma\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0.9\u001b[0m \u001b[0;31m# Larger values always have higher absolute error\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 6\u001b[0;31m \u001b[0mstate_values\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mupdates\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mhp_search\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0malpha\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgamma\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexamples\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 7\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf'{alpha:.6f}, {gamma:.6f}: {updates.mean()}, {updates.std()}, {np.power(updates, 2).mean()}'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0mresults\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0malpha\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgamma\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mupdates\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmean\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mupdates\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstd\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpower\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mupdates\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmean\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m\u001b[0m in \u001b[0;36mhp_search\u001b[0;34m(alpha, gamma, examples, state_values, counts, eval_start_date)\u001b[0m\n\u001b[1;32m 41\u001b[0m \u001b[0;31m# One-step TD Error (this is Learnable, unlike Bellman Error or Value Error)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 42\u001b[0m \u001b[0mupdate\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mrow\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreward\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mgamma\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0ms1\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0ms0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 43\u001b[0;31m \u001b[0mstate_values\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mrow\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstart_grid\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0ms0\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0malpha\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0mupdate\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 44\u001b[0m \u001b[0;31m#update_state_value[row.start_grid, row.start_time, alpha * update, state_values)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 45\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/code/venvs/venv/lib/python3.6/site-packages/pandas/core/generic.py\u001b[0m in \u001b[0;36m__getattr__\u001b[0;34m(self, name)\u001b[0m\n\u001b[1;32m 5064\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5065\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_info_axis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_can_hold_identifiers_and_holds_name\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 5066\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5067\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mobject\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__getattribute__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5068\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/code/venvs/venv/lib/python3.6/site-packages/pandas/core/series.py\u001b[0m in \u001b[0;36m__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 866\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mapply_if_callable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 867\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 868\u001b[0;31m \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_value\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 869\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 870\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mis_scalar\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/code/venvs/venv/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36mget_value\u001b[0;34m(self, series, key)\u001b[0m\n\u001b[1;32m 4373\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4374\u001b[0m return self._engine.get_value(s, k,\n\u001b[0;32m-> 4375\u001b[0;31m tz=getattr(series.dtype, 'tz', None))\n\u001b[0m\u001b[1;32m 4376\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4377\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m0\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mholds_integer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_boolean\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] } ], "source": [ - "# dql: {true, false}\n", - "dql = random.random() < 0.5\n", - "# alpha: [0.0001, 0.1] (log)\n", - "alpha = 10 ** -(3 * random.random() + 1)\n", - "# gamma: [0.99, 0.99999] (log)\n", - "gamma = 1 - 10 ** -(3 * random.random() + 2)\n", - "# idle reward: [-1e-2, 0] (linear)\n", - "idle_reward = -1e-2 * random.random()\n", - "\n", - "f'dql={dql}, alpha={alpha:.4f}, gamma={gamma:.6f}, idle_reward={idle_reward:.3f}'" + "state_values = collections.defaultdict(float)\n", + "results = []\n", + "for _ in range(100):\n", + " alpha = 0.4 * random.random()\n", + " gamma = 0.9 # Larger values always have higher absolute error\n", + " state_values, updates = hp_search(alpha, gamma, examples)\n", + " print(f'{alpha:.6f}, {gamma:.6f}: {updates.mean()}, {updates.std()}, {np.power(updates, 2).mean()}')\n", + " results.append([alpha, gamma, updates.mean(), updates.std(), np.power(updates, 2).mean()])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-22T15:52:15.675233Z", + "start_time": "2020-06-22T06:14:35.665Z" + } + }, + "outputs": [], + "source": [ + "sorted_results = pd.DataFrame(results, columns=['alpha', 'gamma', 'update_mean', 'update_std', 'mse']).\\\n", + " sort_values('mse')\n", + "display(sorted_results.head())" ] }, { "cell_type": "code", "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-22T15:52:15.675966Z", + "start_time": "2020-06-22T06:14:37.809Z" + } + }, + "outputs": [], + "source": [ + "if sorted_results is not None:\n", + " alpha, gamma = sorted_results.iloc[0].alpha, sorted_results.iloc[0].gamma\n", + " print(alpha, gamma)\n", + " best, best_counts, best_err = dict(state_values), collections.defaultdict(), float('inf')\n", + " for t in range(100):\n", + " state_values, updates = hp_search(alpha, gamma, \n", + " examples,\n", + " state_values=dict(best))\n", + " print(examples.shape, len(state_values), len(best))\n", + " print(f'{alpha:.6f}, {gamma:.6f}: {updates.mean()}, {updates.std()}, {np.power(updates, 2).mean()}')\n", + " err = np.power(updates, 2).mean()\n", + " if err < best_err:\n", + " best, best_err = dict(state_values), err\n", + " \n", + " print(len(best))\n", + " with open(f'model/init_values.csv', 'w', newline='') as csvfile:\n", + " writer = csv.writer(csvfile)\n", + " for grid_id, value in best.items():\n", + " writer.writerow([grid_id, value])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "start_time": "2020-06-14T22:24:53.127Z" + } + }, + "outputs": [], + "source": [ + "print('Done.')" + ] + }, + { + "cell_type": "markdown", "metadata": {}, + "source": [ + "## Offline Search (No Alpha)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-16T19:02:03.931524Z", + "start_time": "2020-06-16T19:02:03.927059Z" + } + }, "outputs": [], - "source": [] + "source": [ + "def hp_search_mean(gamma, examples, state_values=None, counts=None, eval_start_date=24):\n", + " if state_values is None:\n", + " state_values = collections.defaultdict(float)\n", + " counts = collections.defaultdict(float)\n", + " \n", + " updates = []\n", + " for i, row in examples.iterrows():\n", + " s0 = state_values[row.start_grid]\n", + " s1 = state_values[row.end_grid]\n", + " \n", + " # One-step TD Error (this is Learnable, unlike Bellman Error or Value Error)\n", + " update = (row.reward + gamma * s1 - s0)\n", + " counts[row.start_grid] += 1\n", + " state_values[row.start_grid] = s0 + (1 / counts[row.start_grid]) * update\n", + " #update_state_value[row.start_grid, row.start_time, alpha * update, state_values)\n", + " \n", + " if row.date >= eval_start_date:\n", + " updates.append(update)\n", + " return state_values, counts, pd.Series(updates)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-16T19:17:42.310697Z", + "start_time": "2020-06-16T19:02:04.430308Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.900000: 1.5387248702028653, 3.574807521730899, 15.14691564862541\n" + ] + }, + { + "data": { + "text/plain": [ + "count 2458.000000\n", + "mean 2874.669243\n", + "std 13316.927116\n", + "min 1.000000\n", + "25% 3.000000\n", + "50% 19.500000\n", + "75% 309.750000\n", + "max 266250.000000\n", + "dtype: float64" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3404\n" + ] + } + ], + "source": [ + "gamma = 0.9\n", + "state_values, counts, updates = hp_search_mean(gamma, examples)\n", + "print(f'{gamma:.6f}: {updates.mean()}, {updates.std()}, {np.power(updates, 2).mean()}')\n", + "display(pd.Series(list(counts.values())).describe())\n", + "print(len(state_values))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Offline Search (GPS)" + ] + }, + { + "cell_type": "code", + "execution_count": 151, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-13T03:46:49.695429Z", + "start_time": "2020-06-13T03:46:49.689186Z" + } + }, + "outputs": [], + "source": [ + "import sys\n", + "\n", + "sys.path.append(\"model\")\n", + "\n", + "import model.grid\n", + "\n", + "if 'grid' not in locals():\n", + " grid = model.grid.Grid()\n", + "if 'grid_cache' not in locals():\n", + " grid_cache = dict()\n", + "if 'dither_cache' not in locals():\n", + " dither_cache = dict()\n", + "\n", + "def cached_lookup(lng, lat):\n", + " if (lng, lat) in grid_cache:\n", + " return grid_cache[(lng, lat)]\n", + " grid_id = grid.lookup(lng, lat)\n", + " grid_cache[(lng, lat)] = grid_id\n", + " return grid_id \n", + " \n", + "def dither_lookup(lng, lat):\n", + " if (lng, lat) in dither_cache:\n", + " return random.choice(dither_cache[(lng, lat)])\n", + " _, indices = grid.kdtree.query([lng, lat], k=7)\n", + " grid_ids = [grid.grid_ids[i] for i in indices]\n", + " dither_cache[(lng, lat)] = grid_ids\n", + " return random.choice(grid_ids)" + ] + }, + { + "cell_type": "code", + "execution_count": 152, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-13T03:46:50.262289Z", + "start_time": "2020-06-13T03:46:50.257318Z" + } + }, + "outputs": [], + "source": [ + "import collections\n", + "import time\n", + "\n", + "\n", + "def _get_state(grid_id: str, t: float):\n", + " t = time.gmtime(t)\n", + " return (grid_id, 24 * t.tm_wday + t.tm_hour)\n", + "\n", + "\n", + "def state_value(grid_id: str, t: float, state_values) -> float:\n", + " # TODO: time/space kernel\n", + " u = (t % 3600) / 3600\n", + " #print(f'{time.asctime(time.gmtime(t))}: {(1 - u)} * {_get_state(grid_id, t)} + {u} * {_get_state(grid_id, t + 3600)}')\n", + " return (1 - u) * state_values[_get_state(grid_id, t)] + \\\n", + " u * state_values[_get_state(grid_id, t + 3600)]\n", + "\n", + "\n", + "def update_state_value(grid_id: str, t: float, delta: float, state_values) -> None:\n", + " # TODO: time/space kernel\n", + " u = (t % 3600) / 3600\n", + " state_values[_get_state(grid_id, t)] += (1 - u) * delta\n", + " state_values[_get_state(grid_id, t + 3600)] += u * delta\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 153, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-13T03:46:51.213670Z", + "start_time": "2020-06-13T03:46:51.209575Z" + } + }, + "outputs": [], + "source": [ + "import csv\n", + "\n", + "def order_rewards(start_date=1, end_date=31):\n", + " rewards = dict()\n", + " for date in range(start_date, end_date): # 31\n", + " with open(f'data/total_ride_request/order_201611{date:02d}', 'r') as csvfile:\n", + " for row in csv.reader(csvfile):\n", + " order_id, start_sec, end_sec, start_lng, start_lat, end_lng, end_lat, reward = row\n", + " start_grid = cached_lookup(float(start_lng), float(start_lat))\n", + " end_grid = cached_lookup(float(end_lng), float(end_lat))\n", + " rewards[order_id] = (float(reward), start_grid, end_grid)\n", + " return rewards" + ] + }, + { + "cell_type": "code", + "execution_count": 154, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-13T03:46:51.771436Z", + "start_time": "2020-06-13T03:46:51.768816Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "6105003\n" + ] + } + ], + "source": [ + "if 'reward_dict' not in locals():\n", + " reward_dict = order_rewards()\n", + "print(len(reward_dict))" + ] + }, + { + "cell_type": "code", + "execution_count": 172, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-13T07:37:49.296130Z", + "start_time": "2020-06-13T07:37:49.287414Z" + } + }, + "outputs": [], + "source": [ + "import collections\n", + "import csv\n", + "import math\n", + "\n", + "\n", + "def fetch_gps_examples():\n", + " dates, start_grids, start_times, end_grids, end_times, rewards = [], [], [], [], [], []\n", + " starts = set()\n", + " for date in range(1, 31):\n", + " print(date, len(starts))\n", + " with open(f'data/gps_201611{date:02d}', 'r') as csvfile:\n", + " \n", + " # Iterate rows, update whenever the driver_id/order_id change using first and last GPS\n", + " current_driver_id = None\n", + " for row in csv.reader(csvfile):\n", + " driver_id, order_id, time, lng, lat = row \n", + "\n", + " if current_driver_id is None:\n", + " # First row\n", + " current_driver_id, current_order_id, start_time, start_lng, start_lat = row\n", + " elif driver_id == current_driver_id and order_id == current_order_id:\n", + " # Ignore the middle of a ride trajectory\n", + " pass\n", + " elif driver_id != current_driver_id and order_id == current_order_id:\n", + " # Reassigned new driver (don't update state values)\n", + " current_driver_id, current_order_id, start_time, start_lng, start_lat = row\n", + " elif driver_id == current_driver_id and order_id != current_order_id:\n", + " # Driver gets a new ride immediately? Cancellation?\n", + " current_driver_id, current_order_id, start_time, start_lng, start_lat = row\n", + " else:\n", + " # Update last ride \n", + " _, _, end_time, end_lng, end_lat = prev_row\n", + " reward, _, _ = reward_dict[current_order_id] \n", + " \n", + " dates.append(date)\n", + " start_times.append(float(start_time))\n", + " end_times.append(float(end_time))\n", + " rewards.append(float(reward))\n", + " start_grid = cached_lookup(float(start_lng), float(start_lat)) \n", + " end_grid = cached_lookup(float(end_lng), float(end_lat))\n", + " start_grids.append(start_grid)\n", + " end_grids.append(end_grid) \n", + " starts.add(start_grid)\n", + "\n", + " # Update current driver/order\n", + " current_driver_id, current_order_id, start_time, start_lng, start_lat = row\n", + "\n", + " # Update last values for next iteration\n", + " prev_row = row\n", + " data = {\n", + " 'date': dates,\n", + " 'start_grid': start_grids,\n", + " 'start_time': start_times,\n", + " 'end_grid': end_grids,\n", + " 'end_time': end_times,\n", + " 'reward': rewards, \n", + " }\n", + " return pd.DataFrame(data)" + ] + }, + { + "cell_type": "code", + "execution_count": 173, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-13T07:59:51.285834Z", + "start_time": "2020-06-13T07:37:49.721662Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 0\n", + "2 83\n", + "3 83\n", + "4 83\n", + "5 83\n", + "6 83\n", + "7 83\n", + "8 83\n", + "9 83\n", + "10 83\n", + "11 83\n", + "12 83\n", + "13 83\n", + "14 83\n", + "15 83\n", + "16 83\n", + "17 83\n", + "18 83\n", + "19 83\n", + "20 83\n", + "21 83\n", + "22 83\n", + "23 83\n", + "24 83\n", + "25 83\n", + "26 83\n", + "27 83\n", + "28 83\n", + "29 83\n", + "30 83\n", + "(83,)\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
datestart_timeend_timereward
count1.181150e+061.181150e+061.181150e+061.181150e+06
mean1.580122e+011.479261e+091.479261e+094.850169e+00
std8.620514e+007.449773e+057.449758e+053.389141e+00
min1.000000e+001.477930e+091.477930e+093.000000e-02
25%8.000000e+001.478613e+091.478614e+092.520000e+00
50%1.600000e+011.479279e+091.479279e+093.920000e+00
75%2.300000e+011.479906e+091.479906e+095.920000e+00
max3.000000e+011.480522e+091.480522e+091.074600e+02
\n", + "
" + ], + "text/plain": [ + " date start_time end_time reward\n", + "count 1.181150e+06 1.181150e+06 1.181150e+06 1.181150e+06\n", + "mean 1.580122e+01 1.479261e+09 1.479261e+09 4.850169e+00\n", + "std 8.620514e+00 7.449773e+05 7.449758e+05 3.389141e+00\n", + "min 1.000000e+00 1.477930e+09 1.477930e+09 3.000000e-02\n", + "25% 8.000000e+00 1.478613e+09 1.478614e+09 2.520000e+00\n", + "50% 1.600000e+01 1.479279e+09 1.479279e+09 3.920000e+00\n", + "75% 2.300000e+01 1.479906e+09 1.479906e+09 5.920000e+00\n", + "max 3.000000e+01 1.480522e+09 1.480522e+09 1.074600e+02" + ] + }, + "execution_count": 173, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "gps_examples = fetch_gps_examples()\n", + "print(gps_examples.start_grid.unique().shape)\n", + "gps_examples.describe()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-02T14:45:38.220844Z", + "start_time": "2020-06-02T00:12:19.346248Z" + } + }, + "outputs": [], + "source": [ + "results = []\n", + "for _ in range(100):\n", + " alpha = 10 ** -(2 * random.random())\n", + " gamma = 1 - 10 ** -(3 * random.random())\n", + " state_values, updates = hp_search_gps(alpha, gamma)\n", + " print(f'{alpha:.6f}, {gamma:.6f}: {updates.mean()}, {updates.std()}, {np.power(updates, 2).mean()}')\n", + " results.append([alpha, gamma, updates.mean(), updates.std(), np.power(updates, 2).mean()])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-02T14:45:40.929806Z", + "start_time": "2020-06-02T14:45:40.917041Z" + } + }, + "outputs": [], + "source": [ + "sorted_results = pd.DataFrame(results, columns=['alpha', 'gamma', 'update_mean', 'update_std', 'mse']).\\\n", + " sort_values('mse')\n", + "display(sorted_results.head())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-02T19:06:16.971743Z", + "start_time": "2020-06-02T14:45:46.803229Z" + } + }, + "outputs": [], + "source": [ + "alpha = 2/(5*60), gamma=0.999\n", + "if sorted_results is not None:\n", + " alpha, gamma = sorted_results.iloc[0].alpha, sorted_results.iloc[0].gamma\n", + " print(alpha, gamma)\n", + " state_values = collections.defaultdict(float)\n", + " last_err = float('inf')\n", + " early_stopping = 0\n", + " for _ in range(32):\n", + " state_values, updates = hp_search_gps(alpha, gamma, state_values=state_values, dither=True)\n", + " print(f'{alpha:.6f}, {gamma:.6f}: {updates.mean()}, {updates.std()}, {np.power(updates, 2).mean()}')\n", + " err = np.power(updates, 2).mean()\n", + " if err > last_err:\n", + " early_stopping += 1\n", + " if early_stopping > 4:\n", + " break\n", + " last_err = err \n", + " with open(f'model/init_values.csv', 'w', newline='') as csvfile:\n", + " writer = csv.writer(csvfile)\n", + " for (grid_id, hour), value in state_values.items():\n", + " writer.writerow([grid_id, hour, value])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-02T19:06:25.691645Z", + "start_time": "2020-06-02T19:06:25.523715Z" + } + }, + "outputs": [], + "source": [ + " with open(f'model/init_values.csv', 'w', newline='') as csvfile:\n", + " writer = csv.writer(csvfile)\n", + " for (grid_id, hour), value in state_values.items():\n", + " writer.writerow([grid_id, hour, value])\n", + "print('Done.')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Value Approximation" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-08T18:44:11.896933Z", + "start_time": "2020-06-08T18:44:09.738025Z" + } + }, + "outputs": [], + "source": [ + "import sys\n", + "\n", + "sys.path.append(\"model\")\n", + "\n", + "import model.grid\n", + "\n", + "if 'grid' not in locals():\n", + " grid = model.grid.Grid()\n", + "if 'grid_cache' not in locals():\n", + " grid_cache = dict()\n", + "if 'dither_cache' not in locals():\n", + " dither_cache = dict()\n", + "\n", + "def cached_lookup(lng, lat):\n", + " if (lng, lat) in grid_cache:\n", + " return grid_cache[(lng, lat)]\n", + " grid_id = grid.lookup(lng, lat)\n", + " grid_cache[(lng, lat)] = grid_id\n", + " return grid_id \n", + " \n", + "def dither_lookup(lng, lat):\n", + " if (lng, lat) in dither_cache:\n", + " return random.choice(dither_cache[(lng, lat)])\n", + " _, indices = grid.kdtree.query([lng, lat], k=7)\n", + " grid_ids = [grid.grid_ids[i] for i in indices]\n", + " dither_cache[(lng, lat)] = grid_ids\n", + " return random.choice(grid_ids)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-08T18:44:11.902649Z", + "start_time": "2020-06-08T18:44:11.898497Z" + } + }, + "outputs": [], + "source": [ + "import csv\n", + "\n", + "def order_rewards(start_date=1, end_date=31):\n", + " rewards = dict()\n", + " for date in range(start_date, end_date): # 31\n", + " with open(f'data/total_ride_request/order_201611{date:02d}', 'r') as csvfile:\n", + " for row in csv.reader(csvfile):\n", + " order_id, start_sec, end_sec, start_lng, start_lat, end_lng, end_lat, reward = row\n", + " start_grid = cached_lookup(float(start_lng), float(start_lat))\n", + " end_grid = cached_lookup(float(end_lng), float(end_lat))\n", + " rewards[order_id] = (float(reward), start_grid, end_grid)\n", + " return rewards" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-08T18:52:55.441951Z", + "start_time": "2020-06-08T18:44:11.903852Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "6105003\n" + ] + } + ], + "source": [ + "if 'reward_dict' not in locals():\n", + " reward_dict = order_rewards()\n", + "print(len(reward_dict))" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-08T18:52:55.453538Z", + "start_time": "2020-06-08T18:52:55.443751Z" + } + }, + "outputs": [], + "source": [ + "def get_rides(start_date=1, end_date=31):\n", + " dates, rewards = [], []\n", + " start_lngs, start_lats, start_grids, start_times = [], [], [], []\n", + " end_lngs, end_lats, end_grids, end_times = [], [], [], []\n", + " for date in range(start_date, end_date):\n", + " with open(f'data/gps_201611{date:02d}', 'r') as csvfile:\n", + " # Iterate rows, update whenever the driver_id/order_id change using first and last GPS\n", + " current_driver_id = None\n", + " for row in csv.reader(csvfile):\n", + " driver_id, order_id, time, lng, lat = row \n", + "\n", + " if current_driver_id is None:\n", + " # First row\n", + " current_driver_id, current_order_id, start_time, start_lng, start_lat = row\n", + " elif driver_id == current_driver_id and order_id == current_order_id:\n", + " # Ignore the middle of a ride trajectory\n", + " pass\n", + " elif driver_id != current_driver_id and order_id == current_order_id:\n", + " # Reassigned new driver (don't update state values)\n", + " current_driver_id, current_order_id, start_time, start_lng, start_lat = row\n", + " elif driver_id == current_driver_id and order_id != current_order_id:\n", + " # Driver gets a new ride immediately? Cancellation?\n", + " current_driver_id, current_order_id, start_time, start_lng, start_lat = row\n", + " else:\n", + " # Update last ride \n", + " end_driver_id, end_order_id, end_time, end_lng, end_lat = prev_row\n", + " if end_driver_id == current_driver_id and end_order_id == current_order_id:\n", + " reward, _, _ = reward_dict[current_order_id] \n", + "\n", + " dates.append(date)\n", + " rewards.append(reward)\n", + " start_lngs.append(float(start_lng))\n", + " start_lats.append(float(start_lat))\n", + " start_grids.append(cached_lookup(float(start_lng), float(start_lat)))\n", + " start_times.append(float(start_time))\n", + " end_lngs.append(float(end_lng))\n", + " end_lats.append(float(end_lat))\n", + " end_grids.append(cached_lookup(float(end_lng), float(end_lat)))\n", + " end_times.append(float(end_time))\n", + " else:\n", + " print(f'Error: {current_driver_id}!={end_driver_id}, {current_order_id}!={end_order_id}')\n", + "\n", + " # Update current driver/order\n", + " current_driver_id, current_order_id, start_time, start_lng, start_lat = row\n", + "\n", + " # Update last values for next iteration\n", + " prev_row = row\n", + "\n", + " data = {\n", + " 'date': dates,\n", + " 'reward': rewards,\n", + " 'start_lng': start_lngs,\n", + " 'start_lat': start_lats,\n", + " 'start_grid': start_grids,\n", + " 'start_time': start_times,\n", + " 'end_lng': end_lngs,\n", + " 'end_lat': end_lats,\n", + " 'end_grid': end_grids,\n", + " 'end_time': end_times,\n", + " }\n", + " return pd.DataFrame(data)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-08T19:15:33.074940Z", + "start_time": "2020-06-08T18:52:55.454585Z" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
daterewardstart_lngstart_latstart_timeend_lngend_latend_timetrip_time
count1.181150e+061.181150e+061.181150e+061.181150e+061.181150e+061.181150e+061.181150e+061.181150e+061.181150e+06
mean1.580122e+014.850169e+001.040757e+023.067842e+011.479261e+091.040752e+023.067732e+011.479261e+095.001613e+02
std8.620514e+003.389141e+002.574828e-022.280551e-027.449773e+052.675577e-022.388427e-027.449758e+054.159094e+02
min1.000000e+003.000000e-021.040421e+023.065294e+011.477930e+091.040421e+023.065294e+011.477930e+09-2.815800e+04
25%8.000000e+002.520000e+001.040521e+023.065840e+011.478613e+091.040496e+023.065535e+011.478614e+091.890000e+02
50%1.600000e+013.920000e+001.040731e+023.067146e+011.479279e+091.040721e+023.066893e+011.479279e+094.230000e+02
75%2.300000e+015.920000e+001.040963e+023.069293e+011.479906e+091.040973e+023.069310e+011.479906e+097.050000e+02
max3.000000e+011.074600e+021.041296e+023.072775e+011.480522e+091.041296e+023.072775e+011.480522e+094.219700e+04
\n", + "
" + ], + "text/plain": [ + " date reward start_lng start_lat start_time \\\n", + "count 1.181150e+06 1.181150e+06 1.181150e+06 1.181150e+06 1.181150e+06 \n", + "mean 1.580122e+01 4.850169e+00 1.040757e+02 3.067842e+01 1.479261e+09 \n", + "std 8.620514e+00 3.389141e+00 2.574828e-02 2.280551e-02 7.449773e+05 \n", + "min 1.000000e+00 3.000000e-02 1.040421e+02 3.065294e+01 1.477930e+09 \n", + "25% 8.000000e+00 2.520000e+00 1.040521e+02 3.065840e+01 1.478613e+09 \n", + "50% 1.600000e+01 3.920000e+00 1.040731e+02 3.067146e+01 1.479279e+09 \n", + "75% 2.300000e+01 5.920000e+00 1.040963e+02 3.069293e+01 1.479906e+09 \n", + "max 3.000000e+01 1.074600e+02 1.041296e+02 3.072775e+01 1.480522e+09 \n", + "\n", + " end_lng end_lat end_time trip_time \n", + "count 1.181150e+06 1.181150e+06 1.181150e+06 1.181150e+06 \n", + "mean 1.040752e+02 3.067732e+01 1.479261e+09 5.001613e+02 \n", + "std 2.675577e-02 2.388427e-02 7.449758e+05 4.159094e+02 \n", + "min 1.040421e+02 3.065294e+01 1.477930e+09 -2.815800e+04 \n", + "25% 1.040496e+02 3.065535e+01 1.478614e+09 1.890000e+02 \n", + "50% 1.040721e+02 3.066893e+01 1.479279e+09 4.230000e+02 \n", + "75% 1.040973e+02 3.069310e+01 1.479906e+09 7.050000e+02 \n", + "max 1.041296e+02 3.072775e+01 1.480522e+09 4.219700e+04 " + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "rides = get_rides()\n", + "rides['trip_time'] = rides.end_time - rides.start_time\n", + "rides.describe()" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-08T19:15:33.562137Z", + "start_time": "2020-06-08T19:15:33.076754Z" + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
daterewardstart_lngstart_latstart_timeend_lngend_latend_timetrip_time
count1.159929e+061.159929e+061.159929e+061.159929e+061.159929e+061.159929e+061.159929e+061.159929e+061.159929e+06
mean1.580206e+014.826621e+001.040757e+023.067838e+011.479261e+091.040752e+023.067726e+011.479261e+095.100682e+02
std8.620766e+003.355847e+002.579135e-022.281845e-027.449972e+052.681393e-022.391356e-027.449956e+054.035518e+02
min1.000000e+003.000000e-021.040421e+023.065294e+011.477930e+091.040421e+023.065294e+011.477930e+091.000000e+00
25%8.000000e+002.520000e+001.040521e+023.065835e+011.478613e+091.040494e+023.065529e+011.478613e+092.020000e+02
50%1.600000e+013.910000e+001.040731e+023.067141e+011.479279e+091.040721e+023.066878e+011.479279e+094.320000e+02
75%2.300000e+015.890000e+001.040964e+023.069281e+011.479906e+091.040973e+023.069307e+011.479906e+097.110000e+02
max3.000000e+011.074600e+021.041296e+023.072775e+011.480522e+091.041296e+023.072775e+011.480522e+097.107000e+03
\n", + "
" + ], + "text/plain": [ + " date reward start_lng start_lat start_time \\\n", + "count 1.159929e+06 1.159929e+06 1.159929e+06 1.159929e+06 1.159929e+06 \n", + "mean 1.580206e+01 4.826621e+00 1.040757e+02 3.067838e+01 1.479261e+09 \n", + "std 8.620766e+00 3.355847e+00 2.579135e-02 2.281845e-02 7.449972e+05 \n", + "min 1.000000e+00 3.000000e-02 1.040421e+02 3.065294e+01 1.477930e+09 \n", + "25% 8.000000e+00 2.520000e+00 1.040521e+02 3.065835e+01 1.478613e+09 \n", + "50% 1.600000e+01 3.910000e+00 1.040731e+02 3.067141e+01 1.479279e+09 \n", + "75% 2.300000e+01 5.890000e+00 1.040964e+02 3.069281e+01 1.479906e+09 \n", + "max 3.000000e+01 1.074600e+02 1.041296e+02 3.072775e+01 1.480522e+09 \n", + "\n", + " end_lng end_lat end_time trip_time \n", + "count 1.159929e+06 1.159929e+06 1.159929e+06 1.159929e+06 \n", + "mean 1.040752e+02 3.067726e+01 1.479261e+09 5.100682e+02 \n", + "std 2.681393e-02 2.391356e-02 7.449956e+05 4.035518e+02 \n", + "min 1.040421e+02 3.065294e+01 1.477930e+09 1.000000e+00 \n", + "25% 1.040494e+02 3.065529e+01 1.478613e+09 2.020000e+02 \n", + "50% 1.040721e+02 3.066878e+01 1.479279e+09 4.320000e+02 \n", + "75% 1.040973e+02 3.069307e+01 1.479906e+09 7.110000e+02 \n", + "max 1.041296e+02 3.072775e+01 1.480522e+09 7.107000e+03 " + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "filtered_rides = rides[(rides.trip_time > 0) & (rides.trip_time < 7200)]\n", + "filtered_rides.describe()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-08T19:15:35.532109Z", + "start_time": "2020-06-08T19:15:33.563505Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "FEATURE_DIM=8550\n" + ] + } + ], + "source": [ + "import ctypes as c\n", + "import math\n", + "import time\n", + "from multiprocessing import Array, Pool, Manager\n", + "\n", + " \n", + "FEATURE_DIM = 8550\n", + "SECONDS_PER_HOUR = 60*60\n", + "SECONDS_PER_DAY = 60*60*24\n", + "\n", + "\n", + "grid_index = {grid_id: i for i, grid_id in enumerate(grid.grid_ids)}\n", + "neighbors = dict() # type: Dict[str, List[int]]\n", + "for grid_id, coord in grid.grids.items():\n", + " _, indices = grid.kdtree.query(coord, 7)\n", + " neighbors[grid_id] = indices\n", + "\n", + "\n", + "def featurize(lng: float, lat: float, grid_id: str, t: float, time_noise=0, location_noise=0): \n", + " features = np.zeros(FEATURE_DIM)\n", + " features[0] = 1\n", + " offset = 1\n", + " \n", + " for i in neighbors[grid_id]:\n", + " features[offset + i] = 0.5\n", + " features[offset + grid_index[grid_id]] = 1\n", + " offset += len(grid_index)\n", + "\n", + " t = time.gmtime(t)\n", + " u = (((60 * t.tm_min) + t.tm_sec) % SECONDS_PER_HOUR) / SECONDS_PER_HOUR\n", + " features[offset + t.tm_hour] = 1 - u\n", + " features[offset + (t.tm_hour + 1) % 24] = u\n", + " offset += 24\n", + "\n", + " u = ((60 * (60 * t.tm_hour + t.tm_min) + t.tm_sec) % SECONDS_PER_DAY) / SECONDS_PER_DAY\n", + " features[offset + t.tm_wday] = 1 - u\n", + " features[offset + (t.tm_wday + 1) % 7] = u\n", + " offset += 7\n", + " \n", + " return features\n", + "\n", + "\n", + "print(f'FEATURE_DIM={len(featurize(0, 0, \"677aa6c9a057914c\", 0))}')" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-08T19:15:35.540361Z", + "start_time": "2020-06-08T19:15:35.533334Z" + } + }, + "outputs": [], + "source": [ + "def process_row(alpha, gamma, row, weights, td_errors, time_noise, location_noise, eval_start_date):\n", + " weights_array = np.array(weights)\n", + " r = row.reward\n", + " start = featurize(row.start_lng, row.start_lat, row.start_grid, row.start_time, \n", + " time_noise=time_noise, location_noise=location_noise)\n", + " s0 = sum(start * weights_array)\n", + " end = featurize(row.end_lng, row.end_lat, row.end_grid, row.end_time, \n", + " time_noise=time_noise, location_noise=location_noise)\n", + " s1 = sum(end * weights_array)\n", + "\n", + " # One-step TD Error (this is Learnable, unlike Bellman Error or Value Error) \n", + " error = r + gamma * s1 - s0 \n", + " if row.date > eval_start_date:\n", + " td_errors.append(error) \n", + " \n", + " weight_array = alpha * (r * start - start * sum((start - gamma * end) * weights_array))\n", + " for i, w in enumerate(weight_array):\n", + " weights[i] += w\n", + " \n", + "def linear_approx(alpha, gamma, rides, eval_start_date=24, time_noise=0, location_noise=0, weights=None):\n", + " if weights is None:\n", + " weights = [0] * FEATURE_DIM\n", + " \n", + " manager = Manager()\n", + " with Pool(processes=8) as pool:\n", + " managed_weights = manager.list(weights)\n", + " td_errors = manager.list()\n", + " for i, row in rides.iterrows():\n", + " pool.apply_async(process_row, (alpha, gamma, row, managed_weights, td_errors, \n", + " time_noise, location_noise, eval_start_date))\n", + " pool.close()\n", + " pool.join()\n", + " return managed_weights, pd.Series(list(td_errors[:]))" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-10T17:41:52.014626Z", + "start_time": "2020-06-08T20:26:30.532896Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.006666666666666667 0.9\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Process ForkPoolWorker-2:\n", + "Process ForkPoolWorker-3:\n", + "Process ForkPoolWorker-9:\n", + "Process ForkPoolWorker-7:\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 258, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 258, in _bootstrap\n", + " self.run()\n" + ] + }, + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36mlinear_approx\u001b[0;34m(alpha, gamma, rides, eval_start_date, time_noise, location_noise, weights)\u001b[0m\n\u001b[1;32m 31\u001b[0m \u001b[0mpool\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 32\u001b[0;31m \u001b[0mpool\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 33\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mmanaged_weights\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSeries\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtd_errors\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/pool.py\u001b[0m in \u001b[0;36mjoin\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 545\u001b[0m \u001b[0;32massert\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_state\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mCLOSE\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTERMINATE\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 546\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_worker_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 547\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_task_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/threading.py\u001b[0m in \u001b[0;36mjoin\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 1055\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtimeout\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1056\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_wait_for_tstate_lock\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1057\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/threading.py\u001b[0m in \u001b[0;36m_wait_for_tstate_lock\u001b[0;34m(self, block, timeout)\u001b[0m\n\u001b[1;32m 1071\u001b[0m \u001b[0;32massert\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_is_stopped\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1072\u001b[0;31m \u001b[0;32melif\u001b[0m \u001b[0mlock\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0macquire\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mblock\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1073\u001b[0m \u001b[0mlock\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrelease\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: ", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mgamma\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m0.9\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0malpha\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgamma\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mweights\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mupdates\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlinear_approx\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0malpha\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mgamma\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfiltered_rides\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mupdates\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdescribe\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mweights\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mweights\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m\u001b[0m in \u001b[0;36mlinear_approx\u001b[0;34m(alpha, gamma, rides, eval_start_date, time_noise, location_noise, weights)\u001b[0m\n\u001b[1;32m 30\u001b[0m time_noise, location_noise, eval_start_date))\n\u001b[1;32m 31\u001b[0m \u001b[0mpool\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 32\u001b[0;31m \u001b[0mpool\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 33\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mmanaged_weights\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSeries\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtd_errors\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/pool.py\u001b[0m in \u001b[0;36m__exit__\u001b[0;34m(self, exc_type, exc_val, exc_tb)\u001b[0m\n\u001b[1;32m 609\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 610\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__exit__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexc_type\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexc_val\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexc_tb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 611\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mterminate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 612\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 613\u001b[0m \u001b[0;31m#\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/pool.py\u001b[0m in \u001b[0;36mterminate\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 539\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_state\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mTERMINATE\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 540\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_worker_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_state\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mTERMINATE\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 541\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_terminate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 542\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 543\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/util.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, wr, _finalizer_registry, sub_debug, getpid)\u001b[0m\n\u001b[1;32m 184\u001b[0m sub_debug('finalizer calling %s with args %s and kwargs %s',\n\u001b[1;32m 185\u001b[0m self._callback, self._args, self._kwargs)\n\u001b[0;32m--> 186\u001b[0;31m \u001b[0mres\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_callback\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_args\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_kwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 187\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_weakref\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_callback\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_args\u001b[0m \u001b[0;34m=\u001b[0m\u001b[0;31m \u001b[0m\u001b[0;31m\\\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 188\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_kwargs\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_key\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/pool.py\u001b[0m in \u001b[0;36m_terminate_pool\u001b[0;34m(cls, taskqueue, inqueue, outqueue, pool, worker_handler, task_handler, result_handler, cache)\u001b[0m\n\u001b[1;32m 569\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 570\u001b[0m \u001b[0mutil\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'helping task handler/workers to finish'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 571\u001b[0;31m \u001b[0mcls\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_help_stuff_finish\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minqueue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtask_handler\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpool\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 572\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 573\u001b[0m \u001b[0;32massert\u001b[0m \u001b[0mresult_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_alive\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcache\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/pool.py\u001b[0m in \u001b[0;36m_help_stuff_finish\u001b[0;34m(inqueue, task_handler, size)\u001b[0m\n\u001b[1;32m 556\u001b[0m \u001b[0minqueue\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_rlock\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0macquire\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 557\u001b[0m \u001b[0;32mwhile\u001b[0m \u001b[0mtask_handler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_alive\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0minqueue\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_reader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpoll\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 558\u001b[0;31m \u001b[0minqueue\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_reader\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrecv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 559\u001b[0m \u001b[0mtime\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 560\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/connection.py\u001b[0m in \u001b[0;36mrecv\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 249\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_check_readable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[0mbuf\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_recv_bytes\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 251\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_ForkingPickler\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloads\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbuf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgetbuffer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 252\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 253\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mpoll\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0.0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/managers.py\u001b[0m in \u001b[0;36mRebuildProxy\u001b[0;34m(func, token, serializer, kwds)\u001b[0m\n\u001b[1;32m 879\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mprocess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrent_process\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'_inheriting'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 880\u001b[0m )\n\u001b[0;32m--> 881\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtoken\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mserializer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mincref\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mincref\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwds\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 882\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 883\u001b[0m \u001b[0;31m#\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/managers.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, token, serializer, manager, authkey, exposed, incref, manager_owned)\u001b[0m\n\u001b[1;32m 729\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 730\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mincref\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 731\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_incref\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 732\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 733\u001b[0m \u001b[0mutil\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mregister_after_fork\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mBaseProxy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_after_fork\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/managers.py\u001b[0m in \u001b[0;36m_incref\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 783\u001b[0m \u001b[0;32mreturn\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 784\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 785\u001b[0;31m \u001b[0mconn\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_Client\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_token\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maddress\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mauthkey\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_authkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 786\u001b[0m \u001b[0mdispatch\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mconn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'incref'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_id\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 787\u001b[0m \u001b[0mutil\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdebug\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'INCREF %r'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_token\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mid\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/connection.py\u001b[0m in \u001b[0;36mClient\u001b[0;34m(address, family, authkey)\u001b[0m\n\u001b[1;32m 485\u001b[0m \u001b[0mc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mPipeClient\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0maddress\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 486\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 487\u001b[0;31m \u001b[0mc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mSocketClient\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0maddress\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 488\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 489\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mauthkey\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mauthkey\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbytes\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/usr/lib/python3.6/multiprocessing/connection.py\u001b[0m in \u001b[0;36mSocketClient\u001b[0;34m(address)\u001b[0m\n\u001b[1;32m 612\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0msocket\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msocket\u001b[0m\u001b[0;34m(\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msocket\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfamily\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0ms\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 613\u001b[0m \u001b[0ms\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msetblocking\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 614\u001b[0;31m \u001b[0ms\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconnect\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0maddress\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 615\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mConnection\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdetach\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 616\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 258, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 258, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 93, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 93, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 93, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 93, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib/python3.6/multiprocessing/pool.py\", line 119, in worker\n", + " result = (True, func(*args, **kwds))\n", + " File \"/usr/lib/python3.6/multiprocessing/pool.py\", line 119, in worker\n", + " result = (True, func(*args, **kwds))\n", + " File \"/usr/lib/python3.6/multiprocessing/pool.py\", line 119, in worker\n", + " result = (True, func(*args, **kwds))\n", + " File \"/usr/lib/python3.6/multiprocessing/pool.py\", line 119, in worker\n", + " result = (True, func(*args, **kwds))\n", + " File \"\", line 2, in process_row\n", + " weights_array = np.array(weights)\n", + " File \"\", line 2, in process_row\n", + " weights_array = np.array(weights)\n", + " File \"\", line 18, in process_row\n", + " weights[i] += w\n", + " File \"\", line 18, in process_row\n", + " weights[i] += w\n", + " File \"\", line 2, in __getitem__\n", + " File \"\", line 2, in __getitem__\n", + " File \"\", line 2, in __setitem__\n", + " File \"\", line 2, in __setitem__\n", + " File \"/usr/lib/python3.6/multiprocessing/managers.py\", line 757, in _callmethod\n", + " kind, result = conn.recv()\n", + " File \"/usr/lib/python3.6/multiprocessing/managers.py\", line 757, in _callmethod\n", + " kind, result = conn.recv()\n", + " File \"/usr/lib/python3.6/multiprocessing/managers.py\", line 757, in _callmethod\n", + " kind, result = conn.recv()\n", + " File \"/usr/lib/python3.6/multiprocessing/managers.py\", line 757, in _callmethod\n", + " kind, result = conn.recv()\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 250, in recv\n", + " buf = self._recv_bytes()\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 250, in recv\n", + " buf = self._recv_bytes()\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 250, in recv\n", + " buf = self._recv_bytes()\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 250, in recv\n", + " buf = self._recv_bytes()\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 407, in _recv_bytes\n", + " buf = self._recv(4)\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 407, in _recv_bytes\n", + " buf = self._recv(4)\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 407, in _recv_bytes\n", + " buf = self._recv(4)\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 407, in _recv_bytes\n", + " buf = self._recv(4)\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 379, in _recv\n", + " chunk = read(handle, remaining)\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 379, in _recv\n", + " chunk = read(handle, remaining)\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 379, in _recv\n", + " chunk = read(handle, remaining)\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 379, in _recv\n", + " chunk = read(handle, remaining)\n", + "KeyboardInterrupt\n", + "KeyboardInterrupt\n", + "KeyboardInterrupt\n", + "KeyboardInterrupt\n", + "Process ForkPoolWorker-8:\n", + "Process ForkPoolWorker-5:\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 258, in _bootstrap\n", + " self.run()\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 93, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 258, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib/python3.6/multiprocessing/pool.py\", line 119, in worker\n", + " result = (True, func(*args, **kwds))\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 93, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"\", line 18, in process_row\n", + " weights[i] += w\n", + " File \"\", line 2, in __getitem__\n", + " File \"/usr/lib/python3.6/multiprocessing/pool.py\", line 119, in worker\n", + " result = (True, func(*args, **kwds))\n", + " File \"/usr/lib/python3.6/multiprocessing/managers.py\", line 757, in _callmethod\n", + " kind, result = conn.recv()\n", + " File \"\", line 18, in process_row\n", + " weights[i] += w\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 250, in recv\n", + " buf = self._recv_bytes()\n", + " File \"\", line 2, in __setitem__\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 407, in _recv_bytes\n", + " buf = self._recv(4)\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 379, in _recv\n", + " chunk = read(handle, remaining)\n", + " File \"/usr/lib/python3.6/multiprocessing/managers.py\", line 757, in _callmethod\n", + " kind, result = conn.recv()\n", + "KeyboardInterrupt\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 250, in recv\n", + " buf = self._recv_bytes()\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 407, in _recv_bytes\n", + " buf = self._recv(4)\n", + " File \"/usr/lib/python3.6/multiprocessing/connection.py\", line 379, in _recv\n", + " chunk = read(handle, remaining)\n", + "KeyboardInterrupt\n", + "Process ForkPoolWorker-6:\n", + "Process ForkPoolWorker-4:\n", + "Traceback (most recent call last):\n", + "Traceback (most recent call last):\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 258, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 258, in _bootstrap\n", + " self.run()\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 93, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib/python3.6/multiprocessing/process.py\", line 93, in run\n", + " self._target(*self._args, **self._kwargs)\n", + " File \"/usr/lib/python3.6/multiprocessing/pool.py\", line 108, in worker\n", + " task = get()\n", + " File \"/usr/lib/python3.6/multiprocessing/pool.py\", line 108, in worker\n", + " task = get()\n", + " File \"/usr/lib/python3.6/multiprocessing/queues.py\", line 334, in get\n", + " with self._rlock:\n", + " File \"/usr/lib/python3.6/multiprocessing/queues.py\", line 334, in get\n", + " with self._rlock:\n", + " File \"/usr/lib/python3.6/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + " File \"/usr/lib/python3.6/multiprocessing/synchronize.py\", line 95, in __enter__\n", + " return self._semlock.__enter__()\n", + "KeyboardInterrupt\n", + "KeyboardInterrupt\n" + ] + } + ], + "source": [ + "alpha = 2 / (5 * 60)\n", + "gamma = 0.9\n", + "print(alpha, gamma)\n", + "weights, updates = linear_approx(alpha, gamma, filtered_rides)\n", + "print(updates.describe())\n", + "print(len(weights), weights)\n", + "print(f'{alpha:.6f}, {gamma:.6f}: {updates.mean()}, {updates.std()}, {np.power(updates, 2).mean()}')" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-06T21:44:58.181144Z", + "start_time": "2020-06-06T21:44:58.175937Z" + } + }, + "outputs": [], + "source": [ + "def value_iteration(alpha, gamma, filtered_rides, iterations=32, early_stopping=1, samples=1e7, \n", + " time_noise=60*15, location_noise=1e-3):\n", + " last_err = float('inf')\n", + " weights = [0] * FEATURE_DIM\n", + " stop_counter = 0\n", + " for i in range(iterations):\n", + " sampled_rides = filtered_rides.sample(n=int(samples), replace=True)\n", + " weights, errors = linear_approx(alpha, gamma, sampled_rides, weights=weights, \n", + " time_noise=time_noise, location_noise=location_noise)\n", + " print(f'\\t{i}, {alpha:.6f}, {gamma:.6f}: {errors.mean()}, {errors.std()}, {np.power(errors, 2).mean()}')\n", + " print(f'\\t\\t{weights}')\n", + " err = np.power(errors, 2).mean()\n", + " if err > last_err:\n", + " stop_counter += 1\n", + " if stop_counter >= early_stopping:\n", + " break\n", + " last_err = err \n", + " return weights, errors" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-06T21:43:49.070022Z", + "start_time": "2020-06-06T21:43:48.733747Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Done\n" + ] + } + ], + "source": [ + " with open(f'model/linear_approx_{FEATURE_DIM}.csv', 'w') as csvfile:\n", + " writer = csv.writer(csvfile)\n", + " writer.writerow(weights) \n", + " print('Done')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-06T20:32:20.299412Z", + "start_time": "2020-06-06T19:08:58.138386Z" + } + }, + "outputs": [], + "source": [ + "# Search Alpha, Gamma\n", + "results = []\n", + "for _ in range(100):\n", + " alpha = 10 ** -(2 * random.random())\n", + " gamma = 1 - 10 ** -(2 * random.random())\n", + " weights, updates = value_iteration(alpha, gamma, filtered_rides, samples=1e6, iterations=1, early_stopping=1)\n", + " print(f'{alpha:.6f}, {gamma:.6f}: {updates.mean()}, {updates.std()}, {np.power(updates, 2).mean()}')\n", + " results.append([alpha, gamma, updates.mean(), updates.std(), np.power(updates, 2).mean()])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-06T20:32:20.301597Z", + "start_time": "2020-06-06T19:08:22.364Z" + } + }, + "outputs": [], + "source": [ + "sorted_results = pd.DataFrame(results, \n", + " columns=['alpha', 'gamma', 'update_mean', 'update_std', 'mse']).sort_values('mse')\n", + "display(sorted_results.head())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-06T20:32:20.302357Z", + "start_time": "2020-06-06T19:08:31.438Z" + } + }, + "outputs": [], + "source": [ + "import pickle\n", + "\n", + "\n", + "# Train\n", + "if sorted_results is not None:\n", + " alpha, gamma = sorted_results.iloc[0].alpha, sorted_results.iloc[0].gamma\n", + " print(alpha, gamma)\n", + " weights, updates = value_iteration(alpha, gamma, filtered_rides,\n", + " samples=1e7, iterations=3, early_stopping=1)\n", + " with open(f'model/linear_approx_{FEATURE_DIM}.csv', 'w') as csvfile:\n", + " writer = csv.writer(csvfile)\n", + " writer.writerow(weights) \n", + " print('Done')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Inspect state values" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "ExecuteTime": { + "end_time": "2020-07-07T22:55:50.095365Z", + "start_time": "2020-07-07T22:55:49.959380Z" + } + }, + "outputs": [], + "source": [ + "import csv\n", + "\n", + "coords = []\n", + "polygon = dict()\n", + "ids = []\n", + "\n", + "lats = 0\n", + "with open('data/hexagon_grid_table.csv', 'r') as csvfile:\n", + " for row in csv.reader(csvfile):\n", + " if len(row) != 13:\n", + " continue\n", + " ids.append(row[0]) \n", + " lng = sum([float(row[i]) for i in range(1, 13, 2)]) / 6\n", + " lat = sum([float(row[i]) for i in range(2, 13, 2)]) / 6\n", + " coords.append((lat, lng))\n", + " polygon[row[0]] = (list(zip([float(row[i]) for i in range(2, 13, 2)], \n", + " [float(row[i]) for i in range(1, 13, 2)])))\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "ExecuteTime": { + "end_time": "2020-07-07T22:55:53.055016Z", + "start_time": "2020-07-07T22:55:52.889704Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "{'version': 8,\n", + " 'name': 'Basic',\n", + " 'metadata': {'mapbox:type': 'default',\n", + " 'mapbox:origin': 'basic-v1',\n", + " 'mapbox:sdk-support': {'js': '1.9.0', 'android': '8.6.0', 'ios': '5.6.0'},\n", + " 'mapbox:autocomposite': True,\n", + " 'mapbox:groups': {'Road network, traffic-and-closures': {'name': 'Road network, traffic-and-closures',\n", + " 'collapsed': False},\n", + " 'Transit, transit-labels': {'name': 'Transit, transit-labels',\n", + " 'collapsed': False},\n", + " 'Administrative boundaries, admin': {'name': 'Administrative boundaries, admin',\n", + " 'collapsed': False},\n", + " 'Land & water, built': {'name': 'Land & water, built', 'collapsed': False},\n", + " 'Transit, bridges': {'name': 'Transit, bridges', 'collapsed': False},\n", + " 'Transit, surface': {'name': 'Transit, surface', 'collapsed': False},\n", + " 'Land & water, land': {'name': 'Land & water, land', 'collapsed': False},\n", + " 'Road network, bridges': {'name': 'Road network, bridges',\n", + " 'collapsed': False},\n", + " 'Road network, tunnels': {'name': 'Road network, tunnels',\n", + " 'collapsed': False},\n", + " 'Road network, road-labels': {'name': 'Road network, road-labels',\n", + " 'collapsed': False},\n", + " 'Buildings, built': {'name': 'Buildings, built', 'collapsed': False},\n", + " 'Natural features, natural-labels': {'name': 'Natural features, natural-labels',\n", + " 'collapsed': False},\n", + " 'Road network, surface': {'name': 'Road network, surface',\n", + " 'collapsed': False},\n", + " 'Walking, cycling, etc., barriers-bridges': {'name': 'Walking, cycling, etc., barriers-bridges',\n", + " 'collapsed': False},\n", + " 'Place labels, place-labels': {'name': 'Place labels, place-labels',\n", + " 'collapsed': False},\n", + " 'Point of interest labels, poi-labels': {'name': 'Point of interest labels, poi-labels',\n", + " 'collapsed': False},\n", + " 'Walking, cycling, etc., tunnels': {'name': 'Walking, cycling, etc., tunnels',\n", + " 'collapsed': False},\n", + " 'Road network, tunnels-case': {'name': 'Road network, tunnels-case',\n", + " 'collapsed': False},\n", + " 'Walking, cycling, etc., walking-cycling-labels': {'name': 'Walking, cycling, etc., walking-cycling-labels',\n", + " 'collapsed': False},\n", + " 'Walking, cycling, etc., surface': {'name': 'Walking, cycling, etc., surface',\n", + " 'collapsed': False},\n", + " 'Transit, built': {'name': 'Transit, built', 'collapsed': False},\n", + " 'Road network, surface-icons': {'name': 'Road network, surface-icons',\n", + " 'collapsed': False},\n", + " 'Land & water, water': {'name': 'Land & water, water',\n", + " 'collapsed': False}}},\n", + " 'center': [104.05519132674772, 30.65779911262051],\n", + " 'zoom': 13.115269073336819,\n", + " 'bearing': 0,\n", + " 'pitch': 0,\n", + " 'sources': {'mapbox://mapbox.mapbox-traffic-v1': {'url': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'type': 'vector'},\n", + " 'mapbox://mapbox.mapbox-incidents-v1': {'url': 'mapbox://mapbox.mapbox-incidents-v1',\n", + " 'type': 'vector'},\n", + " 'composite': {'url': 'mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v8',\n", + " 'type': 'vector'}},\n", + " 'sprite': 'mapbox://sprites/laxatives/ckbkw1qa114hp1iploj57us76/6in03c0rey8lea14moulozapz',\n", + " 'glyphs': 'mapbox://fonts/laxatives/{fontstack}/{range}.pbf',\n", + " 'layers': [{'id': 'land',\n", + " 'type': 'background',\n", + " 'layout': {},\n", + " 'paint': {'background-color': 'hsl(216, 36%, 16%)'},\n", + " 'metadata': {'mapbox:featureComponent': 'land-and-water',\n", + " 'mapbox:group': 'Land & water, land'}},\n", + " {'id': 'landcover',\n", + " 'type': 'fill',\n", + " 'source': 'composite',\n", + " 'source-layer': 'landcover',\n", + " 'maxzoom': 7,\n", + " 'layout': {},\n", + " 'paint': {'fill-color': ['match',\n", + " ['get', 'class'],\n", + " 'snow',\n", + " 'hsl(216, 38%, 39%)',\n", + " 'hsl(152, 37%, 2%)'],\n", + " 'fill-opacity': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 2,\n", + " 0.3,\n", + " 7,\n", + " 0],\n", + " 'fill-antialias': False},\n", + " 'metadata': {'mapbox:featureComponent': 'land-and-water',\n", + " 'mapbox:group': 'Land & water, land'}},\n", + " {'minzoom': 5,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'land-and-water',\n", + " 'mapbox:group': 'Land & water, land'},\n", + " 'filter': ['==', ['get', 'class'], 'national_park'],\n", + " 'type': 'fill',\n", + " 'source': 'composite',\n", + " 'id': 'national-park',\n", + " 'paint': {'fill-color': 'hsl(170, 37%, 11%)',\n", + " 'fill-opacity': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 5,\n", + " 0,\n", + " 6,\n", + " 0.5,\n", + " 10,\n", + " 0.5]},\n", + " 'source-layer': 'landuse_overlay'},\n", + " {'minzoom': 5,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'land-and-water',\n", + " 'mapbox:group': 'Land & water, land'},\n", + " 'filter': ['match',\n", + " ['get', 'class'],\n", + " ['park', 'airport', 'glacier', 'pitch', 'sand', 'facility'],\n", + " True,\n", + " 'cemetery',\n", + " True,\n", + " 'school',\n", + " True,\n", + " 'hospital',\n", + " True,\n", + " False],\n", + " 'type': 'fill',\n", + " 'source': 'composite',\n", + " 'id': 'landuse',\n", + " 'paint': {'fill-color': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " ['match',\n", + " ['get', 'class'],\n", + " 'park',\n", + " 'hsl(170, 37%, 11%)',\n", + " 'airport',\n", + " 'hsl(213, 39%, 22%)',\n", + " 'cemetery',\n", + " 'hsl(152, 38%, 17%)',\n", + " 'glacier',\n", + " 'hsl(197, 38%, 26%)',\n", + " 'hospital',\n", + " 'hsl(204, 29%, 18%)',\n", + " 'pitch',\n", + " 'hsl(170, 38%, 6%)',\n", + " 'sand',\n", + " 'hsl(215, 37%, 2%)',\n", + " 'school',\n", + " 'hsl(213, 34%, 12%)',\n", + " 'hsl(216, 39%, 15%)'],\n", + " 16,\n", + " ['match',\n", + " ['get', 'class'],\n", + " 'park',\n", + " 'hsl(170, 37%, 11%)',\n", + " 'airport',\n", + " 'hsl(213, 53%, 20%)',\n", + " 'cemetery',\n", + " 'hsl(152, 38%, 17%)',\n", + " 'glacier',\n", + " 'hsl(197, 38%, 26%)',\n", + " 'hospital',\n", + " 'hsl(204, 19%, 20%)',\n", + " 'pitch',\n", + " 'hsl(170, 38%, 6%)',\n", + " 'sand',\n", + " 'hsl(215, 37%, 2%)',\n", + " 'school',\n", + " 'hsl(213, 34%, 12%)',\n", + " 'hsl(216, 39%, 15%)']],\n", + " 'fill-opacity': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 5,\n", + " 0,\n", + " 6,\n", + " ['match', ['get', 'class'], 'glacier', 0.5, 1]]},\n", + " 'source-layer': 'landuse'},\n", + " {'minzoom': 15,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'land-and-water',\n", + " 'mapbox:group': 'Land & water, land'},\n", + " 'filter': ['==', ['get', 'class'], 'pitch'],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'pitch-outline',\n", + " 'paint': {'line-color': 'hsl(152, 21%, 2%)'},\n", + " 'source-layer': 'landuse'},\n", + " {'id': 'waterway',\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'source-layer': 'waterway',\n", + " 'minzoom': 8,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 11, 'round'],\n", + " 'line-join': 'round'},\n", + " 'paint': {'line-color': 'hsl(197, 48%, 6%)',\n", + " 'line-width': ['interpolate',\n", + " ['exponential', 1.3],\n", + " ['zoom'],\n", + " 9,\n", + " ['match', ['get', 'class'], ['canal', 'river'], 0.1, 0],\n", + " 20,\n", + " ['match', ['get', 'class'], ['canal', 'river'], 8, 3]],\n", + " 'line-opacity': ['interpolate', ['linear'], ['zoom'], 8, 0, 8.5, 1]},\n", + " 'metadata': {'mapbox:featureComponent': 'land-and-water',\n", + " 'mapbox:group': 'Land & water, water'}},\n", + " {'id': 'water',\n", + " 'type': 'fill',\n", + " 'source': 'composite',\n", + " 'source-layer': 'water',\n", + " 'layout': {},\n", + " 'paint': {'fill-color': 'hsl(197, 48%, 6%)'},\n", + " 'metadata': {'mapbox:featureComponent': 'land-and-water',\n", + " 'mapbox:group': 'Land & water, water'}},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'land-and-water',\n", + " 'mapbox:group': 'Land & water, built'},\n", + " 'filter': ['all',\n", + " ['==', ['geometry-type'], 'Polygon'],\n", + " ['==', ['get', 'class'], 'land']],\n", + " 'type': 'fill',\n", + " 'source': 'composite',\n", + " 'id': 'land-structure-polygon',\n", + " 'paint': {'fill-color': 'hsl(216, 36%, 16%)'},\n", + " 'source-layer': 'structure'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'land-and-water',\n", + " 'mapbox:group': 'Land & water, built'},\n", + " 'filter': ['all',\n", + " ['==', ['geometry-type'], 'LineString'],\n", + " ['==', ['get', 'class'], 'land']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'land-structure-line',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.99],\n", + " ['zoom'],\n", + " 14,\n", + " 0.75,\n", + " 20,\n", + " 40],\n", + " 'line-color': 'hsl(216, 36%, 16%)'},\n", + " 'source-layer': 'structure'},\n", + " {'minzoom': 11,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'transit',\n", + " 'mapbox:group': 'Transit, built'},\n", + " 'filter': ['all',\n", + " ['==', ['geometry-type'], 'Polygon'],\n", + " ['match', ['get', 'type'], ['runway', 'taxiway', 'helipad'], True, False]],\n", + " 'type': 'fill',\n", + " 'source': 'composite',\n", + " 'id': 'aeroway-polygon',\n", + " 'paint': {'fill-color': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " 'hsl(213, 31%, 13%)',\n", + " 16,\n", + " 'hsl(213, 19%, 15%)'],\n", + " 'fill-opacity': ['interpolate', ['linear'], ['zoom'], 11, 0, 11.5, 1]},\n", + " 'source-layer': 'aeroway'},\n", + " {'minzoom': 9,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'transit',\n", + " 'mapbox:group': 'Transit, built'},\n", + " 'filter': ['==', ['geometry-type'], 'LineString'],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'aeroway-line',\n", + " 'paint': {'line-color': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " 'hsl(213, 31%, 13%)',\n", + " 16,\n", + " 'hsl(213, 19%, 15%)'],\n", + " 'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 9,\n", + " ['match', ['get', 'type'], 'runway', 1, 0.5],\n", + " 18,\n", + " ['match', ['get', 'type'], 'runway', 80, 20]]},\n", + " 'source-layer': 'aeroway'},\n", + " {'minzoom': 15,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'buildings',\n", + " 'mapbox:group': 'Buildings, built'},\n", + " 'filter': ['all',\n", + " ['!=', ['get', 'type'], 'building:part'],\n", + " ['==', ['get', 'underground'], 'false']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'building-outline',\n", + " 'paint': {'line-color': 'hsl(216, 32%, 12%)',\n", + " 'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 0.75,\n", + " 20,\n", + " 3],\n", + " 'line-opacity': ['interpolate', ['linear'], ['zoom'], 15, 0, 16, 1]},\n", + " 'source-layer': 'building'},\n", + " {'minzoom': 15,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'buildings',\n", + " 'mapbox:group': 'Buildings, built'},\n", + " 'filter': ['all',\n", + " ['!=', ['get', 'type'], 'building:part'],\n", + " ['==', ['get', 'underground'], 'false']],\n", + " 'type': 'fill',\n", + " 'source': 'composite',\n", + " 'id': 'building',\n", + " 'paint': {'fill-color': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " 'hsl(216, 35%, 17%)',\n", + " 16,\n", + " 'hsl(216, 31%, 14%)'],\n", + " 'fill-opacity': ['interpolate', ['linear'], ['zoom'], 15, 0, 16, 1],\n", + " 'fill-outline-color': 'hsl(216, 32%, 12%)'},\n", + " 'source-layer': 'building'},\n", + " {'minzoom': 15,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels-case'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['track', 'secondary_link', 'tertiary_link', 'service'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-minor-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 15,\n", + " 1.125,\n", + " 18,\n", + " 2.25],\n", + " 'line-color': 'hsl(216, 34%, 27%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " ['match', ['get', 'class'], 'track', 1, 0.5],\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 75],\n", + " 'line-dasharray': [3, 3]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels-case'},\n", + " 'maxzoom': 14,\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['street', 'street_limited', 'primary_link'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-street-low-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.5,\n", + " 14,\n", + " 2],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels-case'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['street', 'street_limited', 'primary_link'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-street-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 0.75,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 34%, 27%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-dasharray': [3, 3]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 12,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels-case'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match', ['get', 'class'], ['secondary', 'tertiary'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-secondary-tertiary-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 34%, 27%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 0.75,\n", + " 18,\n", + " 28,\n", + " 22,\n", + " 200],\n", + " 'line-dasharray': [3, 3]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 10,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels-case'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['==', ['get', 'class'], 'primary'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-primary-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.5,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 34%, 27%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225],\n", + " 'line-dasharray': [3, 3]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels-case'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-major-link-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 34%, 27%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.75,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-dasharray': [3, 3]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels-case'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-motorway-trunk-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.5,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 34%, 27%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1.25,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225],\n", + " 'line-dasharray': [3, 3]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels-case'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['==', ['get', 'class'], 'construction'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-construction-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(216, 36%, 14%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [0.4, 0.8]],\n", + " 15,\n", + " ['literal', [0.3, 0.6]],\n", + " 16,\n", + " ['literal', [0.2, 0.3]],\n", + " 17,\n", + " ['literal', [0.2, 0.25]],\n", + " 18,\n", + " ['literal', [0.15, 0.15]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., tunnels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['==', ['get', 'class'], 'path'],\n", + " ['!=', ['get', 'type'], 'steps'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-path',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 1,\n", + " 18,\n", + " 4],\n", + " 'line-color': 'hsl(216, 50%, 35%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 15,\n", + " ['literal', [1.75, 1]],\n", + " 16,\n", + " ['literal', [1, 0.75]],\n", + " 17,\n", + " ['literal', [1, 0.5]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., tunnels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['==', ['get', 'type'], 'steps'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-steps',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 1,\n", + " 16,\n", + " 1.6,\n", + " 18,\n", + " 6],\n", + " 'line-color': 'hsl(216, 50%, 35%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 15,\n", + " ['literal', [1.75, 1]],\n", + " 16,\n", + " ['literal', [1, 0.75]],\n", + " 17,\n", + " ['literal', [0.3, 0.3]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., tunnels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['==', ['get', 'class'], 'pedestrian'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-pedestrian',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 0.5,\n", + " 18,\n", + " 12],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 15,\n", + " ['literal', [1.5, 0.4]],\n", + " 16,\n", + " ['literal', [1, 0.2]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-major-link-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.75,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['track', 'secondary_link', 'tertiary_link', 'service'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-minor-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " ['match', ['get', 'class'], 'track', 1, 0.5],\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 75],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['street', 'street_limited', 'primary_link'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-street-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.5,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match', ['get', 'class'], ['secondary', 'tertiary'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-secondary-tertiary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 0.75,\n", + " 18,\n", + " 28,\n", + " 22,\n", + " 200],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['==', ['get', 'class'], 'primary'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-primary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, tunnels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'tunnel-motorway-trunk-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1.25,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 12,\n", + " 'layout': {'line-join': ['step', ['zoom'], 'miter', 14, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'class'], 'path'],\n", + " ['step',\n", + " ['zoom'],\n", + " ['!',\n", + " ['match',\n", + " ['get', 'type'],\n", + " ['steps', 'sidewalk', 'crossing'],\n", + " True,\n", + " False]],\n", + " 16,\n", + " ['!=', ['get', 'type'], 'steps']],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-path-bg',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 2,\n", + " 18,\n", + " 7],\n", + " 'line-color': 'hsl(216, 31%, 14%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'type'], 'steps'],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-steps-bg',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 2,\n", + " 17,\n", + " 4.6,\n", + " 18,\n", + " 7],\n", + " 'line-opacity': 0.75,\n", + " 'line-color': 'hsl(216, 31%, 14%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-join': ['step', ['zoom'], 'miter', 14, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'class'], 'pedestrian'],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-pedestrian-case',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 14.5],\n", + " 'line-color': 'hsl(216, 31%, 14%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 12,\n", + " 'layout': {'line-join': ['step', ['zoom'], 'miter', 14, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'class'], 'path'],\n", + " ['step',\n", + " ['zoom'],\n", + " ['!',\n", + " ['match',\n", + " ['get', 'type'],\n", + " ['steps', 'sidewalk', 'crossing'],\n", + " True,\n", + " False]],\n", + " 16,\n", + " ['!=', ['get', 'type'], 'steps']],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-path',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 13,\n", + " 0.5,\n", + " 14,\n", + " 1,\n", + " 15,\n", + " 1,\n", + " 18,\n", + " 4],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 15,\n", + " ['literal', [1.75, 1]],\n", + " 16,\n", + " ['literal', [1, 0.75]],\n", + " 17,\n", + " ['literal', [1, 0.5]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'type'], 'steps'],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-steps',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 1,\n", + " 16,\n", + " 1.6,\n", + " 18,\n", + " 6],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 15,\n", + " ['literal', [1.75, 1]],\n", + " 16,\n", + " ['literal', [1, 0.75]],\n", + " 17,\n", + " ['literal', [0.3, 0.3]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 12,\n", + " 'layout': {'line-join': ['step', ['zoom'], 'miter', 14, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'class'], 'pedestrian'],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-pedestrian',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 0.5,\n", + " 18,\n", + " 12],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 15,\n", + " ['literal', [1.5, 0.4]],\n", + " 16,\n", + " ['literal', [1, 0.2]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 12,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., surface'},\n", + " 'filter': ['all',\n", + " ['==', ['geometry-type'], 'Polygon'],\n", + " ['match', ['get', 'class'], ['path', 'pedestrian'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['case', ['has', 'layer'], ['>=', ['get', 'layer'], 0], True]],\n", + " 'type': 'fill',\n", + " 'source': 'composite',\n", + " 'id': 'road-pedestrian-polygon-fill',\n", + " 'paint': {'fill-color': 'hsl(216, 38%, 16%)',\n", + " 'fill-outline-color': 'hsl(216, 31%, 14%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 16,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., surface'},\n", + " 'filter': ['all',\n", + " ['==', ['geometry-type'], 'Polygon'],\n", + " ['match', ['get', 'class'], ['path', 'pedestrian'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['case', ['has', 'layer'], ['>=', ['get', 'layer'], 0], True]],\n", + " 'type': 'fill',\n", + " 'source': 'composite',\n", + " 'id': 'road-pedestrian-polygon-pattern',\n", + " 'paint': {'fill-pattern': 'pedestrian-polygon',\n", + " 'fill-opacity': ['interpolate', ['linear'], ['zoom'], 16, 0, 16.25, 1]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'icon-image': 'turning-circle-outline',\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 0.06,\n", + " 22,\n", + " 1.4],\n", + " 'icon-allow-overlap': True,\n", + " 'icon-ignore-placement': True,\n", + " 'icon-padding': 0,\n", + " 'icon-rotation-alignment': 'map'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['geometry-type'], 'Point'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['turning_circle', 'turning_loop'],\n", + " True,\n", + " False]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'turning-feature-outline-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'line-join': 'round', 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['track', 'secondary_link', 'tertiary_link', 'service'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-minor-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 15,\n", + " 1.125,\n", + " 18,\n", + " 2.25],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " ['match', ['get', 'class'], 'track', 1, 0.5],\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 75]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 11,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 14, 'round'],\n", + " 'line-join': ['step', ['zoom'], 'miter', 14, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'maxzoom': 14,\n", + " 'filter': ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['street', 'street_limited', 'primary_link'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-street-low-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.5,\n", + " 14,\n", + " 2],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 13, 'round'],\n", + " 'line-join': ['step', ['zoom'], 'miter', 13, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['street', 'street_limited', 'primary_link'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-street-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 0.75,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 12,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match', ['get', 'class'], ['secondary', 'tertiary'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-secondary-tertiary-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 0.75,\n", + " 18,\n", + " 28,\n", + " 22,\n", + " 200]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 12,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'class'], 'primary'],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-primary-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.5,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 11,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 13, 'round'],\n", + " 'line-join': ['step', ['zoom'], 'miter', 13, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-major-link-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.75,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-motorway-trunk-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.5,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1.25,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'class'], 'construction'],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-construction-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [0.4, 0.8]],\n", + " 15,\n", + " ['literal', [0.3, 0.6]],\n", + " 16,\n", + " ['literal', [0.2, 0.3]],\n", + " 17,\n", + " ['literal', [0.2, 0.25]],\n", + " 18,\n", + " ['literal', [0.15, 0.15]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 11,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 13, 'round'],\n", + " 'line-join': ['step', ['zoom'], 'miter', 13, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-major-link-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.75,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'line-join': 'round', 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['track', 'secondary_link', 'tertiary_link', 'service'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-minor-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " ['match', ['get', 'class'], 'track', 1, 0.5],\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 75],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['match', ['get', 'class'], ['link', 'primary_link'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-tunnel-link-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0,\n", + " 15,\n", + " 3.5,\n", + " 18,\n", + " 7]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 15,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['==', ['get', 'class'], 'service'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-tunnel-minor-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 0.75,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 18],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 30]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['street', 'street_limited', 'primary_link'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-street-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.5,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['==', ['get', 'class'], 'street'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-tunnel-street-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 1,\n", + " 18,\n", + " 6,\n", + " 22,\n", + " 30]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 8,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 11, 'round'],\n", + " 'line-join': ['step', ['zoom'], 'miter', 11, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match', ['get', 'class'], ['secondary', 'tertiary'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-secondary-tertiary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 0.175,\n", + " 10,\n", + " 0.75,\n", + " 18,\n", + " 28,\n", + " 22,\n", + " 200],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['match', ['get', 'class'], ['secondary', 'tertiary'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-tunnel-secondary-tertiary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1,\n", + " 18,\n", + " 7],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 1,\n", + " 15,\n", + " 3,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 60]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 6,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 11, 'round'],\n", + " 'line-join': ['step', ['zoom'], 'miter', 11, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'class'], 'primary'],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-primary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['==', ['get', 'class'], 'primary'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-tunnel-primary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 1,\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 80]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 5,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'maxzoom': 13,\n", + " 'filter': ['all',\n", + " ['step',\n", + " ['zoom'],\n", + " ['==', ['get', 'class'], 'motorway'],\n", + " 6,\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False]],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-motorway-trunk-case-low-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.5,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1.25,\n", + " 18,\n", + " 32]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 6,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-tunnel-major-link-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0,\n", + " 15,\n", + " 3.5,\n", + " 18,\n", + " 7]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 5,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 8, 'round'],\n", + " 'line-join': ['step', ['zoom'], 'miter', 8, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-motorway-trunk-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1.25,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-tunnel-motorway-trunk-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 6,\n", + " 1,\n", + " 13,\n", + " 4,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 7,\n", + " 0,\n", + " 9,\n", + " 1,\n", + " 15,\n", + " 3,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 80]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'transit',\n", + " 'mapbox:group': 'Transit, surface'},\n", + " 'filter': ['all',\n", + " ['match', ['get', 'class'], ['major_rail', 'minor_rail'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False]],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-rail',\n", + " 'paint': {'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 0.5,\n", + " 20,\n", + " 1]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'transit',\n", + " 'mapbox:group': 'Transit, surface'},\n", + " 'filter': ['all',\n", + " ['match', ['get', 'class'], ['major_rail', 'minor_rail'], True, False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False]],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'road-rail-tracks',\n", + " 'paint': {'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 4,\n", + " 20,\n", + " 8],\n", + " 'line-dasharray': [0.1, 15],\n", + " 'line-opacity': ['interpolate', ['linear'], ['zoom'], 13.75, 0, 14, 1]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 16,\n", + " 'layout': {'icon-image': 'level-crossing',\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 16,\n", + " 0.25,\n", + " 22,\n", + " 1],\n", + " 'icon-allow-overlap': True},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface-icons'},\n", + " 'filter': ['==', ['get', 'class'], 'level_crossing'],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'level-crossing-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'icon-image': 'turning-circle',\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 0.05,\n", + " 22,\n", + " 1.5],\n", + " 'icon-allow-overlap': True,\n", + " 'icon-ignore-placement': True,\n", + " 'icon-padding': 0,\n", + " 'icon-rotation-alignment': 'map'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, surface-icons'},\n", + " 'filter': ['all',\n", + " ['==', ['geometry-type'], 'Point'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['turning_circle', 'turning_loop'],\n", + " True,\n", + " False]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'turning-feature-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 14, 'round'],\n", + " 'line-join': ['step', ['zoom'], 'miter', 14, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., barriers-bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['get', 'class'], 'path'],\n", + " ['step',\n", + " ['zoom'],\n", + " ['!',\n", + " ['match',\n", + " ['get', 'type'],\n", + " ['steps', 'sidewalk', 'crossing'],\n", + " True,\n", + " False]],\n", + " 16,\n", + " ['!=', ['get', 'type'], 'steps']],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-path-bg',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 2,\n", + " 18,\n", + " 7],\n", + " 'line-color': 'hsl(216, 31%, 14%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., barriers-bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'type'], 'steps'],\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-steps-bg',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 2,\n", + " 17,\n", + " 4.6,\n", + " 18,\n", + " 7],\n", + " 'line-opacity': 0.75,\n", + " 'line-color': 'hsl(216, 31%, 14%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., barriers-bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['get', 'class'], 'pedestrian'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-pedestrian-case',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 14.5],\n", + " 'line-color': 'hsl(216, 31%, 14%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., barriers-bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['get', 'class'], 'path'],\n", + " ['==', ['geometry-type'], 'LineString'],\n", + " ['!=', ['get', 'type'], 'steps']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-path',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 1,\n", + " 18,\n", + " 4],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 15,\n", + " ['literal', [1.75, 1]],\n", + " 16,\n", + " ['literal', [1, 0.75]],\n", + " 17,\n", + " ['literal', [1, 0.5]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., barriers-bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'type'], 'steps'],\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-steps',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 1,\n", + " 16,\n", + " 1.6,\n", + " 18,\n", + " 6],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 15,\n", + " ['literal', [1.75, 1]],\n", + " 16,\n", + " ['literal', [1, 0.75]],\n", + " 17,\n", + " ['literal', [0.3, 0.3]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., barriers-bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['get', 'class'], 'pedestrian'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-pedestrian',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 0.5,\n", + " 18,\n", + " 12],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 15,\n", + " ['literal', [1.5, 0.4]],\n", + " 16,\n", + " ['literal', [1, 0.2]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['track', 'secondary_link', 'tertiary_link', 'service'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-minor-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 15,\n", + " 1.125,\n", + " 18,\n", + " 2.25],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " ['match', ['get', 'class'], 'track', 1, 0.5],\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 75]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'maxzoom': 14,\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['street', 'street_limited', 'primary_link'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-street-low-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.5,\n", + " 14,\n", + " 2],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['street', 'street_limited', 'primary_link'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-street-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 0.75,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 12,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match', ['get', 'class'], ['secondary', 'tertiary'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-secondary-tertiary-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 0.75,\n", + " 18,\n", + " 28,\n", + " 22,\n", + " 200]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 12,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['get', 'class'], 'primary'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-primary-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.5,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['<=', ['get', 'layer'], 1],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-major-link-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.75,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['<=', ['get', 'layer'], 1],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-motorway-trunk-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.5,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1.25,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['get', 'class'], 'construction'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-construction-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(216, 37%, 24%)',\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [0.4, 0.8]],\n", + " 15,\n", + " ['literal', [0.3, 0.6]],\n", + " 16,\n", + " ['literal', [0.2, 0.3]],\n", + " 17,\n", + " ['literal', [0.2, 0.25]],\n", + " 18,\n", + " ['literal', [0.15, 0.15]]]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['<=', ['get', 'layer'], 1],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-major-link-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.75,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['track', 'secondary_link', 'tertiary_link', 'service'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-minor-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " ['match', ['get', 'class'], 'track', 1, 0.5],\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 75],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['street', 'street_limited', 'primary_link'],\n", + " True,\n", + " False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-street-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.5,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-cap': ['step', ['zoom'], 'butt', 11, 'round'],\n", + " 'line-join': ['step', ['zoom'], 'miter', 11, 'round']},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match', ['get', 'class'], ['secondary', 'tertiary'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-secondary-tertiary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 0.75,\n", + " 18,\n", + " 28,\n", + " 22,\n", + " 200],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['get', 'class'], 'primary'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-primary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['<=', ['get', 'layer'], 1],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-motorway-trunk-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1.25,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['>=', ['get', 'layer'], 2],\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-major-link-2-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.125,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.75,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['>=', ['get', 'layer'], 2],\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-motorway-trunk-2-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.2],\n", + " ['zoom'],\n", + " 10,\n", + " 1.5,\n", + " 18,\n", + " 3],\n", + " 'line-color': 'hsl(211, 17%, 40%)',\n", + " 'line-gap-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1.25,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['>=', ['get', 'layer'], 2],\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-major-link-2-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0.75,\n", + " 14,\n", + " 2,\n", + " 18,\n", + " 20,\n", + " 22,\n", + " 175],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-cap': 'round', 'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['>=', ['get', 'layer'], 2],\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-motorway-trunk-2-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1.25,\n", + " 18,\n", + " 32,\n", + " 22,\n", + " 225],\n", + " 'line-color': 'hsl(211, 17%, 40%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'transit',\n", + " 'mapbox:group': 'Transit, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match', ['get', 'class'], ['major_rail', 'minor_rail'], True, False]],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-rail',\n", + " 'paint': {'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 0.5,\n", + " 20,\n", + " 1]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'transit',\n", + " 'mapbox:group': 'Transit, bridges'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match', ['get', 'class'], ['major_rail', 'minor_rail'], True, False]],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'bridge-rail-tracks',\n", + " 'paint': {'line-color': 'hsl(216, 31%, 14%)',\n", + " 'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 4,\n", + " 20,\n", + " 8],\n", + " 'line-dasharray': [0.1, 15],\n", + " 'line-opacity': ['interpolate', ['linear'], ['zoom'], 13.75, 0, 14, 1]},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['geometry-type'], 'LineString'],\n", + " ['!=', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['match', ['get', 'class'], ['link', 'primary_link'], True, False]],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-bridge-road-link-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0,\n", + " 15,\n", + " 3.5,\n", + " 18,\n", + " 7]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 15,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['!=', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['==', ['get', 'class'], 'service'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-bridge-road-minor-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 0.75,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 18],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 30]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 13,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['!=', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['==', ['get', 'class'], 'street'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-bridge-road-street-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': ['match',\n", + " ['get', 'congestion'],\n", + " 'low',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'moderate',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'heavy',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'severe',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'hsla(0, 0%, 0%, 0)'],\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 14,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 60]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 8,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['!=', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['match', ['get', 'class'], ['secondary', 'tertiary'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-bridge-road-secondary-tertiary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': ['match',\n", + " ['get', 'congestion'],\n", + " 'low',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'moderate',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'heavy',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'severe',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'hsla(0, 0%, 0%, 0)'],\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 1,\n", + " 15,\n", + " 3,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 60]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 6,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['!=', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['==', ['get', 'class'], 'primary'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-bridge-road-primary-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': ['match',\n", + " ['get', 'congestion'],\n", + " 'low',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'moderate',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'heavy',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'severe',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'hsla(0, 0%, 0%, 0)'],\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 1,\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 80]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 6,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['!=', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['match', ['get', 'class'], ['motorway_link', 'trunk_link'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-bridge-road-major-link-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 10,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': 'hsla(0, 0%, 0%, 0)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 0,\n", + " 15,\n", + " 3.5,\n", + " 18,\n", + " 7]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 5,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'maxzoom': 13,\n", + " 'filter': ['all',\n", + " ['!=', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-bridge-road-motorway-trunk-case-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 6,\n", + " 2,\n", + " 13,\n", + " 7,\n", + " 18,\n", + " 10],\n", + " 'line-color': 'hsl(216, 37%, 24%)',\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 7,\n", + " 0,\n", + " 9,\n", + " 1,\n", + " 15,\n", + " 3,\n", + " 18,\n", + " 7]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 5,\n", + " 'layout': {'line-round-limit': 1.5,\n", + " 'line-join': 'round',\n", + " 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['!=', ['get', 'structure'], 'tunnel'],\n", + " ['has', 'congestion'],\n", + " ['match', ['get', 'class'], ['motorway', 'trunk'], True, False],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-traffic-v1',\n", + " 'id': 'traffic-bridge-road-motorway-trunk-navigation',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 6,\n", + " 1,\n", + " 13,\n", + " 4,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 22],\n", + " 'line-color': ['match',\n", + " ['get', 'congestion'],\n", + " 'low',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'moderate',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'heavy',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'severe',\n", + " 'hsl(216, 37%, 24%)',\n", + " 'hsla(0, 0%, 0%, 0)'],\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 7,\n", + " 0,\n", + " 9,\n", + " 1,\n", + " 15,\n", + " 3,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 80]},\n", + " 'source-layer': 'traffic'},\n", + " {'minzoom': 16,\n", + " 'layout': {'icon-image': 'level-crossing',\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 16,\n", + " 0.25,\n", + " 22,\n", + " 1],\n", + " 'icon-allow-overlap': True},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['==', ['get', 'class'], 'level_crossing'],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'traffic-level-crossing-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'symbol-placement': 'line',\n", + " 'symbol-spacing': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " 400,\n", + " 18,\n", + " 600,\n", + " 22,\n", + " 1200],\n", + " 'icon-image': ['step',\n", + " ['zoom'],\n", + " 'oneway-small',\n", + " 17,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['primary', 'secondary', 'tertiary', 'street', 'street_limited'],\n", + " 'oneway-large',\n", + " 'oneway-small'],\n", + " 18,\n", + " 'oneway-large'],\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 0.25,\n", + " 20,\n", + " 1],\n", + " 'icon-rotation-alignment': 'map'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['==', ['get', 'oneway'], 'true'],\n", + " ['step',\n", + " ['zoom'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['primary', 'secondary', 'street', 'street_limited', 'tertiary'],\n", + " True,\n", + " False],\n", + " 16,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['primary',\n", + " 'secondary',\n", + " 'tertiary',\n", + " 'street',\n", + " 'street_limited',\n", + " 'primary_link',\n", + " 'secondary_link',\n", + " 'tertiary_link',\n", + " 'service',\n", + " 'track'],\n", + " True,\n", + " False]]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'traffic-tunnel-oneway-arrow-blue-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'symbol-placement': 'line',\n", + " 'symbol-spacing': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " 400,\n", + " 18,\n", + " 600,\n", + " 22,\n", + " 1200],\n", + " 'icon-image': ['step',\n", + " ['zoom'],\n", + " 'oneway-white-small',\n", + " 17,\n", + " 'oneway-white-large'],\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 0.4,\n", + " 20,\n", + " 1]},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'tunnel'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['motorway', 'motorway_link', 'trunk', 'trunk_link'],\n", + " True,\n", + " False],\n", + " ['==', ['get', 'oneway'], 'true']],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'traffic-tunnel-oneway-arrow-white-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'symbol-placement': 'line',\n", + " 'symbol-spacing': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " 400,\n", + " 18,\n", + " 600,\n", + " 22,\n", + " 1200],\n", + " 'icon-image': ['step',\n", + " ['zoom'],\n", + " 'oneway-small',\n", + " 17,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['primary', 'secondary', 'tertiary', 'street', 'street_limited'],\n", + " 'oneway-large',\n", + " 'oneway-small'],\n", + " 18,\n", + " 'oneway-large'],\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 0.25,\n", + " 20,\n", + " 1],\n", + " 'icon-rotation-alignment': 'map'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'oneway'], 'true'],\n", + " ['step',\n", + " ['zoom'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['primary', 'secondary', 'tertiary', 'street', 'street_limited'],\n", + " True,\n", + " False],\n", + " 16,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['primary',\n", + " 'secondary',\n", + " 'tertiary',\n", + " 'street',\n", + " 'street_limited',\n", + " 'primary_link',\n", + " 'secondary_link',\n", + " 'tertiary_link',\n", + " 'service',\n", + " 'track'],\n", + " True,\n", + " False]],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'traffic-road-oneway-arrow-blue-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'symbol-placement': 'line',\n", + " 'symbol-spacing': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " 400,\n", + " 18,\n", + " 600,\n", + " 22,\n", + " 1200],\n", + " 'icon-image': ['step',\n", + " ['zoom'],\n", + " 'oneway-white-small',\n", + " 17,\n", + " 'oneway-white-large'],\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 0.4,\n", + " 20,\n", + " 1]},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'oneway'], 'true'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['motorway', 'trunk', 'motorway_link', 'trunk_link'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'structure'], ['none', 'ford'], True, False]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'traffic-road-oneway-arrow-white-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'symbol-placement': 'line',\n", + " 'symbol-spacing': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " 400,\n", + " 18,\n", + " 600,\n", + " 22,\n", + " 1200],\n", + " 'icon-image': ['step',\n", + " ['zoom'],\n", + " 'oneway-small',\n", + " 17,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['primary', 'secondary', 'tertiary', 'street', 'street_limited'],\n", + " 'oneway-large',\n", + " 'oneway-small'],\n", + " 18,\n", + " 'oneway-large'],\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 0.25,\n", + " 20,\n", + " 1],\n", + " 'icon-rotation-alignment': 'map'},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['==', ['get', 'oneway'], 'true'],\n", + " ['step',\n", + " ['zoom'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['primary', 'secondary', 'tertiary', 'street', 'street_limited'],\n", + " True,\n", + " False],\n", + " 16,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['primary',\n", + " 'secondary',\n", + " 'tertiary',\n", + " 'street',\n", + " 'street_limited',\n", + " 'primary_link',\n", + " 'secondary_link',\n", + " 'tertiary_link',\n", + " 'service',\n", + " 'track'],\n", + " True,\n", + " False]]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'traffic-bridge-oneway-arrow-blue-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 15,\n", + " 'layout': {'symbol-placement': 'line',\n", + " 'symbol-spacing': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 15,\n", + " 400,\n", + " 18,\n", + " 600,\n", + " 22,\n", + " 1200],\n", + " 'icon-image': ['step',\n", + " ['zoom'],\n", + " 'oneway-white-small',\n", + " 17,\n", + " 'oneway-white-large'],\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 15,\n", + " 0.45,\n", + " 20,\n", + " 1]},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'structure'], 'bridge'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['motorway', 'trunk', 'motorway_link', 'trunk_link'],\n", + " True,\n", + " False],\n", + " ['==', ['get', 'oneway'], 'true']],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'traffic-bridge-oneway-arrow-white-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 8,\n", + " 'layout': {'line-join': 'round', 'line-round-limit': 1.5},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'type'], 'full'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-incidents-v1',\n", + " 'id': 'incident-closure-lines-navigation',\n", + " 'paint': {'line-color': 'hsl(216, 37%, 24%)',\n", + " 'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 1,\n", + " 18,\n", + " 7,\n", + " 22,\n", + " 12],\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 1,\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 20]},\n", + " 'source-layer': 'closures'},\n", + " {'minzoom': 8,\n", + " 'layout': {'line-join': 'round', 'line-round-limit': 1.5},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'type'], 'full'],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'line',\n", + " 'source': 'mapbox://mapbox.mapbox-incidents-v1',\n", + " 'id': 'incident-closure-line-highlights-navigation',\n", + " 'paint': {'line-color': 'hsl(216, 0%, 57%)',\n", + " 'line-width': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 0.6,\n", + " 18,\n", + " 4.2,\n", + " 22,\n", + " 6],\n", + " 'line-offset': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 12,\n", + " 1,\n", + " 18,\n", + " 10,\n", + " 22,\n", + " 20],\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [1, 0]],\n", + " 14,\n", + " ['literal', [1, 1]]]},\n", + " 'source-layer': 'closures'},\n", + " {'minzoom': 8,\n", + " 'layout': {'icon-image': 'road-closure',\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 0.15,\n", + " 18,\n", + " 0.6,\n", + " 22,\n", + " 1],\n", + " 'icon-allow-overlap': True},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'type'], 'endpoint:full'],\n", + " ['match', ['geometry-type'], ['LineString', 'Point'], True, False]],\n", + " 'type': 'symbol',\n", + " 'source': 'mapbox://mapbox.mapbox-incidents-v1',\n", + " 'id': 'incident-endpoints-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'closures'},\n", + " {'minzoom': 8,\n", + " 'layout': {'icon-image': 'road-closure',\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 5,\n", + " 0.15,\n", + " 18,\n", + " 0.6,\n", + " 22,\n", + " 1],\n", + " 'icon-allow-overlap': True},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, traffic-and-closures'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'type'], 'startpoint:full'],\n", + " ['match', ['geometry-type'], ['LineString', 'Point'], True, False]],\n", + " 'type': 'symbol',\n", + " 'source': 'mapbox://mapbox.mapbox-incidents-v1',\n", + " 'id': 'incident-startpoints-navigation',\n", + " 'paint': {},\n", + " 'source-layer': 'closures'},\n", + " {'id': 'admin-1-boundary-bg',\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'source-layer': 'admin',\n", + " 'filter': ['all',\n", + " ['==', ['get', 'admin_level'], 1],\n", + " ['==', ['get', 'maritime'], 'false'],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " 'layout': {'line-join': 'bevel'},\n", + " 'paint': {'line-color': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 8,\n", + " 'hsl(216, 36%, 16%)',\n", + " 16,\n", + " 'hsl(212, 14%, 0%)'],\n", + " 'line-width': ['interpolate', ['linear'], ['zoom'], 7, 3.75, 12, 5.5],\n", + " 'line-opacity': ['interpolate', ['linear'], ['zoom'], 7, 0, 8, 0.75],\n", + " 'line-dasharray': [1, 0],\n", + " 'line-translate': [0, 0],\n", + " 'line-blur': ['interpolate', ['linear'], ['zoom'], 3, 0, 8, 3]},\n", + " 'metadata': {'mapbox:featureComponent': 'admin-boundaries',\n", + " 'mapbox:group': 'Administrative boundaries, admin'}},\n", + " {'minzoom': 1,\n", + " 'layout': {},\n", + " 'metadata': {'mapbox:featureComponent': 'admin-boundaries',\n", + " 'mapbox:group': 'Administrative boundaries, admin'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'admin_level'], 0],\n", + " ['==', ['get', 'maritime'], 'false'],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'admin-0-boundary-bg',\n", + " 'paint': {'line-width': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 3,\n", + " 3.5,\n", + " 10,\n", + " 8],\n", + " 'line-color': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 6,\n", + " 'hsl(216, 36%, 16%)',\n", + " 8,\n", + " 'hsl(212, 14%, 0%)'],\n", + " 'line-opacity': ['interpolate', ['linear'], ['zoom'], 3, 0, 4, 0.5],\n", + " 'line-translate': [0, 0],\n", + " 'line-blur': ['interpolate', ['linear'], ['zoom'], 3, 0, 10, 2]},\n", + " 'source-layer': 'admin'},\n", + " {'id': 'admin-1-boundary',\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'source-layer': 'admin',\n", + " 'filter': ['all',\n", + " ['==', ['get', 'admin_level'], 1],\n", + " ['==', ['get', 'maritime'], 'false'],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " 'layout': {'line-join': 'round', 'line-cap': 'round'},\n", + " 'paint': {'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [2, 0]],\n", + " 7,\n", + " ['literal', [2, 2, 6, 2]]],\n", + " 'line-width': ['interpolate', ['linear'], ['zoom'], 7, 0.75, 12, 1.5],\n", + " 'line-opacity': ['interpolate', ['linear'], ['zoom'], 2, 0, 3, 1],\n", + " 'line-color': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 3,\n", + " 'hsl(212, 4%, 84%)',\n", + " 7,\n", + " 'hsl(212, 2%, 84%)']},\n", + " 'metadata': {'mapbox:featureComponent': 'admin-boundaries',\n", + " 'mapbox:group': 'Administrative boundaries, admin'}},\n", + " {'minzoom': 1,\n", + " 'layout': {'line-join': 'round', 'line-cap': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'admin-boundaries',\n", + " 'mapbox:group': 'Administrative boundaries, admin'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'admin_level'], 0],\n", + " ['==', ['get', 'disputed'], 'false'],\n", + " ['==', ['get', 'maritime'], 'false'],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'admin-0-boundary',\n", + " 'paint': {'line-color': 'hsl(212, 2%, 89%)',\n", + " 'line-width': ['interpolate', ['linear'], ['zoom'], 3, 0.5, 10, 2],\n", + " 'line-dasharray': [10, 0]},\n", + " 'source-layer': 'admin'},\n", + " {'minzoom': 1,\n", + " 'layout': {'line-join': 'round'},\n", + " 'metadata': {'mapbox:featureComponent': 'admin-boundaries',\n", + " 'mapbox:group': 'Administrative boundaries, admin'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['==', ['get', 'admin_level'], 0],\n", + " ['==', ['get', 'maritime'], 'false'],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " 'type': 'line',\n", + " 'source': 'composite',\n", + " 'id': 'admin-0-boundary-disputed',\n", + " 'paint': {'line-color': 'hsl(212, 2%, 89%)',\n", + " 'line-width': ['interpolate', ['linear'], ['zoom'], 3, 0.5, 10, 2],\n", + " 'line-dasharray': ['step',\n", + " ['zoom'],\n", + " ['literal', [3.25, 3.25]],\n", + " 6,\n", + " ['literal', [2.5, 2.5]],\n", + " 7,\n", + " ['literal', [2, 2.25]],\n", + " 8,\n", + " ['literal', [1.75, 2]]]},\n", + " 'source-layer': 'admin'},\n", + " {'minzoom': 15,\n", + " 'layout': {'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 'icon-image': 'intersection',\n", + " 'icon-text-fit': 'both',\n", + " 'icon-text-fit-padding': [1, 2, 1, 2],\n", + " 'text-size': 12,\n", + " 'text-font': ['DIN Pro Bold', 'Arial Unicode MS Bold']},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, road-labels'},\n", + " 'filter': ['all',\n", + " ['==', ['get', 'class'], 'intersection'],\n", + " ['has', 'name']],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'road-intersection',\n", + " 'paint': {'text-color': 'hsl(230, 57%, 64%)'},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'text-size': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 10,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['motorway', 'trunk', 'primary', 'secondary', 'tertiary'],\n", + " 10,\n", + " ['motorway_link',\n", + " 'trunk_link',\n", + " 'primary_link',\n", + " 'secondary_link',\n", + " 'tertiary_link',\n", + " 'street',\n", + " 'street_limited'],\n", + " 8,\n", + " 6.5],\n", + " 18,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['motorway', 'trunk', 'primary', 'secondary', 'tertiary'],\n", + " 16,\n", + " ['motorway_link',\n", + " 'trunk_link',\n", + " 'primary_link',\n", + " 'secondary_link',\n", + " 'tertiary_link',\n", + " 'street',\n", + " 'street_limited'],\n", + " 14,\n", + " 13],\n", + " 22,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['motorway', 'trunk', 'primary', 'secondary', 'tertiary'],\n", + " 50,\n", + " ['motorway_link',\n", + " 'trunk_link',\n", + " 'primary_link',\n", + " 'secondary_link',\n", + " 'tertiary_link',\n", + " 'street',\n", + " 'street_limited'],\n", + " 40,\n", + " 30]],\n", + " 'text-max-angle': 30,\n", + " 'symbol-spacing': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 10,\n", + " 150,\n", + " 18,\n", + " 450,\n", + " 22,\n", + " 1500],\n", + " 'text-font': ['DIN Pro Regular', 'Arial Unicode MS Regular'],\n", + " 'symbol-placement': 'line',\n", + " 'text-padding': 1,\n", + " 'text-rotation-alignment': 'map',\n", + " 'text-pitch-alignment': 'viewport',\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 'text-letter-spacing': 0.01},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, road-labels'},\n", + " 'filter': ['step',\n", + " ['zoom'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['motorway', 'trunk', 'primary', 'secondary', 'tertiary'],\n", + " True,\n", + " False],\n", + " 15.25,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'street'],\n", + " True,\n", + " False],\n", + " 16,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['motorway',\n", + " 'trunk',\n", + " 'primary',\n", + " 'secondary',\n", + " 'tertiary',\n", + " 'street',\n", + " 'street_limited'],\n", + " True,\n", + " False],\n", + " 16.5,\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['pedestrian', 'golf', 'ferry', 'aerialway', 'path'],\n", + " False,\n", + " True]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'road-label-navigation',\n", + " 'paint': {'text-color': 'hsl(216, 37%, 66%)',\n", + " 'text-halo-color': ['match',\n", + " ['get', 'class'],\n", + " ['motorway', 'trunk'],\n", + " 'hsl(216, 36%, 2%)',\n", + " 'hsl(211, 17%, 40%)'],\n", + " 'text-halo-width': 1,\n", + " 'text-halo-blur': 1},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 6,\n", + " 'layout': {'text-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 6,\n", + " 14,\n", + " 22,\n", + " 26],\n", + " 'icon-image': ['concat',\n", + " ['get', 'shield'],\n", + " '-',\n", + " ['to-string', ['get', 'reflen']]],\n", + " 'icon-rotation-alignment': 'viewport',\n", + " 'text-max-angle': 38,\n", + " 'symbol-spacing': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 11,\n", + " 150,\n", + " 14,\n", + " 200,\n", + " 16,\n", + " 400,\n", + " 17,\n", + " 500,\n", + " 18,\n", + " 500,\n", + " 22,\n", + " 1200],\n", + " 'text-font': ['DIN Pro Bold', 'Arial Unicode MS Bold'],\n", + " 'symbol-placement': ['step', ['zoom'], 'point', 11, 'line'],\n", + " 'text-rotation-alignment': 'viewport',\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 6,\n", + " 0.5,\n", + " 13,\n", + " 0.5,\n", + " 22,\n", + " 1],\n", + " 'text-field': ['get', 'ref'],\n", + " 'text-letter-spacing': 0.05},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, road-labels'},\n", + " 'filter': ['all',\n", + " ['has', 'reflen'],\n", + " ['<=', ['get', 'reflen'], 6],\n", + " ['step',\n", + " ['zoom'],\n", + " ['==', ['geometry-type'], 'Point'],\n", + " 11,\n", + " ['>', ['get', 'len'], 5000],\n", + " 12,\n", + " ['>', ['get', 'len'], 2500],\n", + " 13,\n", + " ['>', ['get', 'len'], 1000],\n", + " 14,\n", + " True]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'road-number-shield-navigation',\n", + " 'paint': {'text-color': ['match',\n", + " ['get', 'shield_text_color'],\n", + " 'white',\n", + " 'hsl(0, 0%, 100%)',\n", + " 'yellow',\n", + " 'hsl(50, 100%, 70%)',\n", + " 'orange',\n", + " 'hsl(25, 100%, 75%)',\n", + " 'blue',\n", + " 'hsl(230, 57%, 44%)',\n", + " 'hsl(230, 18%, 13%)']},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 14,\n", + " 'layout': {'text-field': ['get', 'ref'],\n", + " 'text-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 6,\n", + " 14,\n", + " 22,\n", + " 26],\n", + " 'text-font': ['DIN Pro Bold', 'Arial Unicode MS Bold'],\n", + " 'icon-image': ['concat',\n", + " 'motorway-exit-',\n", + " ['to-string', ['get', 'reflen']]],\n", + " 'icon-size': ['interpolate',\n", + " ['exponential', 1.5],\n", + " ['zoom'],\n", + " 6,\n", + " 0.5,\n", + " 13,\n", + " 0.5,\n", + " 22,\n", + " 1]},\n", + " 'metadata': {'mapbox:featureComponent': 'road-network',\n", + " 'mapbox:group': 'Road network, road-labels'},\n", + " 'filter': ['all', ['has', 'reflen'], ['<=', ['get', 'reflen'], 9]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'road-exit-shield-navigation',\n", + " 'paint': {'text-color': 'hsl(0, 0%, 100%)'},\n", + " 'source-layer': 'motorway_junction'},\n", + " {'minzoom': 12,\n", + " 'layout': {'text-size': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 10,\n", + " ['match', ['get', 'class'], 'pedestrian', 9, 6.5],\n", + " 18,\n", + " ['match', ['get', 'class'], 'pedestrian', 14, 13]],\n", + " 'text-max-angle': 30,\n", + " 'text-font': ['DIN Pro Regular', 'Arial Unicode MS Regular'],\n", + " 'symbol-placement': 'line',\n", + " 'text-padding': 1,\n", + " 'text-rotation-alignment': 'map',\n", + " 'text-pitch-alignment': 'viewport',\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 'text-letter-spacing': 0.01},\n", + " 'metadata': {'mapbox:featureComponent': 'walking-cycling',\n", + " 'mapbox:group': 'Walking, cycling, etc., walking-cycling-labels'},\n", + " 'filter': ['step',\n", + " ['zoom'],\n", + " ['match', ['get', 'class'], ['pedestrian'], True, False],\n", + " 15,\n", + " ['match', ['get', 'class'], ['path', 'pedestrian'], True, False]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'path-pedestrian-label',\n", + " 'paint': {'text-color': 'hsl(216, 37%, 66%)',\n", + " 'text-halo-color': 'hsl(211, 17%, 40%)',\n", + " 'text-halo-width': 1,\n", + " 'text-halo-blur': 1},\n", + " 'source-layer': 'road'},\n", + " {'minzoom': 13,\n", + " 'layout': {'text-font': ['DIN Pro Italic', 'Arial Unicode MS Regular'],\n", + " 'text-max-angle': 30,\n", + " 'symbol-spacing': ['interpolate',\n", + " ['linear', 1],\n", + " ['zoom'],\n", + " 15,\n", + " 250,\n", + " 17,\n", + " 400],\n", + " 'text-size': ['interpolate', ['linear'], ['zoom'], 13, 12, 18, 16],\n", + " 'symbol-placement': 'line',\n", + " 'text-pitch-alignment': 'viewport',\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']]},\n", + " 'metadata': {'mapbox:featureComponent': 'natural-features',\n", + " 'mapbox:group': 'Natural features, natural-labels'},\n", + " 'filter': ['all',\n", + " ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['canal',\n", + " 'river',\n", + " 'stream',\n", + " 'disputed_canal',\n", + " 'disputed_river',\n", + " 'disputed_stream'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['match', ['get', 'class'], ['canal', 'river', 'stream'], True, False]],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'waterway-label',\n", + " 'paint': {'text-color': 'hsl(197, 16%, 90%)'},\n", + " 'source-layer': 'natural_label'},\n", + " {'minzoom': 4,\n", + " 'layout': {'text-size': ['step',\n", + " ['zoom'],\n", + " ['step', ['get', 'sizerank'], 18, 5, 12],\n", + " 17,\n", + " ['step', ['get', 'sizerank'], 18, 13, 12]],\n", + " 'text-max-angle': 30,\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 'text-font': ['DIN Pro Medium', 'Arial Unicode MS Regular'],\n", + " 'symbol-placement': 'line-center',\n", + " 'text-pitch-alignment': 'viewport'},\n", + " 'metadata': {'mapbox:featureComponent': 'natural-features',\n", + " 'mapbox:group': 'Natural features, natural-labels'},\n", + " 'filter': ['all',\n", + " ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['glacier', 'landform', 'disputed_glacier', 'disputed_landform'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['match', ['get', 'class'], ['glacier', 'landform'], True, False]],\n", + " ['==', ['geometry-type'], 'LineString'],\n", + " ['<=', ['get', 'filterrank'], 3]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'natural-line-label',\n", + " 'paint': {'text-halo-width': 0.5,\n", + " 'text-halo-color': 'hsl(216, 43%, 0%)',\n", + " 'text-halo-blur': 0.5,\n", + " 'text-color': ['step',\n", + " ['zoom'],\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " 'hsl(184, 2%, 91%)',\n", + " 5,\n", + " 'hsl(184, 7%, 81%)'],\n", + " 17,\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " 'hsl(184, 2%, 91%)',\n", + " 13,\n", + " 'hsl(184, 7%, 81%)']]},\n", + " 'source-layer': 'natural_label'},\n", + " {'minzoom': 4,\n", + " 'layout': {'text-size': ['step',\n", + " ['zoom'],\n", + " ['step', ['get', 'sizerank'], 18, 5, 12],\n", + " 17,\n", + " ['step', ['get', 'sizerank'], 18, 13, 12]],\n", + " 'icon-image': ['step',\n", + " ['zoom'],\n", + " ['concat', ['get', 'maki'], '-11'],\n", + " 15,\n", + " ['concat', ['get', 'maki'], '-15']],\n", + " 'text-font': ['DIN Pro Medium', 'Arial Unicode MS Regular'],\n", + " 'text-offset': ['step',\n", + " ['zoom'],\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " ['literal', [0, 0]],\n", + " 5,\n", + " ['literal', [0, 0.75]]],\n", + " 17,\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " ['literal', [0, 0]],\n", + " 13,\n", + " ['literal', [0, 0.75]]]],\n", + " 'text-anchor': ['step',\n", + " ['zoom'],\n", + " ['step', ['get', 'sizerank'], 'center', 5, 'top'],\n", + " 17,\n", + " ['step', ['get', 'sizerank'], 'center', 13, 'top']],\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']]},\n", + " 'metadata': {'mapbox:featureComponent': 'natural-features',\n", + " 'mapbox:group': 'Natural features, natural-labels'},\n", + " 'filter': ['all',\n", + " ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['dock',\n", + " 'glacier',\n", + " 'landform',\n", + " 'water_feature',\n", + " 'wetland',\n", + " 'disputed_dock',\n", + " 'disputed_glacier',\n", + " 'disputed_landform',\n", + " 'disputed_water_feature',\n", + " 'disputed_wetland'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['dock', 'glacier', 'landform', 'water_feature', 'wetland'],\n", + " True,\n", + " False]],\n", + " ['==', ['geometry-type'], 'Point'],\n", + " ['<=', ['get', 'filterrank'], 3]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'natural-point-label',\n", + " 'paint': {'icon-opacity': ['step',\n", + " ['zoom'],\n", + " ['step', ['get', 'sizerank'], 0, 5, 1],\n", + " 17,\n", + " ['step', ['get', 'sizerank'], 0, 13, 1]],\n", + " 'text-halo-color': 'hsl(216, 43%, 0%)',\n", + " 'text-halo-width': 0.5,\n", + " 'text-halo-blur': 0.5,\n", + " 'text-color': ['step',\n", + " ['zoom'],\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " 'hsl(184, 2%, 91%)',\n", + " 5,\n", + " 'hsl(184, 7%, 81%)'],\n", + " 17,\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " 'hsl(184, 2%, 91%)',\n", + " 13,\n", + " 'hsl(184, 7%, 81%)']]},\n", + " 'source-layer': 'natural_label'},\n", + " {'id': 'water-line-label',\n", + " 'type': 'symbol',\n", + " 'metadata': {'mapbox:featureComponent': 'natural-features',\n", + " 'mapbox:group': 'Natural features, natural-labels'},\n", + " 'source': 'composite',\n", + " 'source-layer': 'natural_label',\n", + " 'filter': ['all',\n", + " ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['bay',\n", + " 'ocean',\n", + " 'reservoir',\n", + " 'sea',\n", + " 'water',\n", + " 'disputed_bay',\n", + " 'disputed_ocean',\n", + " 'disputed_reservoir',\n", + " 'disputed_sea',\n", + " 'disputed_water'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['bay', 'ocean', 'reservoir', 'sea', 'water'],\n", + " True,\n", + " False]],\n", + " ['==', ['geometry-type'], 'LineString']],\n", + " 'layout': {'text-size': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 7,\n", + " ['step', ['get', 'sizerank'], 24, 6, 18, 12, 12],\n", + " 10,\n", + " ['step', ['get', 'sizerank'], 18, 9, 12],\n", + " 18,\n", + " ['step', ['get', 'sizerank'], 18, 9, 16]],\n", + " 'text-max-angle': 30,\n", + " 'text-letter-spacing': ['match',\n", + " ['get', 'class'],\n", + " 'ocean',\n", + " 0.25,\n", + " ['sea', 'bay'],\n", + " 0.15,\n", + " 0],\n", + " 'text-font': ['DIN Pro Italic', 'Arial Unicode MS Regular'],\n", + " 'symbol-placement': 'line-center',\n", + " 'text-pitch-alignment': 'viewport',\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']]},\n", + " 'paint': {'text-color': ['match',\n", + " ['get', 'class'],\n", + " ['bay', 'ocean', 'sea'],\n", + " 'hsl(197, 44%, 26%)',\n", + " 'hsl(197, 16%, 90%)']}},\n", + " {'id': 'water-point-label',\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'source-layer': 'natural_label',\n", + " 'filter': ['all',\n", + " ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['bay',\n", + " 'ocean',\n", + " 'reservoir',\n", + " 'sea',\n", + " 'water',\n", + " 'disputed_bay',\n", + " 'disputed_ocean',\n", + " 'disputed_reservoir',\n", + " 'disputed_sea',\n", + " 'disputed_water'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['bay', 'ocean', 'reservoir', 'sea', 'water'],\n", + " True,\n", + " False]],\n", + " ['==', ['geometry-type'], 'Point']],\n", + " 'layout': {'text-line-height': 1.3,\n", + " 'text-size': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 7,\n", + " ['step', ['get', 'sizerank'], 24, 6, 18, 12, 12],\n", + " 10,\n", + " ['step', ['get', 'sizerank'], 18, 9, 12]],\n", + " 'text-font': ['DIN Pro Italic', 'Arial Unicode MS Regular'],\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 'text-letter-spacing': ['match',\n", + " ['get', 'class'],\n", + " 'ocean',\n", + " 0.25,\n", + " ['bay', 'sea'],\n", + " 0.15,\n", + " 0.01],\n", + " 'text-max-width': ['match',\n", + " ['get', 'class'],\n", + " 'ocean',\n", + " 4,\n", + " 'sea',\n", + " 5,\n", + " ['bay', 'water'],\n", + " 7,\n", + " 10]},\n", + " 'paint': {'text-color': ['match',\n", + " ['get', 'class'],\n", + " ['bay', 'ocean', 'sea'],\n", + " 'hsl(197, 44%, 26%)',\n", + " 'hsl(197, 16%, 90%)']},\n", + " 'metadata': {'mapbox:featureComponent': 'natural-features',\n", + " 'mapbox:group': 'Natural features, natural-labels'}},\n", + " {'minzoom': 6,\n", + " 'layout': {'text-size': ['step',\n", + " ['zoom'],\n", + " ['step', ['get', 'sizerank'], 18, 5, 12],\n", + " 17,\n", + " ['step', ['get', 'sizerank'], 18, 13, 12]],\n", + " 'icon-image': ['step',\n", + " ['zoom'],\n", + " ['concat', ['get', 'maki'], '-11'],\n", + " 15,\n", + " ['concat', ['get', 'maki'], '-15']],\n", + " 'text-font': ['DIN Pro Medium', 'Arial Unicode MS Regular'],\n", + " 'text-offset': ['step',\n", + " ['zoom'],\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " ['literal', [0, 0]],\n", + " 5,\n", + " ['literal', [0, 0.75]]],\n", + " 17,\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " ['literal', [0, 0]],\n", + " 13,\n", + " ['literal', [0, 0.75]]]],\n", + " 'text-anchor': ['step',\n", + " ['zoom'],\n", + " ['step', ['get', 'sizerank'], 'center', 5, 'top'],\n", + " 17,\n", + " ['step', ['get', 'sizerank'], 'center', 13, 'top']],\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']]},\n", + " 'metadata': {'mapbox:featureComponent': 'point-of-interest-labels',\n", + " 'mapbox:group': 'Point of interest labels, poi-labels'},\n", + " 'filter': ['<=',\n", + " ['get', 'filterrank'],\n", + " ['+', ['step', ['zoom'], 0, 16, 1, 17, 2], 2]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'poi-label',\n", + " 'paint': {'icon-opacity': ['step',\n", + " ['zoom'],\n", + " ['step', ['get', 'sizerank'], 0, 5, 1],\n", + " 17,\n", + " ['step', ['get', 'sizerank'], 0, 13, 1]],\n", + " 'text-halo-color': ['match',\n", + " ['get', 'class'],\n", + " 'park_like',\n", + " 'hsl(170, 42%, 0%)',\n", + " 'education',\n", + " 'hsl(213, 38%, 0%)',\n", + " 'medical',\n", + " 'hsl(204, 24%, 5%)',\n", + " 'hsl(216, 43%, 0%)'],\n", + " 'text-halo-width': 0.5,\n", + " 'text-halo-blur': 0.5,\n", + " 'text-color': ['step',\n", + " ['zoom'],\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " 'food_and_drink',\n", + " 'hsl(180, 15%, 100%)',\n", + " 'park_like',\n", + " 'hsl(107, 1%, 84%)',\n", + " 'education',\n", + " 'hsl(213, 11%, 100%)',\n", + " 'medical',\n", + " 'hsl(204, 6%, 100%)',\n", + " 'hsl(184, 2%, 91%)'],\n", + " 5,\n", + " ['match',\n", + " ['get', 'class'],\n", + " 'food_and_drink',\n", + " 'hsl(180, 24%, 87%)',\n", + " 'park_like',\n", + " 'hsl(107, 0%, 73%)',\n", + " 'education',\n", + " 'hsl(213, 27%, 100%)',\n", + " 'medical',\n", + " 'hsl(204, 7%, 100%)',\n", + " 'hsl(184, 7%, 81%)']],\n", + " 17,\n", + " ['step',\n", + " ['get', 'sizerank'],\n", + " ['match',\n", + " ['get', 'class'],\n", + " 'food_and_drink',\n", + " 'hsl(180, 15%, 100%)',\n", + " 'park_like',\n", + " 'hsl(107, 1%, 84%)',\n", + " 'education',\n", + " 'hsl(213, 11%, 100%)',\n", + " 'medical',\n", + " 'hsl(204, 6%, 100%)',\n", + " 'hsl(184, 2%, 91%)'],\n", + " 13,\n", + " ['match',\n", + " ['get', 'class'],\n", + " 'food_and_drink',\n", + " 'hsl(180, 24%, 87%)',\n", + " 'park_like',\n", + " 'hsl(107, 0%, 73%)',\n", + " 'education',\n", + " 'hsl(213, 27%, 100%)',\n", + " 'medical',\n", + " 'hsl(204, 7%, 100%)',\n", + " 'hsl(184, 7%, 81%)']]]},\n", + " 'source-layer': 'poi_label'},\n", + " {'minzoom': 12,\n", + " 'layout': {'text-size': 12,\n", + " 'icon-image': ['get', 'network'],\n", + " 'text-font': ['DIN Pro Medium', 'Arial Unicode MS Regular'],\n", + " 'text-justify': ['match',\n", + " ['get', 'stop_type'],\n", + " 'entrance',\n", + " 'left',\n", + " 'center'],\n", + " 'text-offset': ['match',\n", + " ['get', 'stop_type'],\n", + " 'entrance',\n", + " ['literal', [1, 0]],\n", + " ['literal', [0, 0.8]]],\n", + " 'text-anchor': ['match', ['get', 'stop_type'], 'entrance', 'left', 'top'],\n", + " 'text-field': ['step',\n", + " ['zoom'],\n", + " '',\n", + " 14,\n", + " ['match',\n", + " ['get', 'mode'],\n", + " ['rail', 'metro_rail'],\n", + " ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " ''],\n", + " 16,\n", + " ['match',\n", + " ['get', 'mode'],\n", + " ['bus', 'bicycle'],\n", + " '',\n", + " ['coalesce', ['get', 'name_en'], ['get', 'name']]],\n", + " 18,\n", + " ['coalesce', ['get', 'name_en'], ['get', 'name']]],\n", + " 'text-letter-spacing': 0.01,\n", + " 'text-max-width': ['match', ['get', 'stop_type'], 'entrance', 15, 9]},\n", + " 'metadata': {'mapbox:featureComponent': 'transit',\n", + " 'mapbox:group': 'Transit, transit-labels'},\n", + " 'filter': ['step',\n", + " ['zoom'],\n", + " ['all',\n", + " ['match', ['get', 'mode'], 'rail', True, 'metro_rail', True, False],\n", + " ['!=', ['get', 'stop_type'], 'entrance']],\n", + " 15,\n", + " ['all',\n", + " ['match',\n", + " ['get', 'mode'],\n", + " 'rail',\n", + " True,\n", + " 'metro_rail',\n", + " True,\n", + " 'light_rail',\n", + " True,\n", + " False],\n", + " ['!=', ['get', 'stop_type'], 'entrance']],\n", + " 16,\n", + " ['all',\n", + " ['match', ['get', 'mode'], 'ferry', False, 'bus', False, True],\n", + " ['!=', ['get', 'stop_type'], 'entrance']],\n", + " 17,\n", + " ['all',\n", + " ['match', ['get', 'mode'], 'ferry', False, True],\n", + " ['!=', ['get', 'stop_type'], 'entrance']],\n", + " 19,\n", + " ['match', ['get', 'mode'], 'ferry', False, True]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'transit-label',\n", + " 'paint': {'text-halo-color': 'hsl(216, 43%, 0%)',\n", + " 'text-color': ['match',\n", + " ['get', 'network'],\n", + " 'tokyo-metro',\n", + " 'hsl(180, 34%, 30%)',\n", + " 'mexico-city-metro',\n", + " 'hsl(25, 70%, 63%)',\n", + " ['barcelona-metro',\n", + " 'delhi-metro',\n", + " 'hong-kong-mtr',\n", + " 'milan-metro',\n", + " 'osaka-subway'],\n", + " 'hsl(0, 64%, 47%)',\n", + " ['boston-t', 'washington-metro'],\n", + " 'hsl(230, 13%, 20%)',\n", + " ['chongqing-rail-transit', 'kiev-metro', 'singapore-mrt', 'taipei-metro'],\n", + " 'hsl(140, 63%, 25%)',\n", + " 'hsl(219, 9%, 80%)'],\n", + " 'text-halo-blur': 0.5,\n", + " 'text-halo-width': 0.5},\n", + " 'source-layer': 'transit_stop_label'},\n", + " {'id': 'airport-label',\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'source-layer': 'airport_label',\n", + " 'minzoom': 8,\n", + " 'layout': {'text-line-height': 1.1,\n", + " 'text-size': ['step', ['get', 'sizerank'], 18, 9, 12],\n", + " 'icon-image': ['step',\n", + " ['get', 'sizerank'],\n", + " ['concat', ['get', 'maki'], '-15'],\n", + " 9,\n", + " ['concat', ['get', 'maki'], '-11']],\n", + " 'text-font': ['DIN Pro Medium', 'Arial Unicode MS Regular'],\n", + " 'text-offset': [0, 0.75],\n", + " 'text-rotation-alignment': 'viewport',\n", + " 'text-anchor': 'top',\n", + " 'text-field': ['step',\n", + " ['get', 'sizerank'],\n", + " ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 15,\n", + " ['get', 'ref']],\n", + " 'text-letter-spacing': 0.01,\n", + " 'text-max-width': 9},\n", + " 'paint': {'text-color': 'hsl(213, 9%, 100%)',\n", + " 'text-halo-color': 'hsl(213, 58%, 5%)',\n", + " 'text-halo-width': 1},\n", + " 'metadata': {'mapbox:featureComponent': 'transit',\n", + " 'mapbox:group': 'Transit, transit-labels'}},\n", + " {'minzoom': 10,\n", + " 'layout': {'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 'text-transform': 'uppercase',\n", + " 'text-font': ['DIN Pro Regular', 'Arial Unicode MS Regular'],\n", + " 'text-letter-spacing': ['match', ['get', 'type'], 'suburb', 0.15, 0.1],\n", + " 'text-max-width': 7,\n", + " 'text-padding': 3,\n", + " 'text-size': ['interpolate',\n", + " ['cubic-bezier', 0.5, 0, 1, 1],\n", + " ['zoom'],\n", + " 11,\n", + " ['match', ['get', 'type'], 'suburb', 11, 10.5],\n", + " 15,\n", + " ['match', ['get', 'type'], 'suburb', 17, 16]]},\n", + " 'metadata': {'mapbox:featureComponent': 'place-labels',\n", + " 'mapbox:group': 'Place labels, place-labels'},\n", + " 'maxzoom': 15,\n", + " 'filter': ['all',\n", + " ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['settlement_subdivision', 'disputed_settlement_subdivision'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['==', ['get', 'class'], 'settlement_subdivision']],\n", + " ['<=', ['get', 'filterrank'], 3]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'settlement-subdivision-label',\n", + " 'paint': {'text-halo-color': 'hsla(216, 43%, 0%, 0.75)',\n", + " 'text-halo-width': 1,\n", + " 'text-color': 'hsl(212, 8%, 94%)',\n", + " 'text-halo-blur': 0.5},\n", + " 'source-layer': 'place_label'},\n", + " {'layout': {'icon-image': '',\n", + " 'text-font': ['DIN Pro Regular', 'Arial Unicode MS Regular'],\n", + " 'text-offset': ['step',\n", + " ['zoom'],\n", + " ['literal', [0, 0]],\n", + " 8,\n", + " ['literal', [0, 0]]],\n", + " 'text-anchor': ['step', ['zoom'], 'center', 8, 'center'],\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 'text-max-width': 7,\n", + " 'text-line-height': 1.1,\n", + " 'text-size': ['interpolate',\n", + " ['cubic-bezier', 0.2, 0, 0.9, 1],\n", + " ['zoom'],\n", + " 3,\n", + " ['step',\n", + " ['get', 'symbolrank'],\n", + " 12,\n", + " 9,\n", + " 11,\n", + " 10,\n", + " 10.5,\n", + " 12,\n", + " 9.5,\n", + " 14,\n", + " 8.5,\n", + " 16,\n", + " 6.5,\n", + " 17,\n", + " 4],\n", + " 13,\n", + " ['step',\n", + " ['get', 'symbolrank'],\n", + " 25,\n", + " 9,\n", + " 23,\n", + " 10,\n", + " 21,\n", + " 11,\n", + " 19,\n", + " 12,\n", + " 18,\n", + " 13,\n", + " 17,\n", + " 15,\n", + " 15]]},\n", + " 'metadata': {'mapbox:featureComponent': 'place-labels',\n", + " 'mapbox:group': 'Place labels, place-labels'},\n", + " 'maxzoom': 15,\n", + " 'filter': ['all',\n", + " ['<=', ['get', 'filterrank'], 3],\n", + " ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['settlement', 'disputed_settlement'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['==', ['get', 'class'], 'settlement']],\n", + " ['step',\n", + " ['zoom'],\n", + " True,\n", + " 8,\n", + " ['>=', ['get', 'symbolrank'], 11],\n", + " 10,\n", + " ['>=', ['get', 'symbolrank'], 12],\n", + " 11,\n", + " ['>=', ['get', 'symbolrank'], 13],\n", + " 12,\n", + " ['>=', ['get', 'symbolrank'], 15],\n", + " 13,\n", + " ['>=', ['get', 'symbolrank'], 11],\n", + " 14,\n", + " ['>=', ['get', 'symbolrank'], 13]]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'settlement-minor-label',\n", + " 'paint': {'text-color': 'hsl(212, 8%, 84%)',\n", + " 'text-halo-color': 'hsl(216, 43%, 0%)',\n", + " 'text-halo-width': 1,\n", + " 'icon-opacity': ['step', ['zoom'], 1, 8, 0],\n", + " 'text-halo-blur': 1},\n", + " 'source-layer': 'place_label'},\n", + " {'layout': {'icon-image': '',\n", + " 'text-font': ['DIN Pro Medium', 'Arial Unicode MS Regular'],\n", + " 'text-offset': ['step',\n", + " ['zoom'],\n", + " ['literal', [0, 0]],\n", + " 8,\n", + " ['literal', [0, 0]]],\n", + " 'text-anchor': ['step', ['zoom'], 'center', 8, 'center'],\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 'text-max-width': 7,\n", + " 'text-line-height': 1.1,\n", + " 'text-size': ['interpolate',\n", + " ['cubic-bezier', 0.2, 0, 0.9, 1],\n", + " ['zoom'],\n", + " 8,\n", + " ['step', ['get', 'symbolrank'], 18, 9, 17, 10, 15],\n", + " 15,\n", + " ['step',\n", + " ['get', 'symbolrank'],\n", + " 28,\n", + " 9,\n", + " 26,\n", + " 10,\n", + " 23,\n", + " 11,\n", + " 21,\n", + " 12,\n", + " 20,\n", + " 13,\n", + " 19,\n", + " 15,\n", + " 16]]},\n", + " 'metadata': {'mapbox:featureComponent': 'place-labels',\n", + " 'mapbox:group': 'Place labels, place-labels'},\n", + " 'maxzoom': 15,\n", + " 'filter': ['all',\n", + " ['<=', ['get', 'filterrank'], 3],\n", + " ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match',\n", + " ['get', 'class'],\n", + " ['settlement', 'disputed_settlement'],\n", + " True,\n", + " False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['==', ['get', 'class'], 'settlement']],\n", + " ['step',\n", + " ['zoom'],\n", + " False,\n", + " 8,\n", + " ['<', ['get', 'symbolrank'], 11],\n", + " 10,\n", + " ['<', ['get', 'symbolrank'], 12],\n", + " 11,\n", + " ['<', ['get', 'symbolrank'], 13],\n", + " 12,\n", + " ['<', ['get', 'symbolrank'], 15],\n", + " 13,\n", + " ['>=', ['get', 'symbolrank'], 11],\n", + " 14,\n", + " ['>=', ['get', 'symbolrank'], 13]]],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'settlement-major-label',\n", + " 'paint': {'text-color': 'hsl(212, 8%, 84%)',\n", + " 'text-halo-color': 'hsl(216, 43%, 0%)',\n", + " 'text-halo-width': 1,\n", + " 'icon-opacity': ['step', ['zoom'], 1, 8, 0],\n", + " 'text-halo-blur': 1},\n", + " 'source-layer': 'place_label'},\n", + " {'minzoom': 3,\n", + " 'layout': {'text-size': ['interpolate',\n", + " ['cubic-bezier', 0.85, 0.7, 0.65, 1],\n", + " ['zoom'],\n", + " 4,\n", + " ['step', ['get', 'symbolrank'], 10, 6, 9.5, 7, 9],\n", + " 9,\n", + " ['step', ['get', 'symbolrank'], 24, 6, 18, 7, 14]],\n", + " 'text-transform': 'uppercase',\n", + " 'text-font': ['DIN Pro Bold', 'Arial Unicode MS Bold'],\n", + " 'text-field': ['step',\n", + " ['zoom'],\n", + " ['step',\n", + " ['get', 'symbolrank'],\n", + " ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 5,\n", + " ['coalesce', ['get', 'abbr'], ['get', 'name_en'], ['get', 'name']]],\n", + " 5,\n", + " ['coalesce', ['get', 'name_en'], ['get', 'name']]],\n", + " 'text-letter-spacing': 0.15,\n", + " 'text-max-width': 6},\n", + " 'metadata': {'mapbox:featureComponent': 'place-labels',\n", + " 'mapbox:group': 'Place labels, place-labels'},\n", + " 'maxzoom': 9,\n", + " 'filter': ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match', ['get', 'class'], ['state', 'disputed_state'], True, False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['==', ['get', 'class'], 'state']],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'state-label',\n", + " 'paint': {'text-color': 'hsl(212, 8%, 84%)',\n", + " 'text-halo-color': 'hsl(216, 43%, 0%)',\n", + " 'text-halo-width': 1},\n", + " 'source-layer': 'place_label'},\n", + " {'minzoom': 1,\n", + " 'layout': {'icon-image': '',\n", + " 'text-field': ['coalesce', ['get', 'name_en'], ['get', 'name']],\n", + " 'text-line-height': 1.1,\n", + " 'text-max-width': 6,\n", + " 'text-font': ['DIN Pro Medium', 'Arial Unicode MS Regular'],\n", + " 'text-offset': ['literal', [0, 0]],\n", + " 'text-size': ['interpolate',\n", + " ['cubic-bezier', 0.2, 0, 0.7, 1],\n", + " ['zoom'],\n", + " 1,\n", + " ['step', ['get', 'symbolrank'], 11, 4, 9, 5, 8],\n", + " 9,\n", + " ['step', ['get', 'symbolrank'], 28, 4, 22, 5, 21]]},\n", + " 'metadata': {'mapbox:featureComponent': 'place-labels',\n", + " 'mapbox:group': 'Place labels, place-labels'},\n", + " 'maxzoom': 10,\n", + " 'filter': ['case',\n", + " ['==', ['get', 'disputed'], 'true'],\n", + " ['all',\n", + " ['match', ['get', 'class'], ['country', 'disputed_country'], True, False],\n", + " ['match', ['get', 'worldview'], ['all', 'US'], True, False]],\n", + " ['==', ['get', 'class'], 'country']],\n", + " 'type': 'symbol',\n", + " 'source': 'composite',\n", + " 'id': 'country-label',\n", + " 'paint': {'icon-opacity': ['step',\n", + " ['zoom'],\n", + " ['case', ['has', 'text_anchor'], 1, 0],\n", + " 7,\n", + " 0],\n", + " 'text-color': 'hsl(212, 8%, 84%)',\n", + " 'text-halo-color': ['interpolate',\n", + " ['linear'],\n", + " ['zoom'],\n", + " 2,\n", + " 'hsla(216, 43%, 0%, 0.75)',\n", + " 3,\n", + " 'hsl(216, 43%, 0%)'],\n", + " 'text-halo-width': 1.25},\n", + " 'source-layer': 'place_label'}],\n", + " 'created': '2020-06-18T14:37:20.087Z',\n", + " 'id': 'ckbkw1qa114hp1iploj57us76',\n", + " 'modified': '2020-06-18T14:44:02.639Z',\n", + " 'owner': 'laxatives',\n", + " 'visibility': 'public',\n", + " 'draft': False}" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import json\n", + "\n", + "\n", + "style_json = \"\"\"\n", + "{\"version\":8,\"name\":\"Basic\",\"metadata\":{\"mapbox:type\":\"default\",\"mapbox:origin\":\"basic-v1\",\"mapbox:sdk-support\":{\"js\":\"1.9.0\",\"android\":\"8.6.0\",\"ios\":\"5.6.0\"},\"mapbox:autocomposite\":true,\"mapbox:groups\":{\"Road network, traffic-and-closures\":{\"name\":\"Road network, traffic-and-closures\",\"collapsed\":false},\"Transit, transit-labels\":{\"name\":\"Transit, transit-labels\",\"collapsed\":false},\"Administrative boundaries, admin\":{\"name\":\"Administrative boundaries, admin\",\"collapsed\":false},\"Land & water, built\":{\"name\":\"Land & water, built\",\"collapsed\":false},\"Transit, bridges\":{\"name\":\"Transit, bridges\",\"collapsed\":false},\"Transit, surface\":{\"name\":\"Transit, surface\",\"collapsed\":false},\"Land & water, land\":{\"name\":\"Land & water, land\",\"collapsed\":false},\"Road network, bridges\":{\"name\":\"Road network, bridges\",\"collapsed\":false},\"Road network, tunnels\":{\"name\":\"Road network, tunnels\",\"collapsed\":false},\"Road network, road-labels\":{\"name\":\"Road network, road-labels\",\"collapsed\":false},\"Buildings, built\":{\"name\":\"Buildings, built\",\"collapsed\":false},\"Natural features, natural-labels\":{\"name\":\"Natural features, natural-labels\",\"collapsed\":false},\"Road network, surface\":{\"name\":\"Road network, surface\",\"collapsed\":false},\"Walking, cycling, etc., barriers-bridges\":{\"name\":\"Walking, cycling, etc., barriers-bridges\",\"collapsed\":false},\"Place labels, place-labels\":{\"name\":\"Place labels, place-labels\",\"collapsed\":false},\"Point of interest labels, poi-labels\":{\"name\":\"Point of interest labels, poi-labels\",\"collapsed\":false},\"Walking, cycling, etc., tunnels\":{\"name\":\"Walking, cycling, etc., tunnels\",\"collapsed\":false},\"Road network, tunnels-case\":{\"name\":\"Road network, tunnels-case\",\"collapsed\":false},\"Walking, cycling, etc., walking-cycling-labels\":{\"name\":\"Walking, cycling, etc., walking-cycling-labels\",\"collapsed\":false},\"Walking, cycling, etc., surface\":{\"name\":\"Walking, cycling, etc., surface\",\"collapsed\":false},\"Transit, built\":{\"name\":\"Transit, built\",\"collapsed\":false},\"Road network, surface-icons\":{\"name\":\"Road network, surface-icons\",\"collapsed\":false},\"Land & water, water\":{\"name\":\"Land & water, water\",\"collapsed\":false}}},\"center\":[104.05519132674772,30.65779911262051],\"zoom\":13.115269073336819,\"bearing\":0,\"pitch\":0,\"sources\":{\"mapbox://mapbox.mapbox-traffic-v1\":{\"url\":\"mapbox://mapbox.mapbox-traffic-v1\",\"type\":\"vector\"},\"mapbox://mapbox.mapbox-incidents-v1\":{\"url\":\"mapbox://mapbox.mapbox-incidents-v1\",\"type\":\"vector\"},\"composite\":{\"url\":\"mapbox://mapbox.mapbox-terrain-v2,mapbox.mapbox-streets-v8\",\"type\":\"vector\"}},\"sprite\":\"mapbox://sprites/laxatives/ckbkw1qa114hp1iploj57us76/6in03c0rey8lea14moulozapz\",\"glyphs\":\"mapbox://fonts/laxatives/{fontstack}/{range}.pbf\",\"layers\":[{\"id\":\"land\",\"type\":\"background\",\"layout\":{},\"paint\":{\"background-color\":\"hsl(216, 36%, 16%)\"},\"metadata\":{\"mapbox:featureComponent\":\"land-and-water\",\"mapbox:group\":\"Land & water, land\"}},{\"id\":\"landcover\",\"type\":\"fill\",\"source\":\"composite\",\"source-layer\":\"landcover\",\"maxzoom\":7,\"layout\":{},\"paint\":{\"fill-color\":[\"match\",[\"get\",\"class\"],\"snow\",\"hsl(216, 38%, 39%)\",\"hsl(152, 37%, 2%)\"],\"fill-opacity\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],2,0.3,7,0],\"fill-antialias\":false},\"metadata\":{\"mapbox:featureComponent\":\"land-and-water\",\"mapbox:group\":\"Land & water, land\"}},{\"minzoom\":5,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"land-and-water\",\"mapbox:group\":\"Land & water, land\"},\"filter\":[\"==\",[\"get\",\"class\"],\"national_park\"],\"type\":\"fill\",\"source\":\"composite\",\"id\":\"national-park\",\"paint\":{\"fill-color\":\"hsl(170, 37%, 11%)\",\"fill-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],5,0,6,0.5,10,0.5]},\"source-layer\":\"landuse_overlay\"},{\"minzoom\":5,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"land-and-water\",\"mapbox:group\":\"Land & water, land\"},\"filter\":[\"match\",[\"get\",\"class\"],[\"park\",\"airport\",\"glacier\",\"pitch\",\"sand\",\"facility\"],true,\"cemetery\",true,\"school\",true,\"hospital\",true,false],\"type\":\"fill\",\"source\":\"composite\",\"id\":\"landuse\",\"paint\":{\"fill-color\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,[\"match\",[\"get\",\"class\"],\"park\",\"hsl(170, 37%, 11%)\",\"airport\",\"hsl(213, 39%, 22%)\",\"cemetery\",\"hsl(152, 38%, 17%)\",\"glacier\",\"hsl(197, 38%, 26%)\",\"hospital\",\"hsl(204, 29%, 18%)\",\"pitch\",\"hsl(170, 38%, 6%)\",\"sand\",\"hsl(215, 37%, 2%)\",\"school\",\"hsl(213, 34%, 12%)\",\"hsl(216, 39%, 15%)\"],16,[\"match\",[\"get\",\"class\"],\"park\",\"hsl(170, 37%, 11%)\",\"airport\",\"hsl(213, 53%, 20%)\",\"cemetery\",\"hsl(152, 38%, 17%)\",\"glacier\",\"hsl(197, 38%, 26%)\",\"hospital\",\"hsl(204, 19%, 20%)\",\"pitch\",\"hsl(170, 38%, 6%)\",\"sand\",\"hsl(215, 37%, 2%)\",\"school\",\"hsl(213, 34%, 12%)\",\"hsl(216, 39%, 15%)\"]],\"fill-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],5,0,6,[\"match\",[\"get\",\"class\"],\"glacier\",0.5,1]]},\"source-layer\":\"landuse\"},{\"minzoom\":15,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"land-and-water\",\"mapbox:group\":\"Land & water, land\"},\"filter\":[\"==\",[\"get\",\"class\"],\"pitch\"],\"type\":\"line\",\"source\":\"composite\",\"id\":\"pitch-outline\",\"paint\":{\"line-color\":\"hsl(152, 21%, 2%)\"},\"source-layer\":\"landuse\"},{\"id\":\"waterway\",\"type\":\"line\",\"source\":\"composite\",\"source-layer\":\"waterway\",\"minzoom\":8,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",11,\"round\"],\"line-join\":\"round\"},\"paint\":{\"line-color\":\"hsl(197, 48%, 6%)\",\"line-width\":[\"interpolate\",[\"exponential\",1.3],[\"zoom\"],9,[\"match\",[\"get\",\"class\"],[\"canal\",\"river\"],0.1,0],20,[\"match\",[\"get\",\"class\"],[\"canal\",\"river\"],8,3]],\"line-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],8,0,8.5,1]},\"metadata\":{\"mapbox:featureComponent\":\"land-and-water\",\"mapbox:group\":\"Land & water, water\"}},{\"id\":\"water\",\"type\":\"fill\",\"source\":\"composite\",\"source-layer\":\"water\",\"layout\":{},\"paint\":{\"fill-color\":\"hsl(197, 48%, 6%)\"},\"metadata\":{\"mapbox:featureComponent\":\"land-and-water\",\"mapbox:group\":\"Land & water, water\"}},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"land-and-water\",\"mapbox:group\":\"Land & water, built\"},\"filter\":[\"all\",[\"==\",[\"geometry-type\"],\"Polygon\"],[\"==\",[\"get\",\"class\"],\"land\"]],\"type\":\"fill\",\"source\":\"composite\",\"id\":\"land-structure-polygon\",\"paint\":{\"fill-color\":\"hsl(216, 36%, 16%)\"},\"source-layer\":\"structure\"},{\"minzoom\":13,\"layout\":{\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"land-and-water\",\"mapbox:group\":\"Land & water, built\"},\"filter\":[\"all\",[\"==\",[\"geometry-type\"],\"LineString\"],[\"==\",[\"get\",\"class\"],\"land\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"land-structure-line\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.99],[\"zoom\"],14,0.75,20,40],\"line-color\":\"hsl(216, 36%, 16%)\"},\"source-layer\":\"structure\"},{\"minzoom\":11,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"transit\",\"mapbox:group\":\"Transit, built\"},\"filter\":[\"all\",[\"==\",[\"geometry-type\"],\"Polygon\"],[\"match\",[\"get\",\"type\"],[\"runway\",\"taxiway\",\"helipad\"],true,false]],\"type\":\"fill\",\"source\":\"composite\",\"id\":\"aeroway-polygon\",\"paint\":{\"fill-color\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,\"hsl(213, 31%, 13%)\",16,\"hsl(213, 19%, 15%)\"],\"fill-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],11,0,11.5,1]},\"source-layer\":\"aeroway\"},{\"minzoom\":9,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"transit\",\"mapbox:group\":\"Transit, built\"},\"filter\":[\"==\",[\"geometry-type\"],\"LineString\"],\"type\":\"line\",\"source\":\"composite\",\"id\":\"aeroway-line\",\"paint\":{\"line-color\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,\"hsl(213, 31%, 13%)\",16,\"hsl(213, 19%, 15%)\"],\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],9,[\"match\",[\"get\",\"type\"],\"runway\",1,0.5],18,[\"match\",[\"get\",\"type\"],\"runway\",80,20]]},\"source-layer\":\"aeroway\"},{\"minzoom\":15,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"buildings\",\"mapbox:group\":\"Buildings, built\"},\"filter\":[\"all\",[\"!=\",[\"get\",\"type\"],\"building:part\"],[\"==\",[\"get\",\"underground\"],\"false\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"building-outline\",\"paint\":{\"line-color\":\"hsl(216, 32%, 12%)\",\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,0.75,20,3],\"line-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,0,16,1]},\"source-layer\":\"building\"},{\"minzoom\":15,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"buildings\",\"mapbox:group\":\"Buildings, built\"},\"filter\":[\"all\",[\"!=\",[\"get\",\"type\"],\"building:part\"],[\"==\",[\"get\",\"underground\"],\"false\"]],\"type\":\"fill\",\"source\":\"composite\",\"id\":\"building\",\"paint\":{\"fill-color\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,\"hsl(216, 35%, 17%)\",16,\"hsl(216, 31%, 14%)\"],\"fill-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,0,16,1],\"fill-outline-color\":\"hsl(216, 32%, 12%)\"},\"source-layer\":\"building\"},{\"minzoom\":15,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels-case\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"track\",\"secondary_link\",\"tertiary_link\",\"service\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-minor-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],15,1.125,18,2.25],\"line-color\":\"hsl(216, 34%, 27%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,[\"match\",[\"get\",\"class\"],\"track\",1,0.5],18,10,22,75],\"line-dasharray\":[3,3]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels-case\"},\"maxzoom\":14,\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"street\",\"street_limited\",\"primary_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-street-low-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.5,14,2],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels-case\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"street\",\"street_limited\",\"primary_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-street-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,0.75,18,3],\"line-color\":\"hsl(216, 34%, 27%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,2,18,20,22,175],\"line-dasharray\":[3,3]},\"source-layer\":\"road\"},{\"minzoom\":12,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels-case\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"secondary\",\"tertiary\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-secondary-tertiary-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.125,18,3],\"line-color\":\"hsl(216, 34%, 27%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,0.75,18,28,22,200],\"line-dasharray\":[3,3]},\"source-layer\":\"road\"},{\"minzoom\":10,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels-case\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"==\",[\"get\",\"class\"],\"primary\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-primary-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.5,18,3],\"line-color\":\"hsl(216, 34%, 27%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1.125,18,32,22,225],\"line-dasharray\":[3,3]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels-case\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-major-link-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.125,18,3],\"line-color\":\"hsl(216, 34%, 27%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.75,14,2,18,20,22,175],\"line-dasharray\":[3,3]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels-case\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-motorway-trunk-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.5,18,3],\"line-color\":\"hsl(216, 34%, 27%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1.25,18,32,22,225],\"line-dasharray\":[3,3]},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels-case\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"==\",[\"get\",\"class\"],\"construction\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-construction-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,2,18,20,22,175],\"line-color\":\"hsl(216, 36%, 14%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[0.4,0.8]],15,[\"literal\",[0.3,0.6]],16,[\"literal\",[0.2,0.3]],17,[\"literal\",[0.2,0.25]],18,[\"literal\",[0.15,0.15]]]},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., tunnels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"==\",[\"get\",\"class\"],\"path\"],[\"!=\",[\"get\",\"type\"],\"steps\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-path\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,1,18,4],\"line-color\":\"hsl(216, 50%, 35%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],15,[\"literal\",[1.75,1]],16,[\"literal\",[1,0.75]],17,[\"literal\",[1,0.5]]]},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., tunnels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"==\",[\"get\",\"type\"],\"steps\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-steps\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,1,16,1.6,18,6],\"line-color\":\"hsl(216, 50%, 35%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],15,[\"literal\",[1.75,1]],16,[\"literal\",[1,0.75]],17,[\"literal\",[0.3,0.3]]]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., tunnels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"==\",[\"get\",\"class\"],\"pedestrian\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-pedestrian\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,0.5,18,12],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],15,[\"literal\",[1.5,0.4]],16,[\"literal\",[1,0.2]]]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-major-link-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.75,14,2,18,20,22,175],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"track\",\"secondary_link\",\"tertiary_link\",\"service\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-minor-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,[\"match\",[\"get\",\"class\"],\"track\",1,0.5],18,10,22,75],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"street\",\"street_limited\",\"primary_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-street-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.5,14,2,18,20,22,175],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"secondary\",\"tertiary\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-secondary-tertiary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,0.75,18,28,22,200],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"==\",[\"get\",\"class\"],\"primary\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-primary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1.125,18,32,22,225],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, tunnels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"tunnel-motorway-trunk-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1.25,18,32,22,225],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":12,\"layout\":{\"line-join\":[\"step\",[\"zoom\"],\"miter\",14,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"class\"],\"path\"],[\"step\",[\"zoom\"],[\"!\",[\"match\",[\"get\",\"type\"],[\"steps\",\"sidewalk\",\"crossing\"],true,false]],16,[\"!=\",[\"get\",\"type\"],\"steps\"]],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-path-bg\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,2,18,7],\"line-color\":\"hsl(216, 31%, 14%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"type\"],\"steps\"],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-steps-bg\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,2,17,4.6,18,7],\"line-opacity\":0.75,\"line-color\":\"hsl(216, 31%, 14%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-join\":[\"step\",[\"zoom\"],\"miter\",14,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"class\"],\"pedestrian\"],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-pedestrian-case\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,2,18,14.5],\"line-color\":\"hsl(216, 31%, 14%)\"},\"source-layer\":\"road\"},{\"minzoom\":12,\"layout\":{\"line-join\":[\"step\",[\"zoom\"],\"miter\",14,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"class\"],\"path\"],[\"step\",[\"zoom\"],[\"!\",[\"match\",[\"get\",\"type\"],[\"steps\",\"sidewalk\",\"crossing\"],true,false]],16,[\"!=\",[\"get\",\"type\"],\"steps\"]],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-path\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],13,0.5,14,1,15,1,18,4],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],15,[\"literal\",[1.75,1]],16,[\"literal\",[1,0.75]],17,[\"literal\",[1,0.5]]]},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"type\"],\"steps\"],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-steps\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,1,16,1.6,18,6],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],15,[\"literal\",[1.75,1]],16,[\"literal\",[1,0.75]],17,[\"literal\",[0.3,0.3]]]},\"source-layer\":\"road\"},{\"minzoom\":12,\"layout\":{\"line-join\":[\"step\",[\"zoom\"],\"miter\",14,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"class\"],\"pedestrian\"],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-pedestrian\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,0.5,18,12],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],15,[\"literal\",[1.5,0.4]],16,[\"literal\",[1,0.2]]]},\"source-layer\":\"road\"},{\"minzoom\":12,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., surface\"},\"filter\":[\"all\",[\"==\",[\"geometry-type\"],\"Polygon\"],[\"match\",[\"get\",\"class\"],[\"path\",\"pedestrian\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"case\",[\"has\",\"layer\"],[\">=\",[\"get\",\"layer\"],0],true]],\"type\":\"fill\",\"source\":\"composite\",\"id\":\"road-pedestrian-polygon-fill\",\"paint\":{\"fill-color\":\"hsl(216, 38%, 16%)\",\"fill-outline-color\":\"hsl(216, 31%, 14%)\"},\"source-layer\":\"road\"},{\"minzoom\":16,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., surface\"},\"filter\":[\"all\",[\"==\",[\"geometry-type\"],\"Polygon\"],[\"match\",[\"get\",\"class\"],[\"path\",\"pedestrian\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"case\",[\"has\",\"layer\"],[\">=\",[\"get\",\"layer\"],0],true]],\"type\":\"fill\",\"source\":\"composite\",\"id\":\"road-pedestrian-polygon-pattern\",\"paint\":{\"fill-pattern\":\"pedestrian-polygon\",\"fill-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],16,0,16.25,1]},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"icon-image\":\"turning-circle-outline\",\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,0.06,22,1.4],\"icon-allow-overlap\":true,\"icon-ignore-placement\":true,\"icon-padding\":0,\"icon-rotation-alignment\":\"map\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"geometry-type\"],\"Point\"],[\"match\",[\"get\",\"class\"],[\"turning_circle\",\"turning_loop\"],true,false]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"turning-feature-outline-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"track\",\"secondary_link\",\"tertiary_link\",\"service\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-minor-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],15,1.125,18,2.25],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,[\"match\",[\"get\",\"class\"],\"track\",1,0.5],18,10,22,75]},\"source-layer\":\"road\"},{\"minzoom\":11,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",14,\"round\"],\"line-join\":[\"step\",[\"zoom\"],\"miter\",14,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"maxzoom\":14,\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"street\",\"street_limited\",\"primary_link\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-street-low-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.5,14,2],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",13,\"round\"],\"line-join\":[\"step\",[\"zoom\"],\"miter\",13,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"street\",\"street_limited\",\"primary_link\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-street-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,0.75,18,3],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,2,18,20,22,175]},\"source-layer\":\"road\"},{\"minzoom\":12,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"secondary\",\"tertiary\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-secondary-tertiary-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.125,18,3],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,0.75,18,28,22,200]},\"source-layer\":\"road\"},{\"minzoom\":12,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"class\"],\"primary\"],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-primary-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.5,18,3],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1.125,18,32,22,225]},\"source-layer\":\"road\"},{\"minzoom\":11,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",13,\"round\"],\"line-join\":[\"step\",[\"zoom\"],\"miter\",13,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-major-link-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.125,18,3],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.75,14,2,18,20,22,175]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-motorway-trunk-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.5,18,3],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1.25,18,32,22,225]},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"class\"],\"construction\"],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-construction-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,2,18,20,22,175],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[0.4,0.8]],15,[\"literal\",[0.3,0.6]],16,[\"literal\",[0.2,0.3]],17,[\"literal\",[0.2,0.25]],18,[\"literal\",[0.15,0.15]]]},\"source-layer\":\"road\"},{\"minzoom\":11,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",13,\"round\"],\"line-join\":[\"step\",[\"zoom\"],\"miter\",13,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-major-link-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.75,14,2,18,20,22,175],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"track\",\"secondary_link\",\"tertiary_link\",\"service\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-minor-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,[\"match\",[\"get\",\"class\"],\"track\",1,0.5],18,10,22,75],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"match\",[\"get\",\"class\"],[\"link\",\"primary_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-tunnel-link-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1,18,7,22,22],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0,15,3.5,18,7]},\"source-layer\":\"traffic\"},{\"minzoom\":15,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"==\",[\"get\",\"class\"],\"service\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-tunnel-minor-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,0.75,18,7,22,18],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,1,18,7,22,30]},\"source-layer\":\"traffic\"},{\"minzoom\":14,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"street\",\"street_limited\",\"primary_link\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-street-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.5,14,2,18,20,22,175],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"==\",[\"get\",\"class\"],\"street\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-tunnel-street-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,1,18,7,22,22],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,1,18,6,22,30]},\"source-layer\":\"traffic\"},{\"minzoom\":8,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",11,\"round\"],\"line-join\":[\"step\",[\"zoom\"],\"miter\",11,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"secondary\",\"tertiary\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-secondary-tertiary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,0.175,10,0.75,18,28,22,200],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"match\",[\"get\",\"class\"],[\"secondary\",\"tertiary\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-tunnel-secondary-tertiary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1,18,7],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,1,15,3,18,7,22,60]},\"source-layer\":\"traffic\"},{\"minzoom\":6,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",11,\"round\"],\"line-join\":[\"step\",[\"zoom\"],\"miter\",11,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"class\"],\"primary\"],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-primary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1.125,18,32,22,225],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"==\",[\"get\",\"class\"],\"primary\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-tunnel-primary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1,18,7,22,22],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,1,18,10,22,80]},\"source-layer\":\"traffic\"},{\"minzoom\":5,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"maxzoom\":13,\"filter\":[\"all\",[\"step\",[\"zoom\"],[\"==\",[\"get\",\"class\"],\"motorway\"],6,[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false]],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-motorway-trunk-case-low-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.5,18,3],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1.25,18,32]},\"source-layer\":\"road\"},{\"minzoom\":6,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-tunnel-major-link-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1,18,7,22,22],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0,15,3.5,18,7]},\"source-layer\":\"traffic\"},{\"minzoom\":5,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",8,\"round\"],\"line-join\":[\"step\",[\"zoom\"],\"miter\",8,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-motorway-trunk-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1.25,18,32,22,225],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-tunnel-motorway-trunk-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],6,1,13,4,18,7,22,22],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],7,0,9,1,15,3,18,7,22,80]},\"source-layer\":\"traffic\"},{\"minzoom\":13,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"transit\",\"mapbox:group\":\"Transit, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"major_rail\",\"minor_rail\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-rail\",\"paint\":{\"line-color\":\"hsl(216, 31%, 14%)\",\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,0.5,20,1]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"transit\",\"mapbox:group\":\"Transit, surface\"},\"filter\":[\"all\",[\"match\",[\"get\",\"class\"],[\"major_rail\",\"minor_rail\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"road-rail-tracks\",\"paint\":{\"line-color\":\"hsl(216, 31%, 14%)\",\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,4,20,8],\"line-dasharray\":[0.1,15],\"line-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],13.75,0,14,1]},\"source-layer\":\"road\"},{\"minzoom\":16,\"layout\":{\"icon-image\":\"level-crossing\",\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],16,0.25,22,1],\"icon-allow-overlap\":true},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface-icons\"},\"filter\":[\"==\",[\"get\",\"class\"],\"level_crossing\"],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"level-crossing-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"icon-image\":\"turning-circle\",\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,0.05,22,1.5],\"icon-allow-overlap\":true,\"icon-ignore-placement\":true,\"icon-padding\":0,\"icon-rotation-alignment\":\"map\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, surface-icons\"},\"filter\":[\"all\",[\"==\",[\"geometry-type\"],\"Point\"],[\"match\",[\"get\",\"class\"],[\"turning_circle\",\"turning_loop\"],true,false]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"turning-feature-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",14,\"round\"],\"line-join\":[\"step\",[\"zoom\"],\"miter\",14,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., barriers-bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"get\",\"class\"],\"path\"],[\"step\",[\"zoom\"],[\"!\",[\"match\",[\"get\",\"type\"],[\"steps\",\"sidewalk\",\"crossing\"],true,false]],16,[\"!=\",[\"get\",\"type\"],\"steps\"]],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-path-bg\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,2,18,7],\"line-color\":\"hsl(216, 31%, 14%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., barriers-bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"type\"],\"steps\"],[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-steps-bg\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,2,17,4.6,18,7],\"line-opacity\":0.75,\"line-color\":\"hsl(216, 31%, 14%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., barriers-bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"get\",\"class\"],\"pedestrian\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-pedestrian-case\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,2,18,14.5],\"line-color\":\"hsl(216, 31%, 14%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., barriers-bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"get\",\"class\"],\"path\"],[\"==\",[\"geometry-type\"],\"LineString\"],[\"!=\",[\"get\",\"type\"],\"steps\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-path\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,1,18,4],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],15,[\"literal\",[1.75,1]],16,[\"literal\",[1,0.75]],17,[\"literal\",[1,0.5]]]},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., barriers-bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"type\"],\"steps\"],[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-steps\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,1,16,1.6,18,6],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],15,[\"literal\",[1.75,1]],16,[\"literal\",[1,0.75]],17,[\"literal\",[0.3,0.3]]]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., barriers-bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"get\",\"class\"],\"pedestrian\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-pedestrian\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,0.5,18,12],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],15,[\"literal\",[1.5,0.4]],16,[\"literal\",[1,0.2]]]},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"track\",\"secondary_link\",\"tertiary_link\",\"service\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-minor-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],15,1.125,18,2.25],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,[\"match\",[\"get\",\"class\"],\"track\",1,0.5],18,10,22,75]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"maxzoom\":14,\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"street\",\"street_limited\",\"primary_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-street-low-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.5,14,2],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"street\",\"street_limited\",\"primary_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-street-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,0.75,18,3],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,2,18,20,22,175]},\"source-layer\":\"road\"},{\"minzoom\":12,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"secondary\",\"tertiary\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-secondary-tertiary-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.125,18,3],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,0.75,18,28,22,200]},\"source-layer\":\"road\"},{\"minzoom\":12,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"get\",\"class\"],\"primary\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-primary-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.5,18,3],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1.125,18,32,22,225]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"<=\",[\"get\",\"layer\"],1],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-major-link-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.125,18,3],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.75,14,2,18,20,22,175]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"<=\",[\"get\",\"layer\"],1],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-motorway-trunk-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.5,18,3],\"line-color\":\"hsl(216, 31%, 14%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1.25,18,32,22,225]},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"get\",\"class\"],\"construction\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-construction-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,2,18,20,22,175],\"line-color\":\"hsl(216, 37%, 24%)\",\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[0.4,0.8]],15,[\"literal\",[0.3,0.6]],16,[\"literal\",[0.2,0.3]],17,[\"literal\",[0.2,0.25]],18,[\"literal\",[0.15,0.15]]]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"<=\",[\"get\",\"layer\"],1],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-major-link-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.75,14,2,18,20,22,175],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"track\",\"secondary_link\",\"tertiary_link\",\"service\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-minor-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,[\"match\",[\"get\",\"class\"],\"track\",1,0.5],18,10,22,75],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"street\",\"street_limited\",\"primary_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-street-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.5,14,2,18,20,22,175],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-cap\":[\"step\",[\"zoom\"],\"butt\",11,\"round\"],\"line-join\":[\"step\",[\"zoom\"],\"miter\",11,\"round\"]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"secondary\",\"tertiary\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-secondary-tertiary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,0.75,18,28,22,200],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"get\",\"class\"],\"primary\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-primary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1.125,18,32,22,225],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"<=\",[\"get\",\"layer\"],1],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-motorway-trunk-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1.25,18,32,22,225],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\">=\",[\"get\",\"layer\"],2],[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-major-link-2-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.125,18,3],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.75,14,2,18,20,22,175]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\">=\",[\"get\",\"layer\"],2],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-motorway-trunk-2-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.2],[\"zoom\"],10,1.5,18,3],\"line-color\":\"hsl(211, 17%, 40%)\",\"line-gap-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1.25,18,32,22,225]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\">=\",[\"get\",\"layer\"],2],[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-major-link-2-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0.75,14,2,18,20,22,175],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-cap\":\"round\",\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\">=\",[\"get\",\"layer\"],2],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-motorway-trunk-2-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1.25,18,32,22,225],\"line-color\":\"hsl(211, 17%, 40%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"transit\",\"mapbox:group\":\"Transit, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"major_rail\",\"minor_rail\"],true,false]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-rail\",\"paint\":{\"line-color\":\"hsl(216, 31%, 14%)\",\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,0.5,20,1]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"transit\",\"mapbox:group\":\"Transit, bridges\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"major_rail\",\"minor_rail\"],true,false]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"bridge-rail-tracks\",\"paint\":{\"line-color\":\"hsl(216, 31%, 14%)\",\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,4,20,8],\"line-dasharray\":[0.1,15],\"line-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],13.75,0,14,1]},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"geometry-type\"],\"LineString\"],[\"!=\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"match\",[\"get\",\"class\"],[\"link\",\"primary_link\"],true,false]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-bridge-road-link-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1,18,7,22,22],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0,15,3.5,18,7]},\"source-layer\":\"traffic\"},{\"minzoom\":15,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"!=\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"==\",[\"get\",\"class\"],\"service\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-bridge-road-minor-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,0.75,18,7,22,18],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,1,18,7,22,30]},\"source-layer\":\"traffic\"},{\"minzoom\":13,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"!=\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"==\",[\"get\",\"class\"],\"street\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-bridge-road-street-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,1,18,7,22,22],\"line-color\":[\"match\",[\"get\",\"congestion\"],\"low\",\"hsl(216, 37%, 24%)\",\"moderate\",\"hsl(216, 37%, 24%)\",\"heavy\",\"hsl(216, 37%, 24%)\",\"severe\",\"hsl(216, 37%, 24%)\",\"hsla(0, 0%, 0%, 0)\"],\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],14,1,18,7,22,60]},\"source-layer\":\"traffic\"},{\"minzoom\":8,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"!=\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"match\",[\"get\",\"class\"],[\"secondary\",\"tertiary\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-bridge-road-secondary-tertiary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1,18,7,22,22],\"line-color\":[\"match\",[\"get\",\"congestion\"],\"low\",\"hsl(216, 37%, 24%)\",\"moderate\",\"hsl(216, 37%, 24%)\",\"heavy\",\"hsl(216, 37%, 24%)\",\"severe\",\"hsl(216, 37%, 24%)\",\"hsla(0, 0%, 0%, 0)\"],\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,1,15,3,18,7,22,60]},\"source-layer\":\"traffic\"},{\"minzoom\":6,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"!=\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"==\",[\"get\",\"class\"],\"primary\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-bridge-road-primary-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1,18,7,22,22],\"line-color\":[\"match\",[\"get\",\"congestion\"],\"low\",\"hsl(216, 37%, 24%)\",\"moderate\",\"hsl(216, 37%, 24%)\",\"heavy\",\"hsl(216, 37%, 24%)\",\"severe\",\"hsl(216, 37%, 24%)\",\"hsla(0, 0%, 0%, 0)\"],\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,1,18,10,22,80]},\"source-layer\":\"traffic\"},{\"minzoom\":6,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"!=\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"match\",[\"get\",\"class\"],[\"motorway_link\",\"trunk_link\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-bridge-road-major-link-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],10,1,18,7,22,22],\"line-color\":\"hsla(0, 0%, 0%, 0)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,0,15,3.5,18,7]},\"source-layer\":\"traffic\"},{\"minzoom\":5,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"maxzoom\":13,\"filter\":[\"all\",[\"!=\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-bridge-road-motorway-trunk-case-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],6,2,13,7,18,10],\"line-color\":\"hsl(216, 37%, 24%)\",\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],7,0,9,1,15,3,18,7]},\"source-layer\":\"traffic\"},{\"minzoom\":5,\"layout\":{\"line-round-limit\":1.5,\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"!=\",[\"get\",\"structure\"],\"tunnel\"],[\"has\",\"congestion\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],true,false],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-traffic-v1\",\"id\":\"traffic-bridge-road-motorway-trunk-navigation\",\"paint\":{\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],6,1,13,4,18,7,22,22],\"line-color\":[\"match\",[\"get\",\"congestion\"],\"low\",\"hsl(216, 37%, 24%)\",\"moderate\",\"hsl(216, 37%, 24%)\",\"heavy\",\"hsl(216, 37%, 24%)\",\"severe\",\"hsl(216, 37%, 24%)\",\"hsla(0, 0%, 0%, 0)\"],\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],7,0,9,1,15,3,18,7,22,80]},\"source-layer\":\"traffic\"},{\"minzoom\":16,\"layout\":{\"icon-image\":\"level-crossing\",\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],16,0.25,22,1],\"icon-allow-overlap\":true},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"==\",[\"get\",\"class\"],\"level_crossing\"],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"traffic-level-crossing-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"symbol-placement\":\"line\",\"symbol-spacing\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,400,18,600,22,1200],\"icon-image\":[\"step\",[\"zoom\"],\"oneway-small\",17,[\"match\",[\"get\",\"class\"],[\"primary\",\"secondary\",\"tertiary\",\"street\",\"street_limited\"],\"oneway-large\",\"oneway-small\"],18,\"oneway-large\"],\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,0.25,20,1],\"icon-rotation-alignment\":\"map\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"==\",[\"get\",\"oneway\"],\"true\"],[\"step\",[\"zoom\"],[\"match\",[\"get\",\"class\"],[\"primary\",\"secondary\",\"street\",\"street_limited\",\"tertiary\"],true,false],16,[\"match\",[\"get\",\"class\"],[\"primary\",\"secondary\",\"tertiary\",\"street\",\"street_limited\",\"primary_link\",\"secondary_link\",\"tertiary_link\",\"service\",\"track\"],true,false]]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"traffic-tunnel-oneway-arrow-blue-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"symbol-placement\":\"line\",\"symbol-spacing\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,400,18,600,22,1200],\"icon-image\":[\"step\",[\"zoom\"],\"oneway-white-small\",17,\"oneway-white-large\"],\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,0.4,20,1]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"tunnel\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"motorway_link\",\"trunk\",\"trunk_link\"],true,false],[\"==\",[\"get\",\"oneway\"],\"true\"]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"traffic-tunnel-oneway-arrow-white-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"symbol-placement\":\"line\",\"symbol-spacing\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,400,18,600,22,1200],\"icon-image\":[\"step\",[\"zoom\"],\"oneway-small\",17,[\"match\",[\"get\",\"class\"],[\"primary\",\"secondary\",\"tertiary\",\"street\",\"street_limited\"],\"oneway-large\",\"oneway-small\"],18,\"oneway-large\"],\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,0.25,20,1],\"icon-rotation-alignment\":\"map\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"oneway\"],\"true\"],[\"step\",[\"zoom\"],[\"match\",[\"get\",\"class\"],[\"primary\",\"secondary\",\"tertiary\",\"street\",\"street_limited\"],true,false],16,[\"match\",[\"get\",\"class\"],[\"primary\",\"secondary\",\"tertiary\",\"street\",\"street_limited\",\"primary_link\",\"secondary_link\",\"tertiary_link\",\"service\",\"track\"],true,false]],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"traffic-road-oneway-arrow-blue-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"symbol-placement\":\"line\",\"symbol-spacing\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,400,18,600,22,1200],\"icon-image\":[\"step\",[\"zoom\"],\"oneway-white-small\",17,\"oneway-white-large\"],\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,0.4,20,1]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"oneway\"],\"true\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\",\"motorway_link\",\"trunk_link\"],true,false],[\"match\",[\"get\",\"structure\"],[\"none\",\"ford\"],true,false]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"traffic-road-oneway-arrow-white-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"symbol-placement\":\"line\",\"symbol-spacing\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,400,18,600,22,1200],\"icon-image\":[\"step\",[\"zoom\"],\"oneway-small\",17,[\"match\",[\"get\",\"class\"],[\"primary\",\"secondary\",\"tertiary\",\"street\",\"street_limited\"],\"oneway-large\",\"oneway-small\"],18,\"oneway-large\"],\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,0.25,20,1],\"icon-rotation-alignment\":\"map\"},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"==\",[\"get\",\"oneway\"],\"true\"],[\"step\",[\"zoom\"],[\"match\",[\"get\",\"class\"],[\"primary\",\"secondary\",\"tertiary\",\"street\",\"street_limited\"],true,false],16,[\"match\",[\"get\",\"class\"],[\"primary\",\"secondary\",\"tertiary\",\"street\",\"street_limited\",\"primary_link\",\"secondary_link\",\"tertiary_link\",\"service\",\"track\"],true,false]]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"traffic-bridge-oneway-arrow-blue-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":15,\"layout\":{\"symbol-placement\":\"line\",\"symbol-spacing\":[\"interpolate\",[\"linear\"],[\"zoom\"],15,400,18,600,22,1200],\"icon-image\":[\"step\",[\"zoom\"],\"oneway-white-small\",17,\"oneway-white-large\"],\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],15,0.45,20,1]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"structure\"],\"bridge\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\",\"motorway_link\",\"trunk_link\"],true,false],[\"==\",[\"get\",\"oneway\"],\"true\"]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"traffic-bridge-oneway-arrow-white-navigation\",\"paint\":{},\"source-layer\":\"road\"},{\"minzoom\":8,\"layout\":{\"line-join\":\"round\",\"line-round-limit\":1.5},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"type\"],\"full\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-incidents-v1\",\"id\":\"incident-closure-lines-navigation\",\"paint\":{\"line-color\":\"hsl(216, 37%, 24%)\",\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,1,18,7,22,12],\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,1,18,10,22,20]},\"source-layer\":\"closures\"},{\"minzoom\":8,\"layout\":{\"line-join\":\"round\",\"line-round-limit\":1.5},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"type\"],\"full\"],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"line\",\"source\":\"mapbox://mapbox.mapbox-incidents-v1\",\"id\":\"incident-closure-line-highlights-navigation\",\"paint\":{\"line-color\":\"hsl(216, 0%, 57%)\",\"line-width\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,0.6,18,4.2,22,6],\"line-offset\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],12,1,18,10,22,20],\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[1,0]],14,[\"literal\",[1,1]]]},\"source-layer\":\"closures\"},{\"minzoom\":8,\"layout\":{\"icon-image\":\"road-closure\",\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,0.15,18,0.6,22,1],\"icon-allow-overlap\":true},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"type\"],\"endpoint:full\"],[\"match\",[\"geometry-type\"],[\"LineString\",\"Point\"],true,false]],\"type\":\"symbol\",\"source\":\"mapbox://mapbox.mapbox-incidents-v1\",\"id\":\"incident-endpoints-navigation\",\"paint\":{},\"source-layer\":\"closures\"},{\"minzoom\":8,\"layout\":{\"icon-image\":\"road-closure\",\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],5,0.15,18,0.6,22,1],\"icon-allow-overlap\":true},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, traffic-and-closures\"},\"filter\":[\"all\",[\"==\",[\"get\",\"type\"],\"startpoint:full\"],[\"match\",[\"geometry-type\"],[\"LineString\",\"Point\"],true,false]],\"type\":\"symbol\",\"source\":\"mapbox://mapbox.mapbox-incidents-v1\",\"id\":\"incident-startpoints-navigation\",\"paint\":{},\"source-layer\":\"closures\"},{\"id\":\"admin-1-boundary-bg\",\"type\":\"line\",\"source\":\"composite\",\"source-layer\":\"admin\",\"filter\":[\"all\",[\"==\",[\"get\",\"admin_level\"],1],[\"==\",[\"get\",\"maritime\"],\"false\"],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],\"layout\":{\"line-join\":\"bevel\"},\"paint\":{\"line-color\":[\"interpolate\",[\"linear\"],[\"zoom\"],8,\"hsl(216, 36%, 16%)\",16,\"hsl(212, 14%, 0%)\"],\"line-width\":[\"interpolate\",[\"linear\"],[\"zoom\"],7,3.75,12,5.5],\"line-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],7,0,8,0.75],\"line-dasharray\":[1,0],\"line-translate\":[0,0],\"line-blur\":[\"interpolate\",[\"linear\"],[\"zoom\"],3,0,8,3]},\"metadata\":{\"mapbox:featureComponent\":\"admin-boundaries\",\"mapbox:group\":\"Administrative boundaries, admin\"}},{\"minzoom\":1,\"layout\":{},\"metadata\":{\"mapbox:featureComponent\":\"admin-boundaries\",\"mapbox:group\":\"Administrative boundaries, admin\"},\"filter\":[\"all\",[\"==\",[\"get\",\"admin_level\"],0],[\"==\",[\"get\",\"maritime\"],\"false\"],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"admin-0-boundary-bg\",\"paint\":{\"line-width\":[\"interpolate\",[\"linear\"],[\"zoom\"],3,3.5,10,8],\"line-color\":[\"interpolate\",[\"linear\"],[\"zoom\"],6,\"hsl(216, 36%, 16%)\",8,\"hsl(212, 14%, 0%)\"],\"line-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],3,0,4,0.5],\"line-translate\":[0,0],\"line-blur\":[\"interpolate\",[\"linear\"],[\"zoom\"],3,0,10,2]},\"source-layer\":\"admin\"},{\"id\":\"admin-1-boundary\",\"type\":\"line\",\"source\":\"composite\",\"source-layer\":\"admin\",\"filter\":[\"all\",[\"==\",[\"get\",\"admin_level\"],1],[\"==\",[\"get\",\"maritime\"],\"false\"],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],\"layout\":{\"line-join\":\"round\",\"line-cap\":\"round\"},\"paint\":{\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[2,0]],7,[\"literal\",[2,2,6,2]]],\"line-width\":[\"interpolate\",[\"linear\"],[\"zoom\"],7,0.75,12,1.5],\"line-opacity\":[\"interpolate\",[\"linear\"],[\"zoom\"],2,0,3,1],\"line-color\":[\"interpolate\",[\"linear\"],[\"zoom\"],3,\"hsl(212, 4%, 84%)\",7,\"hsl(212, 2%, 84%)\"]},\"metadata\":{\"mapbox:featureComponent\":\"admin-boundaries\",\"mapbox:group\":\"Administrative boundaries, admin\"}},{\"minzoom\":1,\"layout\":{\"line-join\":\"round\",\"line-cap\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"admin-boundaries\",\"mapbox:group\":\"Administrative boundaries, admin\"},\"filter\":[\"all\",[\"==\",[\"get\",\"admin_level\"],0],[\"==\",[\"get\",\"disputed\"],\"false\"],[\"==\",[\"get\",\"maritime\"],\"false\"],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"admin-0-boundary\",\"paint\":{\"line-color\":\"hsl(212, 2%, 89%)\",\"line-width\":[\"interpolate\",[\"linear\"],[\"zoom\"],3,0.5,10,2],\"line-dasharray\":[10,0]},\"source-layer\":\"admin\"},{\"minzoom\":1,\"layout\":{\"line-join\":\"round\"},\"metadata\":{\"mapbox:featureComponent\":\"admin-boundaries\",\"mapbox:group\":\"Administrative boundaries, admin\"},\"filter\":[\"all\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"==\",[\"get\",\"admin_level\"],0],[\"==\",[\"get\",\"maritime\"],\"false\"],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],\"type\":\"line\",\"source\":\"composite\",\"id\":\"admin-0-boundary-disputed\",\"paint\":{\"line-color\":\"hsl(212, 2%, 89%)\",\"line-width\":[\"interpolate\",[\"linear\"],[\"zoom\"],3,0.5,10,2],\"line-dasharray\":[\"step\",[\"zoom\"],[\"literal\",[3.25,3.25]],6,[\"literal\",[2.5,2.5]],7,[\"literal\",[2,2.25]],8,[\"literal\",[1.75,2]]]},\"source-layer\":\"admin\"},{\"minzoom\":15,\"layout\":{\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"icon-image\":\"intersection\",\"icon-text-fit\":\"both\",\"icon-text-fit-padding\":[1,2,1,2],\"text-size\":12,\"text-font\":[\"DIN Pro Bold\",\"Arial Unicode MS Bold\"]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, road-labels\"},\"filter\":[\"all\",[\"==\",[\"get\",\"class\"],\"intersection\"],[\"has\",\"name\"]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"road-intersection\",\"paint\":{\"text-color\":\"hsl(230, 57%, 64%)\"},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"text-size\":[\"interpolate\",[\"linear\"],[\"zoom\"],10,[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\",\"primary\",\"secondary\",\"tertiary\"],10,[\"motorway_link\",\"trunk_link\",\"primary_link\",\"secondary_link\",\"tertiary_link\",\"street\",\"street_limited\"],8,6.5],18,[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\",\"primary\",\"secondary\",\"tertiary\"],16,[\"motorway_link\",\"trunk_link\",\"primary_link\",\"secondary_link\",\"tertiary_link\",\"street\",\"street_limited\"],14,13],22,[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\",\"primary\",\"secondary\",\"tertiary\"],50,[\"motorway_link\",\"trunk_link\",\"primary_link\",\"secondary_link\",\"tertiary_link\",\"street\",\"street_limited\"],40,30]],\"text-max-angle\":30,\"symbol-spacing\":[\"interpolate\",[\"linear\"],[\"zoom\"],10,150,18,450,22,1500],\"text-font\":[\"DIN Pro Regular\",\"Arial Unicode MS Regular\"],\"symbol-placement\":\"line\",\"text-padding\":1,\"text-rotation-alignment\":\"map\",\"text-pitch-alignment\":\"viewport\",\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"text-letter-spacing\":0.01},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, road-labels\"},\"filter\":[\"step\",[\"zoom\"],[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\",\"primary\",\"secondary\",\"tertiary\"],true,false],15.25,[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\",\"primary\",\"secondary\",\"tertiary\",\"street\"],true,false],16,[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\",\"primary\",\"secondary\",\"tertiary\",\"street\",\"street_limited\"],true,false],16.5,[\"match\",[\"get\",\"class\"],[\"pedestrian\",\"golf\",\"ferry\",\"aerialway\",\"path\"],false,true]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"road-label-navigation\",\"paint\":{\"text-color\":\"hsl(216, 37%, 66%)\",\"text-halo-color\":[\"match\",[\"get\",\"class\"],[\"motorway\",\"trunk\"],\"hsl(216, 36%, 2%)\",\"hsl(211, 17%, 40%)\"],\"text-halo-width\":1,\"text-halo-blur\":1},\"source-layer\":\"road\"},{\"minzoom\":6,\"layout\":{\"text-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],6,14,22,26],\"icon-image\":[\"concat\",[\"get\",\"shield\"],\"-\",[\"to-string\",[\"get\",\"reflen\"]]],\"icon-rotation-alignment\":\"viewport\",\"text-max-angle\":38,\"symbol-spacing\":[\"interpolate\",[\"linear\"],[\"zoom\"],11,150,14,200,16,400,17,500,18,500,22,1200],\"text-font\":[\"DIN Pro Bold\",\"Arial Unicode MS Bold\"],\"symbol-placement\":[\"step\",[\"zoom\"],\"point\",11,\"line\"],\"text-rotation-alignment\":\"viewport\",\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],6,0.5,13,0.5,22,1],\"text-field\":[\"get\",\"ref\"],\"text-letter-spacing\":0.05},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, road-labels\"},\"filter\":[\"all\",[\"has\",\"reflen\"],[\"<=\",[\"get\",\"reflen\"],6],[\"step\",[\"zoom\"],[\"==\",[\"geometry-type\"],\"Point\"],11,[\">\",[\"get\",\"len\"],5000],12,[\">\",[\"get\",\"len\"],2500],13,[\">\",[\"get\",\"len\"],1000],14,true]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"road-number-shield-navigation\",\"paint\":{\"text-color\":[\"match\",[\"get\",\"shield_text_color\"],\"white\",\"hsl(0, 0%, 100%)\",\"yellow\",\"hsl(50, 100%, 70%)\",\"orange\",\"hsl(25, 100%, 75%)\",\"blue\",\"hsl(230, 57%, 44%)\",\"hsl(230, 18%, 13%)\"]},\"source-layer\":\"road\"},{\"minzoom\":14,\"layout\":{\"text-field\":[\"get\",\"ref\"],\"text-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],6,14,22,26],\"text-font\":[\"DIN Pro Bold\",\"Arial Unicode MS Bold\"],\"icon-image\":[\"concat\",\"motorway-exit-\",[\"to-string\",[\"get\",\"reflen\"]]],\"icon-size\":[\"interpolate\",[\"exponential\",1.5],[\"zoom\"],6,0.5,13,0.5,22,1]},\"metadata\":{\"mapbox:featureComponent\":\"road-network\",\"mapbox:group\":\"Road network, road-labels\"},\"filter\":[\"all\",[\"has\",\"reflen\"],[\"<=\",[\"get\",\"reflen\"],9]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"road-exit-shield-navigation\",\"paint\":{\"text-color\":\"hsl(0, 0%, 100%)\"},\"source-layer\":\"motorway_junction\"},{\"minzoom\":12,\"layout\":{\"text-size\":[\"interpolate\",[\"linear\"],[\"zoom\"],10,[\"match\",[\"get\",\"class\"],\"pedestrian\",9,6.5],18,[\"match\",[\"get\",\"class\"],\"pedestrian\",14,13]],\"text-max-angle\":30,\"text-font\":[\"DIN Pro Regular\",\"Arial Unicode MS Regular\"],\"symbol-placement\":\"line\",\"text-padding\":1,\"text-rotation-alignment\":\"map\",\"text-pitch-alignment\":\"viewport\",\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"text-letter-spacing\":0.01},\"metadata\":{\"mapbox:featureComponent\":\"walking-cycling\",\"mapbox:group\":\"Walking, cycling, etc., walking-cycling-labels\"},\"filter\":[\"step\",[\"zoom\"],[\"match\",[\"get\",\"class\"],[\"pedestrian\"],true,false],15,[\"match\",[\"get\",\"class\"],[\"path\",\"pedestrian\"],true,false]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"path-pedestrian-label\",\"paint\":{\"text-color\":\"hsl(216, 37%, 66%)\",\"text-halo-color\":\"hsl(211, 17%, 40%)\",\"text-halo-width\":1,\"text-halo-blur\":1},\"source-layer\":\"road\"},{\"minzoom\":13,\"layout\":{\"text-font\":[\"DIN Pro Italic\",\"Arial Unicode MS Regular\"],\"text-max-angle\":30,\"symbol-spacing\":[\"interpolate\",[\"linear\",1],[\"zoom\"],15,250,17,400],\"text-size\":[\"interpolate\",[\"linear\"],[\"zoom\"],13,12,18,16],\"symbol-placement\":\"line\",\"text-pitch-alignment\":\"viewport\",\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]]},\"metadata\":{\"mapbox:featureComponent\":\"natural-features\",\"mapbox:group\":\"Natural features, natural-labels\"},\"filter\":[\"all\",[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"canal\",\"river\",\"stream\",\"disputed_canal\",\"disputed_river\",\"disputed_stream\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"match\",[\"get\",\"class\"],[\"canal\",\"river\",\"stream\"],true,false]],[\"==\",[\"geometry-type\"],\"LineString\"]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"waterway-label\",\"paint\":{\"text-color\":\"hsl(197, 16%, 90%)\"},\"source-layer\":\"natural_label\"},{\"minzoom\":4,\"layout\":{\"text-size\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],18,5,12],17,[\"step\",[\"get\",\"sizerank\"],18,13,12]],\"text-max-angle\":30,\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"text-font\":[\"DIN Pro Medium\",\"Arial Unicode MS Regular\"],\"symbol-placement\":\"line-center\",\"text-pitch-alignment\":\"viewport\"},\"metadata\":{\"mapbox:featureComponent\":\"natural-features\",\"mapbox:group\":\"Natural features, natural-labels\"},\"filter\":[\"all\",[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"glacier\",\"landform\",\"disputed_glacier\",\"disputed_landform\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"match\",[\"get\",\"class\"],[\"glacier\",\"landform\"],true,false]],[\"==\",[\"geometry-type\"],\"LineString\"],[\"<=\",[\"get\",\"filterrank\"],3]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"natural-line-label\",\"paint\":{\"text-halo-width\":0.5,\"text-halo-color\":\"hsl(216, 43%, 0%)\",\"text-halo-blur\":0.5,\"text-color\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],\"hsl(184, 2%, 91%)\",5,\"hsl(184, 7%, 81%)\"],17,[\"step\",[\"get\",\"sizerank\"],\"hsl(184, 2%, 91%)\",13,\"hsl(184, 7%, 81%)\"]]},\"source-layer\":\"natural_label\"},{\"minzoom\":4,\"layout\":{\"text-size\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],18,5,12],17,[\"step\",[\"get\",\"sizerank\"],18,13,12]],\"icon-image\":[\"step\",[\"zoom\"],[\"concat\",[\"get\",\"maki\"],\"-11\"],15,[\"concat\",[\"get\",\"maki\"],\"-15\"]],\"text-font\":[\"DIN Pro Medium\",\"Arial Unicode MS Regular\"],\"text-offset\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],[\"literal\",[0,0]],5,[\"literal\",[0,0.75]]],17,[\"step\",[\"get\",\"sizerank\"],[\"literal\",[0,0]],13,[\"literal\",[0,0.75]]]],\"text-anchor\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],\"center\",5,\"top\"],17,[\"step\",[\"get\",\"sizerank\"],\"center\",13,\"top\"]],\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]]},\"metadata\":{\"mapbox:featureComponent\":\"natural-features\",\"mapbox:group\":\"Natural features, natural-labels\"},\"filter\":[\"all\",[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"dock\",\"glacier\",\"landform\",\"water_feature\",\"wetland\",\"disputed_dock\",\"disputed_glacier\",\"disputed_landform\",\"disputed_water_feature\",\"disputed_wetland\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"match\",[\"get\",\"class\"],[\"dock\",\"glacier\",\"landform\",\"water_feature\",\"wetland\"],true,false]],[\"==\",[\"geometry-type\"],\"Point\"],[\"<=\",[\"get\",\"filterrank\"],3]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"natural-point-label\",\"paint\":{\"icon-opacity\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],0,5,1],17,[\"step\",[\"get\",\"sizerank\"],0,13,1]],\"text-halo-color\":\"hsl(216, 43%, 0%)\",\"text-halo-width\":0.5,\"text-halo-blur\":0.5,\"text-color\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],\"hsl(184, 2%, 91%)\",5,\"hsl(184, 7%, 81%)\"],17,[\"step\",[\"get\",\"sizerank\"],\"hsl(184, 2%, 91%)\",13,\"hsl(184, 7%, 81%)\"]]},\"source-layer\":\"natural_label\"},{\"id\":\"water-line-label\",\"type\":\"symbol\",\"metadata\":{\"mapbox:featureComponent\":\"natural-features\",\"mapbox:group\":\"Natural features, natural-labels\"},\"source\":\"composite\",\"source-layer\":\"natural_label\",\"filter\":[\"all\",[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"bay\",\"ocean\",\"reservoir\",\"sea\",\"water\",\"disputed_bay\",\"disputed_ocean\",\"disputed_reservoir\",\"disputed_sea\",\"disputed_water\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"match\",[\"get\",\"class\"],[\"bay\",\"ocean\",\"reservoir\",\"sea\",\"water\"],true,false]],[\"==\",[\"geometry-type\"],\"LineString\"]],\"layout\":{\"text-size\":[\"interpolate\",[\"linear\"],[\"zoom\"],7,[\"step\",[\"get\",\"sizerank\"],24,6,18,12,12],10,[\"step\",[\"get\",\"sizerank\"],18,9,12],18,[\"step\",[\"get\",\"sizerank\"],18,9,16]],\"text-max-angle\":30,\"text-letter-spacing\":[\"match\",[\"get\",\"class\"],\"ocean\",0.25,[\"sea\",\"bay\"],0.15,0],\"text-font\":[\"DIN Pro Italic\",\"Arial Unicode MS Regular\"],\"symbol-placement\":\"line-center\",\"text-pitch-alignment\":\"viewport\",\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]]},\"paint\":{\"text-color\":[\"match\",[\"get\",\"class\"],[\"bay\",\"ocean\",\"sea\"],\"hsl(197, 44%, 26%)\",\"hsl(197, 16%, 90%)\"]}},{\"id\":\"water-point-label\",\"type\":\"symbol\",\"source\":\"composite\",\"source-layer\":\"natural_label\",\"filter\":[\"all\",[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"bay\",\"ocean\",\"reservoir\",\"sea\",\"water\",\"disputed_bay\",\"disputed_ocean\",\"disputed_reservoir\",\"disputed_sea\",\"disputed_water\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"match\",[\"get\",\"class\"],[\"bay\",\"ocean\",\"reservoir\",\"sea\",\"water\"],true,false]],[\"==\",[\"geometry-type\"],\"Point\"]],\"layout\":{\"text-line-height\":1.3,\"text-size\":[\"interpolate\",[\"linear\"],[\"zoom\"],7,[\"step\",[\"get\",\"sizerank\"],24,6,18,12,12],10,[\"step\",[\"get\",\"sizerank\"],18,9,12]],\"text-font\":[\"DIN Pro Italic\",\"Arial Unicode MS Regular\"],\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"text-letter-spacing\":[\"match\",[\"get\",\"class\"],\"ocean\",0.25,[\"bay\",\"sea\"],0.15,0.01],\"text-max-width\":[\"match\",[\"get\",\"class\"],\"ocean\",4,\"sea\",5,[\"bay\",\"water\"],7,10]},\"paint\":{\"text-color\":[\"match\",[\"get\",\"class\"],[\"bay\",\"ocean\",\"sea\"],\"hsl(197, 44%, 26%)\",\"hsl(197, 16%, 90%)\"]},\"metadata\":{\"mapbox:featureComponent\":\"natural-features\",\"mapbox:group\":\"Natural features, natural-labels\"}},{\"minzoom\":6,\"layout\":{\"text-size\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],18,5,12],17,[\"step\",[\"get\",\"sizerank\"],18,13,12]],\"icon-image\":[\"step\",[\"zoom\"],[\"concat\",[\"get\",\"maki\"],\"-11\"],15,[\"concat\",[\"get\",\"maki\"],\"-15\"]],\"text-font\":[\"DIN Pro Medium\",\"Arial Unicode MS Regular\"],\"text-offset\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],[\"literal\",[0,0]],5,[\"literal\",[0,0.75]]],17,[\"step\",[\"get\",\"sizerank\"],[\"literal\",[0,0]],13,[\"literal\",[0,0.75]]]],\"text-anchor\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],\"center\",5,\"top\"],17,[\"step\",[\"get\",\"sizerank\"],\"center\",13,\"top\"]],\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]]},\"metadata\":{\"mapbox:featureComponent\":\"point-of-interest-labels\",\"mapbox:group\":\"Point of interest labels, poi-labels\"},\"filter\":[\"<=\",[\"get\",\"filterrank\"],[\"+\",[\"step\",[\"zoom\"],0,16,1,17,2],2]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"poi-label\",\"paint\":{\"icon-opacity\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],0,5,1],17,[\"step\",[\"get\",\"sizerank\"],0,13,1]],\"text-halo-color\":[\"match\",[\"get\",\"class\"],\"park_like\",\"hsl(170, 42%, 0%)\",\"education\",\"hsl(213, 38%, 0%)\",\"medical\",\"hsl(204, 24%, 5%)\",\"hsl(216, 43%, 0%)\"],\"text-halo-width\":0.5,\"text-halo-blur\":0.5,\"text-color\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"sizerank\"],[\"match\",[\"get\",\"class\"],\"food_and_drink\",\"hsl(180, 15%, 100%)\",\"park_like\",\"hsl(107, 1%, 84%)\",\"education\",\"hsl(213, 11%, 100%)\",\"medical\",\"hsl(204, 6%, 100%)\",\"hsl(184, 2%, 91%)\"],5,[\"match\",[\"get\",\"class\"],\"food_and_drink\",\"hsl(180, 24%, 87%)\",\"park_like\",\"hsl(107, 0%, 73%)\",\"education\",\"hsl(213, 27%, 100%)\",\"medical\",\"hsl(204, 7%, 100%)\",\"hsl(184, 7%, 81%)\"]],17,[\"step\",[\"get\",\"sizerank\"],[\"match\",[\"get\",\"class\"],\"food_and_drink\",\"hsl(180, 15%, 100%)\",\"park_like\",\"hsl(107, 1%, 84%)\",\"education\",\"hsl(213, 11%, 100%)\",\"medical\",\"hsl(204, 6%, 100%)\",\"hsl(184, 2%, 91%)\"],13,[\"match\",[\"get\",\"class\"],\"food_and_drink\",\"hsl(180, 24%, 87%)\",\"park_like\",\"hsl(107, 0%, 73%)\",\"education\",\"hsl(213, 27%, 100%)\",\"medical\",\"hsl(204, 7%, 100%)\",\"hsl(184, 7%, 81%)\"]]]},\"source-layer\":\"poi_label\"},{\"minzoom\":12,\"layout\":{\"text-size\":12,\"icon-image\":[\"get\",\"network\"],\"text-font\":[\"DIN Pro Medium\",\"Arial Unicode MS Regular\"],\"text-justify\":[\"match\",[\"get\",\"stop_type\"],\"entrance\",\"left\",\"center\"],\"text-offset\":[\"match\",[\"get\",\"stop_type\"],\"entrance\",[\"literal\",[1,0]],[\"literal\",[0,0.8]]],\"text-anchor\":[\"match\",[\"get\",\"stop_type\"],\"entrance\",\"left\",\"top\"],\"text-field\":[\"step\",[\"zoom\"],\"\",14,[\"match\",[\"get\",\"mode\"],[\"rail\",\"metro_rail\"],[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"\"],16,[\"match\",[\"get\",\"mode\"],[\"bus\",\"bicycle\"],\"\",[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]]],18,[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]]],\"text-letter-spacing\":0.01,\"text-max-width\":[\"match\",[\"get\",\"stop_type\"],\"entrance\",15,9]},\"metadata\":{\"mapbox:featureComponent\":\"transit\",\"mapbox:group\":\"Transit, transit-labels\"},\"filter\":[\"step\",[\"zoom\"],[\"all\",[\"match\",[\"get\",\"mode\"],\"rail\",true,\"metro_rail\",true,false],[\"!=\",[\"get\",\"stop_type\"],\"entrance\"]],15,[\"all\",[\"match\",[\"get\",\"mode\"],\"rail\",true,\"metro_rail\",true,\"light_rail\",true,false],[\"!=\",[\"get\",\"stop_type\"],\"entrance\"]],16,[\"all\",[\"match\",[\"get\",\"mode\"],\"ferry\",false,\"bus\",false,true],[\"!=\",[\"get\",\"stop_type\"],\"entrance\"]],17,[\"all\",[\"match\",[\"get\",\"mode\"],\"ferry\",false,true],[\"!=\",[\"get\",\"stop_type\"],\"entrance\"]],19,[\"match\",[\"get\",\"mode\"],\"ferry\",false,true]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"transit-label\",\"paint\":{\"text-halo-color\":\"hsl(216, 43%, 0%)\",\"text-color\":[\"match\",[\"get\",\"network\"],\"tokyo-metro\",\"hsl(180, 34%, 30%)\",\"mexico-city-metro\",\"hsl(25, 70%, 63%)\",[\"barcelona-metro\",\"delhi-metro\",\"hong-kong-mtr\",\"milan-metro\",\"osaka-subway\"],\"hsl(0, 64%, 47%)\",[\"boston-t\",\"washington-metro\"],\"hsl(230, 13%, 20%)\",[\"chongqing-rail-transit\",\"kiev-metro\",\"singapore-mrt\",\"taipei-metro\"],\"hsl(140, 63%, 25%)\",\"hsl(219, 9%, 80%)\"],\"text-halo-blur\":0.5,\"text-halo-width\":0.5},\"source-layer\":\"transit_stop_label\"},{\"id\":\"airport-label\",\"type\":\"symbol\",\"source\":\"composite\",\"source-layer\":\"airport_label\",\"minzoom\":8,\"layout\":{\"text-line-height\":1.1,\"text-size\":[\"step\",[\"get\",\"sizerank\"],18,9,12],\"icon-image\":[\"step\",[\"get\",\"sizerank\"],[\"concat\",[\"get\",\"maki\"],\"-15\"],9,[\"concat\",[\"get\",\"maki\"],\"-11\"]],\"text-font\":[\"DIN Pro Medium\",\"Arial Unicode MS Regular\"],\"text-offset\":[0,0.75],\"text-rotation-alignment\":\"viewport\",\"text-anchor\":\"top\",\"text-field\":[\"step\",[\"get\",\"sizerank\"],[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],15,[\"get\",\"ref\"]],\"text-letter-spacing\":0.01,\"text-max-width\":9},\"paint\":{\"text-color\":\"hsl(213, 9%, 100%)\",\"text-halo-color\":\"hsl(213, 58%, 5%)\",\"text-halo-width\":1},\"metadata\":{\"mapbox:featureComponent\":\"transit\",\"mapbox:group\":\"Transit, transit-labels\"}},{\"minzoom\":10,\"layout\":{\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"text-transform\":\"uppercase\",\"text-font\":[\"DIN Pro Regular\",\"Arial Unicode MS Regular\"],\"text-letter-spacing\":[\"match\",[\"get\",\"type\"],\"suburb\",0.15,0.1],\"text-max-width\":7,\"text-padding\":3,\"text-size\":[\"interpolate\",[\"cubic-bezier\",0.5,0,1,1],[\"zoom\"],11,[\"match\",[\"get\",\"type\"],\"suburb\",11,10.5],15,[\"match\",[\"get\",\"type\"],\"suburb\",17,16]]},\"metadata\":{\"mapbox:featureComponent\":\"place-labels\",\"mapbox:group\":\"Place labels, place-labels\"},\"maxzoom\":15,\"filter\":[\"all\",[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"settlement_subdivision\",\"disputed_settlement_subdivision\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"==\",[\"get\",\"class\"],\"settlement_subdivision\"]],[\"<=\",[\"get\",\"filterrank\"],3]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"settlement-subdivision-label\",\"paint\":{\"text-halo-color\":\"hsla(216, 43%, 0%, 0.75)\",\"text-halo-width\":1,\"text-color\":\"hsl(212, 8%, 94%)\",\"text-halo-blur\":0.5},\"source-layer\":\"place_label\"},{\"layout\":{\"icon-image\":\"\",\"text-font\":[\"DIN Pro Regular\",\"Arial Unicode MS Regular\"],\"text-offset\":[\"step\",[\"zoom\"],[\"literal\",[0,0]],8,[\"literal\",[0,0]]],\"text-anchor\":[\"step\",[\"zoom\"],\"center\",8,\"center\"],\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"text-max-width\":7,\"text-line-height\":1.1,\"text-size\":[\"interpolate\",[\"cubic-bezier\",0.2,0,0.9,1],[\"zoom\"],3,[\"step\",[\"get\",\"symbolrank\"],12,9,11,10,10.5,12,9.5,14,8.5,16,6.5,17,4],13,[\"step\",[\"get\",\"symbolrank\"],25,9,23,10,21,11,19,12,18,13,17,15,15]]},\"metadata\":{\"mapbox:featureComponent\":\"place-labels\",\"mapbox:group\":\"Place labels, place-labels\"},\"maxzoom\":15,\"filter\":[\"all\",[\"<=\",[\"get\",\"filterrank\"],3],[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"settlement\",\"disputed_settlement\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"==\",[\"get\",\"class\"],\"settlement\"]],[\"step\",[\"zoom\"],true,8,[\">=\",[\"get\",\"symbolrank\"],11],10,[\">=\",[\"get\",\"symbolrank\"],12],11,[\">=\",[\"get\",\"symbolrank\"],13],12,[\">=\",[\"get\",\"symbolrank\"],15],13,[\">=\",[\"get\",\"symbolrank\"],11],14,[\">=\",[\"get\",\"symbolrank\"],13]]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"settlement-minor-label\",\"paint\":{\"text-color\":\"hsl(212, 8%, 84%)\",\"text-halo-color\":\"hsl(216, 43%, 0%)\",\"text-halo-width\":1,\"icon-opacity\":[\"step\",[\"zoom\"],1,8,0],\"text-halo-blur\":1},\"source-layer\":\"place_label\"},{\"layout\":{\"icon-image\":\"\",\"text-font\":[\"DIN Pro Medium\",\"Arial Unicode MS Regular\"],\"text-offset\":[\"step\",[\"zoom\"],[\"literal\",[0,0]],8,[\"literal\",[0,0]]],\"text-anchor\":[\"step\",[\"zoom\"],\"center\",8,\"center\"],\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"text-max-width\":7,\"text-line-height\":1.1,\"text-size\":[\"interpolate\",[\"cubic-bezier\",0.2,0,0.9,1],[\"zoom\"],8,[\"step\",[\"get\",\"symbolrank\"],18,9,17,10,15],15,[\"step\",[\"get\",\"symbolrank\"],28,9,26,10,23,11,21,12,20,13,19,15,16]]},\"metadata\":{\"mapbox:featureComponent\":\"place-labels\",\"mapbox:group\":\"Place labels, place-labels\"},\"maxzoom\":15,\"filter\":[\"all\",[\"<=\",[\"get\",\"filterrank\"],3],[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"settlement\",\"disputed_settlement\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"==\",[\"get\",\"class\"],\"settlement\"]],[\"step\",[\"zoom\"],false,8,[\"<\",[\"get\",\"symbolrank\"],11],10,[\"<\",[\"get\",\"symbolrank\"],12],11,[\"<\",[\"get\",\"symbolrank\"],13],12,[\"<\",[\"get\",\"symbolrank\"],15],13,[\">=\",[\"get\",\"symbolrank\"],11],14,[\">=\",[\"get\",\"symbolrank\"],13]]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"settlement-major-label\",\"paint\":{\"text-color\":\"hsl(212, 8%, 84%)\",\"text-halo-color\":\"hsl(216, 43%, 0%)\",\"text-halo-width\":1,\"icon-opacity\":[\"step\",[\"zoom\"],1,8,0],\"text-halo-blur\":1},\"source-layer\":\"place_label\"},{\"minzoom\":3,\"layout\":{\"text-size\":[\"interpolate\",[\"cubic-bezier\",0.85,0.7,0.65,1],[\"zoom\"],4,[\"step\",[\"get\",\"symbolrank\"],10,6,9.5,7,9],9,[\"step\",[\"get\",\"symbolrank\"],24,6,18,7,14]],\"text-transform\":\"uppercase\",\"text-font\":[\"DIN Pro Bold\",\"Arial Unicode MS Bold\"],\"text-field\":[\"step\",[\"zoom\"],[\"step\",[\"get\",\"symbolrank\"],[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],5,[\"coalesce\",[\"get\",\"abbr\"],[\"get\",\"name_en\"],[\"get\",\"name\"]]],5,[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]]],\"text-letter-spacing\":0.15,\"text-max-width\":6},\"metadata\":{\"mapbox:featureComponent\":\"place-labels\",\"mapbox:group\":\"Place labels, place-labels\"},\"maxzoom\":9,\"filter\":[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"state\",\"disputed_state\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"==\",[\"get\",\"class\"],\"state\"]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"state-label\",\"paint\":{\"text-color\":\"hsl(212, 8%, 84%)\",\"text-halo-color\":\"hsl(216, 43%, 0%)\",\"text-halo-width\":1},\"source-layer\":\"place_label\"},{\"minzoom\":1,\"layout\":{\"icon-image\":\"\",\"text-field\":[\"coalesce\",[\"get\",\"name_en\"],[\"get\",\"name\"]],\"text-line-height\":1.1,\"text-max-width\":6,\"text-font\":[\"DIN Pro Medium\",\"Arial Unicode MS Regular\"],\"text-offset\":[\"literal\",[0,0]],\"text-size\":[\"interpolate\",[\"cubic-bezier\",0.2,0,0.7,1],[\"zoom\"],1,[\"step\",[\"get\",\"symbolrank\"],11,4,9,5,8],9,[\"step\",[\"get\",\"symbolrank\"],28,4,22,5,21]]},\"metadata\":{\"mapbox:featureComponent\":\"place-labels\",\"mapbox:group\":\"Place labels, place-labels\"},\"maxzoom\":10,\"filter\":[\"case\",[\"==\",[\"get\",\"disputed\"],\"true\"],[\"all\",[\"match\",[\"get\",\"class\"],[\"country\",\"disputed_country\"],true,false],[\"match\",[\"get\",\"worldview\"],[\"all\",\"US\"],true,false]],[\"==\",[\"get\",\"class\"],\"country\"]],\"type\":\"symbol\",\"source\":\"composite\",\"id\":\"country-label\",\"paint\":{\"icon-opacity\":[\"step\",[\"zoom\"],[\"case\",[\"has\",\"text_anchor\"],1,0],7,0],\"text-color\":\"hsl(212, 8%, 84%)\",\"text-halo-color\":[\"interpolate\",[\"linear\"],[\"zoom\"],2,\"hsla(216, 43%, 0%, 0.75)\",3,\"hsl(216, 43%, 0%)\"],\"text-halo-width\":1.25},\"source-layer\":\"place_label\"}],\"created\":\"2020-06-18T14:37:20.087Z\",\"id\":\"ckbkw1qa114hp1iploj57us76\",\"modified\":\"2020-06-18T14:44:02.639Z\",\"owner\":\"laxatives\",\"visibility\":\"public\",\"draft\":false}\n", + "\"\"\"\n", + "base_style = json.loads(style_json)\n", + "base_style" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "ExecuteTime": { + "end_time": "2020-07-07T22:56:33.585699Z", + "start_time": "2020-07-07T22:56:33.579532Z" + } + }, + "outputs": [], + "source": [ + "import branca\n", + "import folium\n", + "import folium.plugins\n", + "\n", + "\n", + "def plot_state_values(path='init_values_181486.csv', colorscale_max=None):\n", + " values = dict()\n", + " with open(path, 'r') as csvfile:\n", + " for row in csv.reader(csvfile):\n", + " grid_id, value = row\n", + " values[grid_id] = float(value)\n", + "\n", + " if not colorscale_max:\n", + " colorscale_max = max(values.values())\n", + " colorscale = branca.colormap.linear.YlOrRd_09.scale(0, colorscale_max)\n", + " def style_function(grid_id):\n", + " style = dict(base_style)\n", + " style['fill'] = True\n", + " style['color'] = colorscale(values[grid_id])\n", + " return style\n", + " m = folium.Map(location=[30.5, 104])\n", + " for grid_id, value in values.items(): \n", + " print(polygon[grid_id])\n", + " break\n", + " folium.vector_layers.Polygon(polygon[grid_id], **style_function(grid_id)).add_to(m)\n", + "\n", + " #folium.plugins.HeatMap(heatmap, radius=10, blur=2).add_to(m)\n", + " display(pd.Series(list(values.values())).describe())\n", + " display(m)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "ExecuteTime": { + "end_time": "2020-07-07T22:56:34.175422Z", + "start_time": "2020-07-07T22:56:34.127680Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[(30.70177, 104.0996), (30.70593, 104.1037), (30.71158, 104.10166), (30.71307, 104.09552), (30.7089, 104.09143), (30.70325, 104.09347)]\n" + ] + }, + { + "ename": "NameError", + "evalue": "name 'pd' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mplot_state_values\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m\u001b[0m in \u001b[0;36mplot_state_values\u001b[0;34m(path, colorscale_max)\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 27\u001b[0m \u001b[0;31m#folium.plugins.HeatMap(heatmap, radius=10, blur=2).add_to(m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 28\u001b[0;31m \u001b[0mdisplay\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSeries\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalues\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdescribe\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 29\u001b[0m \u001b[0mdisplay\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mm\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mNameError\u001b[0m: name 'pd' is not defined" + ] + } + ], + "source": [ + "plot_state_values()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-13T18:25:23.313236Z", + "start_time": "2020-06-13T18:25:21.355460Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "count 3393.000000\n", + "mean 28.289569\n", + "std 21.482355\n", + "min 0.000000\n", + "25% 0.000000\n", + "50% 36.846280\n", + "75% 47.392051\n", + "max 79.155541\n", + "dtype: float64" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plot_state_values('model/init_values.csv')" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "ExecuteTime": { + "end_time": "2020-06-18T13:46:18.697766Z", + "start_time": "2020-06-18T13:46:18.693355Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(0.012339999999994689, 0.011350000000000193)" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "lngs = [104.46545,104.46959,104.46756,104.46139,104.45725,104.45927]\n", + "lats = [30.87166,30.87584,30.88151,30.88301,30.87883,30.87316]\n", + "\n", + "max(lngs) - min(lngs), max(lats) - min(lats)" + ] } ], "metadata": {