Skip to content

Instantly share code, notes, and snippets.

@deton
Last active June 1, 2025 07:07
Show Gist options
  • Save deton/8c4bd41faa4060dfa4a68066a5403be3 to your computer and use it in GitHub Desktop.
Save deton/8c4bd41faa4060dfa4a68066a5403be3 to your computer and use it in GitHub Desktop.
Display GTFS stop_times.txt using gtfs_kit and kepler.gl Trip Layer, pydeck TripsLayer, or folium TimestampedGeoJson
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Display GTFS stop_times.txt using folium TimestampedGeoJson\n",
"https://colab.research.google.com/drive/16eMpKeD2IJ45hAwNRm52G25BFNOI4LUz?usp=sharing"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install gtfs_kit"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>indicator</th>\n",
" <th>value</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>agencies</td>\n",
" <td>[ハマちゃんバス]</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>timezone</td>\n",
" <td>Asia/Tokyo</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>start_date</td>\n",
" <td>20230601</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>end_date</td>\n",
" <td>20260331</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>num_routes</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>num_trips</td>\n",
" <td>12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>num_stops</td>\n",
" <td>31</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>num_shapes</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>sample_date</td>\n",
" <td>20230608</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>num_routes_active_on_sample_date</td>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>num_trips_active_on_sample_date</td>\n",
" <td>12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>num_stops_active_on_sample_date</td>\n",
" <td>20</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" indicator value\n",
"0 agencies [ハマちゃんバス]\n",
"1 timezone Asia/Tokyo\n",
"2 start_date 20230601\n",
"3 end_date 20260331\n",
"4 num_routes 3\n",
"5 num_trips 12\n",
"6 num_stops 31\n",
"7 num_shapes 3\n",
"8 sample_date 20230608\n",
"9 num_routes_active_on_sample_date 3\n",
"10 num_trips_active_on_sample_date 12\n",
"11 num_stops_active_on_sample_date 20"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import gtfs_kit as gk\n",
"\n",
"# https://bustime.jp/GtfsAgency/gtfs_list?p1=14\n",
"url = 'https://api.gtfs-data.jp/v2/organizations/yokosukacity/feeds/hamachanbus/files/feed.zip'\n",
"feed = gk.read_feed(url, dist_units='m')\n",
"feed.describe()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"week = feed.get_first_week()\n",
"date = week[0] # Monday"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>stop_id</th>\n",
" <th>stop_name</th>\n",
" <th>platform_code</th>\n",
" <th>stop_lat</th>\n",
" <th>stop_lon</th>\n",
" <th>zone_id</th>\n",
" <th>location_type</th>\n",
" <th>parent_station</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>S1_1</td>\n",
" <td>追浜東団地集会所</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.309189</td>\n",
" <td>139.629466</td>\n",
" <td>S1_1</td>\n",
" <td>0</td>\n",
" <td>S1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>S1_2</td>\n",
" <td>追浜東団地集会所</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.309189</td>\n",
" <td>139.629466</td>\n",
" <td>S1_2</td>\n",
" <td>0</td>\n",
" <td>S1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>S2_1</td>\n",
" <td>パークハウス</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.310473</td>\n",
" <td>139.628737</td>\n",
" <td>S2_1</td>\n",
" <td>0</td>\n",
" <td>S2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>S2_2</td>\n",
" <td>パークハウス</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.310473</td>\n",
" <td>139.628737</td>\n",
" <td>S2_2</td>\n",
" <td>0</td>\n",
" <td>S2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>S3_1</td>\n",
" <td>浜見台1丁目</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.309822</td>\n",
" <td>139.626619</td>\n",
" <td>S3_1</td>\n",
" <td>0</td>\n",
" <td>S3</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" stop_id stop_name platform_code stop_lat stop_lon zone_id \\\n",
"1 S1_1 追浜東団地集会所 <NA> 35.309189 139.629466 S1_1 \n",
"2 S1_2 追浜東団地集会所 <NA> 35.309189 139.629466 S1_2 \n",
"4 S2_1 パークハウス <NA> 35.310473 139.628737 S2_1 \n",
"5 S2_2 パークハウス <NA> 35.310473 139.628737 S2_2 \n",
"7 S3_1 浜見台1丁目 <NA> 35.309822 139.626619 S3_1 \n",
"\n",
" location_type parent_station \n",
"1 0 S1 \n",
"2 0 S1 \n",
"4 0 S2 \n",
"5 0 S2 \n",
"7 0 S3 "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dfstops = feed.get_stops(date)\n",
"dfstops.head()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"features = []\n",
"for st in dfstops.to_dict(orient='records'):\n",
" features.append({\n",
" 'type': 'Feature',\n",
" 'properties': {\n",
" 'name': f\"{st['stop_id']} {st['stop_name']}\",\n",
" 'icon': 'circle',\n",
" 'iconstyle': {\n",
" 'color': '#ff00ff',\n",
" 'radius': 4,\n",
" }\n",
" },\n",
" 'geometry': {\n",
" 'type': 'Point',\n",
" 'coordinates': [st['stop_lon'], st['stop_lat']],\n",
" }\n",
" })"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>trip_id</th>\n",
" <th>arrival_time</th>\n",
" <th>departure_time</th>\n",
" <th>stop_id</th>\n",
" <th>stop_sequence</th>\n",
" <th>stop_headsign</th>\n",
" <th>pickup_type</th>\n",
" <th>drop_off_type</th>\n",
" <th>stop_name</th>\n",
" <th>platform_code</th>\n",
" <th>stop_lat</th>\n",
" <th>stop_lon</th>\n",
" <th>zone_id</th>\n",
" <th>location_type</th>\n",
" <th>parent_station</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>R3+0+平日+1</td>\n",
" <td>10:29:00</td>\n",
" <td>10:29:00</td>\n",
" <td>S1_1</td>\n",
" <td>1</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>追浜東団地集会所</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.309189</td>\n",
" <td>139.629466</td>\n",
" <td>S1_1</td>\n",
" <td>0</td>\n",
" <td>S1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>R3+0+平日+1</td>\n",
" <td>10:32:00</td>\n",
" <td>10:32:00</td>\n",
" <td>S3_1</td>\n",
" <td>2</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>浜見台1丁目</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.309822</td>\n",
" <td>139.626619</td>\n",
" <td>S3_1</td>\n",
" <td>0</td>\n",
" <td>S3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>R3+0+平日+1</td>\n",
" <td>10:34:00</td>\n",
" <td>10:34:00</td>\n",
" <td>S4_1</td>\n",
" <td>3</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>浜見台2丁目A</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.306984</td>\n",
" <td>139.628112</td>\n",
" <td>S4_1</td>\n",
" <td>0</td>\n",
" <td>S4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>R3+0+平日+1</td>\n",
" <td>10:35:00</td>\n",
" <td>10:35:00</td>\n",
" <td>S5_1</td>\n",
" <td>4</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>浜見台2丁目B</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.306837</td>\n",
" <td>139.629605</td>\n",
" <td>S5_1</td>\n",
" <td>0</td>\n",
" <td>S5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>R3+0+平日+1</td>\n",
" <td>10:36:00</td>\n",
" <td>10:36:00</td>\n",
" <td>S6_1</td>\n",
" <td>5</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>ケアセンター</td>\n",
" <td>&lt;NA&gt;</td>\n",
" <td>35.308191</td>\n",
" <td>139.630542</td>\n",
" <td>S6_1</td>\n",
" <td>0</td>\n",
" <td>S6</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" trip_id arrival_time departure_time stop_id stop_sequence stop_headsign \\\n",
"0 R3+0+平日+1 10:29:00 10:29:00 S1_1 1 <NA> \n",
"1 R3+0+平日+1 10:32:00 10:32:00 S3_1 2 <NA> \n",
"2 R3+0+平日+1 10:34:00 10:34:00 S4_1 3 <NA> \n",
"3 R3+0+平日+1 10:35:00 10:35:00 S5_1 4 <NA> \n",
"4 R3+0+平日+1 10:36:00 10:36:00 S6_1 5 <NA> \n",
"\n",
" pickup_type drop_off_type stop_name platform_code stop_lat stop_lon \\\n",
"0 0 1 追浜東団地集会所 <NA> 35.309189 139.629466 \n",
"1 0 0 浜見台1丁目 <NA> 35.309822 139.626619 \n",
"2 0 0 浜見台2丁目A <NA> 35.306984 139.628112 \n",
"3 0 0 浜見台2丁目B <NA> 35.306837 139.629605 \n",
"4 0 0 ケアセンター <NA> 35.308191 139.630542 \n",
"\n",
" zone_id location_type parent_station \n",
"0 S1_1 0 S1 \n",
"1 S3_1 0 S3 \n",
"2 S4_1 0 S4 \n",
"3 S5_1 0 S5 \n",
"4 S6_1 0 S6 "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dfst = feed.get_stop_times(date)\n",
"dfst = dfst.merge(dfstops)\n",
"display(dfst.head())\n",
"tripsdict = dfst.groupby('trip_id').apply(lambda x: x.to_dict(orient='records'), include_groups=False).to_dict()\n",
"#tripsdict"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"import datetime\n",
"datesec = int(datetime.datetime.fromisoformat(date).timestamp())\n",
"for trip_id, stop_times_list in tripsdict.items():\n",
" coords = []\n",
" times = []\n",
" stop_times_list.sort(key=lambda x: x['arrival_time'])\n",
" for st in stop_times_list:\n",
" timesec = datesec + gk.helpers.timestr_to_seconds(st['arrival_time'])\n",
" coords.append([st['stop_lon'], st['stop_lat']])\n",
" times.append(timesec * 1000)\n",
" if st.get('departure_time') and st['departure_time'] != st['arrival_time']:\n",
" timesec = datesec + gk.helpers.timestr_to_seconds(st['departure_time'])\n",
" coords.append([st['stop_lon'], st['stop_lat']])\n",
" times.append(timesec * 1000)\n",
" features.append({\n",
" 'type': 'Feature',\n",
" 'properties': {\n",
" 'name': trip_id,\n",
" 'times': times,\n",
" \"icon\": \"marker\",\n",
" \"iconstyle\": {\n",
" \"iconUrl\": 'https://deton.github.io/folium_tripslayer/bus.svg',\n",
" \"iconSize\": [24, 24],\n",
" \"iconAnchor\": [12, 12]\n",
" },\n",
" \"style\": {\n",
" \"color\": \"#ff00ff\",\n",
" },\n",
" 'tooltip': trip_id,\n",
" 'popup': trip_id,\n",
" },\n",
" 'geometry': {\n",
" 'type': 'LineString',\n",
" 'coordinates': coords,\n",
" }\n",
" })\n",
"geojson = {\n",
" 'type': 'FeatureCollection',\n",
" 'features': features,\n",
"}\n",
"#geojson"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"with open('gtfsStopsTimestamped.geojson', 'w', encoding='utf-8') as f:\n",
" json.dump(geojson, f, ensure_ascii=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install git+https://github.com/deton/folium_tripslayer.git"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><span style=\"color:#565656\">Make this Notebook Trusted to load map: File -> Trust Notebook</span><iframe srcdoc=\"&lt;!DOCTYPE html&gt;\n",
"&lt;html&gt;\n",
"&lt;head&gt;\n",
" \n",
" &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;\n",
" \n",
" &lt;script&gt;\n",
" L_NO_TOUCH = false;\n",
" L_DISABLE_3D = false;\n",
" &lt;/script&gt;\n",
" \n",
" &lt;style&gt;html, body {width: 100%;height: 100%;margin: 0;padding: 0;}&lt;/style&gt;\n",
" &lt;style&gt;#map {position:absolute;top:0;bottom:0;right:0;left:0;}&lt;/style&gt;\n",
" &lt;script src=&quot;https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js&quot;&gt;&lt;/script&gt;\n",
" &lt;script src=&quot;https://code.jquery.com/jquery-3.7.1.min.js&quot;&gt;&lt;/script&gt;\n",
" &lt;script src=&quot;https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;\n",
" &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js&quot;&gt;&lt;/script&gt;\n",
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css&quot;/&gt;\n",
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css&quot;/&gt;\n",
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css&quot;/&gt;\n",
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css&quot;/&gt;\n",
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css&quot;/&gt;\n",
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css&quot;/&gt;\n",
" \n",
" &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,\n",
" initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;\n",
" &lt;style&gt;\n",
" #map_249907cf333f26e7f55cb8611e5fa199 {\n",
" position: relative;\n",
" width: 100.0%;\n",
" height: 100.0%;\n",
" left: 0.0%;\n",
" top: 0.0%;\n",
" }\n",
" .leaflet-container { font-size: 1rem; }\n",
" &lt;/style&gt;\n",
" \n",
" &lt;script src=&quot;https://cdn.jsdelivr.net/npm/[email protected]/iso8601.min.js&quot;&gt;&lt;/script&gt;\n",
" &lt;script src=&quot;https://deton.github.io/Leaflet.TimeDimension/dist/leaflet.timedimension.min.js&quot;&gt;&lt;/script&gt;\n",
" &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js&quot;&gt;&lt;/script&gt;\n",
" &lt;script src=&quot;https://deton.github.io/folium_tripslayer/leaflet.timedimension.layer.geojsonwhole.js&quot;&gt;&lt;/script&gt;\n",
" &lt;script src=&quot;https://deton.github.io/folium_tripslayer/leaflet.timedimension.layer.trips.js&quot;&gt;&lt;/script&gt;\n",
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css&quot;/&gt;\n",
" &lt;link rel=&quot;stylesheet&quot; href=&quot;https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.timedimension.control.css&quot;/&gt;\n",
"&lt;/head&gt;\n",
"&lt;body&gt;\n",
" \n",
" \n",
" &lt;div class=&quot;folium-map&quot; id=&quot;map_249907cf333f26e7f55cb8611e5fa199&quot; &gt;&lt;/div&gt;\n",
" \n",
"&lt;/body&gt;\n",
"&lt;script&gt;\n",
" \n",
" \n",
" var map_249907cf333f26e7f55cb8611e5fa199 = L.map(\n",
" &quot;map_249907cf333f26e7f55cb8611e5fa199&quot;,\n",
" {\n",
" center: [35.3091888465196, 139.629465989449],\n",
" crs: L.CRS.EPSG3857,\n",
" ...{\n",
" &quot;zoom&quot;: 15,\n",
" &quot;zoomControl&quot;: true,\n",
" &quot;preferCanvas&quot;: false,\n",
"}\n",
"\n",
" }\n",
" );\n",
"\n",
" \n",
"\n",
" \n",
" \n",
" var tile_layer_be2bce1bfccdef0f95098478c5877c4a = L.tileLayer(\n",
" &quot;https://tile.openstreetmap.org/{z}/{x}/{y}.png&quot;,\n",
" {\n",
" &quot;minZoom&quot;: 0,\n",
" &quot;maxZoom&quot;: 19,\n",
" &quot;maxNativeZoom&quot;: 19,\n",
" &quot;noWrap&quot;: false,\n",
" &quot;attribution&quot;: &quot;\\u0026copy; \\u003ca href=\\&quot;https://www.openstreetmap.org/copyright\\&quot;\\u003eOpenStreetMap\\u003c/a\\u003e contributors&quot;,\n",
" &quot;subdomains&quot;: &quot;abc&quot;,\n",
" &quot;detectRetina&quot;: false,\n",
" &quot;tms&quot;: false,\n",
" &quot;opacity&quot;: 1,\n",
"}\n",
"\n",
" );\n",
" \n",
" \n",
" tile_layer_be2bce1bfccdef0f95098478c5877c4a.addTo(map_249907cf333f26e7f55cb8611e5fa199);\n",
" \n",
" \n",
" L.Control.TimeDimensionCustom = L.Control.TimeDimension.extend({\n",
" _getDisplayDateFormat: function(date){\n",
" var newdate = new moment(date);\n",
" //console.log(newdate)\n",
" return newdate.format(&quot;YYYY-MM-DD HH:mm:ss&quot;);\n",
" }\n",
" });\n",
" map_249907cf333f26e7f55cb8611e5fa199.timeDimension = L.timeDimension(\n",
" {\n",
" period: &quot;PT1M&quot;,\n",
" }\n",
" );\n",
" var timeDimensionControl = new L.Control.TimeDimensionCustom(\n",
" {&quot;auto_play&quot;: true, &quot;loop_button&quot;: false, &quot;max_speed&quot;: 10, &quot;min_speed&quot;: 0.1, &quot;player_options&quot;: {&quot;loop&quot;: false, &quot;startOver&quot;: true, &quot;transitionTime&quot;: 400}, &quot;position&quot;: &quot;bottomleft&quot;, &quot;speed_slider&quot;: true, &quot;time_slider_drag_update&quot;: false}\n",
" );\n",
" map_249907cf333f26e7f55cb8611e5fa199.addControl(this.timeDimensionControl);\n",
"\n",
" var tripsLayer = L.timeDimension.layer.trips();\n",
" tripsLayer.addTripsLayers(\n",
" map_249907cf333f26e7f55cb8611e5fa199,\n",
" {&quot;type&quot;: &quot;FeatureCollection&quot;, &quot;features&quot;: [{&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S1_1 \\u8ffd\\u6d5c\\u6771\\u56e3\\u5730\\u96c6\\u4f1a\\u6240&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.629465989449, 35.3091888465196]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S1_2 \\u8ffd\\u6d5c\\u6771\\u56e3\\u5730\\u96c6\\u4f1a\\u6240&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.629465989449, 35.3091888465196]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S2_1 \\u30d1\\u30fc\\u30af\\u30cf\\u30a6\\u30b9&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.628736833672, 35.3104734056088]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S2_2 \\u30d1\\u30fc\\u30af\\u30cf\\u30a6\\u30b9&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.628736833672, 35.3104734056088]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S3_1 \\u6d5c\\u898b\\u53f0\\uff11\\u4e01\\u76ee&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.626618982737, 35.3098223806385]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S3_2 \\u6d5c\\u898b\\u53f0\\uff11\\u4e01\\u76ee&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.626618982737, 35.3098223806385]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S4_1 \\u6d5c\\u898b\\u53f0\\uff12\\u4e01\\u76ee\\uff21&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.628112024185, 35.306984196272]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S4_2 \\u6d5c\\u898b\\u53f0\\uff12\\u4e01\\u76ee\\uff21&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.628112024185, 35.306984196272]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S5_1 \\u6d5c\\u898b\\u53f0\\uff12\\u4e01\\u76ee\\uff22&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.629604959444, 35.3068366829395]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S5_2 \\u6d5c\\u898b\\u53f0\\uff12\\u4e01\\u76ee\\uff22&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.629604959444, 35.3068366829395]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S6_1 \\u30b1\\u30a2\\u30bb\\u30f3\\u30bf\\u30fc&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.630542326811, 35.3081907229082]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S6_2 \\u30b1\\u30a2\\u30bb\\u30f3\\u30bf\\u30fc&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.630542326811, 35.3081907229082]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S7_1 \\u8ffd\\u6d5c\\u6771\\u753a\\uff11\\u4e01\\u76ee&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.63248650319, 35.3108206884306]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S7_2 \\u8ffd\\u6d5c\\u6771\\u753a\\uff11\\u4e01\\u76ee&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.63248650319, 35.3108206884306]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S8_1 \\u30eb\\u30cd\\u8ffd\\u6d5c&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.633111386316, 35.3124437872117]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S8_2 \\u30eb\\u30cd\\u8ffd\\u6d5c&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.633111386316, 35.3124437872117]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S9_1 \\u8ffd\\u6d5c\\u99c5\\uff08\\u964d\\u8eca\\uff09&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.62708642052743, 35.31633967944443]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S9_2 \\u8ffd\\u6d5c\\u99c5\\uff08\\u4e57\\u8eca\\uff09&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.62641987091095, 35.316293190801034]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S10_1 \\u6a2a\\u6d5c\\u5357\\u5171\\u6e08\\u75c5\\u9662&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.62203561756, 35.3204373901619]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;S11_1 \\u8ffd\\u6d5c\\u9280\\u5ea7\\u901a\\u308a\\u5546\\u5e97\\u4f1a&quot;, &quot;icon&quot;: &quot;circle&quot;, &quot;iconstyle&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;, &quot;radius&quot;: 4}}, &quot;geometry&quot;: {&quot;type&quot;: &quot;Point&quot;, &quot;coordinates&quot;: [139.628424113353, 35.3167226977435]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R1+0+\\u5e73\\u65e5+1&quot;, &quot;times&quot;: [1685920980000, 1685921040000, 1685921220000, 1685921340000, 1685921400000, 1685921460000, 1685921520000, 1685921700000, 1685922000000, 1685922360000, 1685922720000, 1685922780000, 1685922960000, 1685923080000, 1685923140000, 1685923200000, 1685923260000, 1685923380000, 1685923560000, 1685923620000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R1+0+\\u5e73\\u65e5+1&quot;, &quot;popup&quot;: &quot;R1+0+\\u5e73\\u65e5+1&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.628736833672, 35.3104734056088], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.633111386316, 35.3124437872117], [139.62708642052743, 35.31633967944443], [139.62203561756, 35.3204373901619], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R1+0+\\u5e73\\u65e5+2&quot;, &quot;times&quot;: [1685923680000, 1685923740000, 1685923920000, 1685924040000, 1685924100000, 1685924160000, 1685924220000, 1685924400000, 1685924700000, 1685925120000, 1685925540000, 1685925600000, 1685925780000, 1685925900000, 1685925960000, 1685926020000, 1685926080000, 1685926200000, 1685926380000, 1685926440000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R1+0+\\u5e73\\u65e5+2&quot;, &quot;popup&quot;: &quot;R1+0+\\u5e73\\u65e5+2&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.628736833672, 35.3104734056088], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.633111386316, 35.3124437872117], [139.62708642052743, 35.31633967944443], [139.62203561756, 35.3204373901619], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R2+0+\\u5e73\\u65e5+1&quot;, &quot;times&quot;: [1685926860000, 1685926920000, 1685926980000, 1685927040000, 1685927220000, 1685927520000, 1685927580000, 1685927640000, 1685927820000, 1685927940000, 1685928000000, 1685928060000, 1685928120000, 1685928240000, 1685928420000, 1685928480000, 1685926500000, 1685926560000, 1685926740000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R2+0+\\u5e73\\u65e5+1&quot;, &quot;popup&quot;: &quot;R2+0+\\u5e73\\u65e5+1&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.633111386316, 35.3124437872117], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196], [139.629465989449, 35.3091888465196], [139.628736833672, 35.3104734056088], [139.626618982737, 35.3098223806385]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R2+0+\\u5e73\\u65e5+2&quot;, &quot;times&quot;: [1685930580000, 1685930640000, 1685930820000, 1685930940000, 1685931000000, 1685931060000, 1685931120000, 1685931300000, 1685931600000, 1685931660000, 1685931720000, 1685931900000, 1685932020000, 1685932080000, 1685932140000, 1685932200000, 1685932320000, 1685932500000, 1685932560000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R2+0+\\u5e73\\u65e5+2&quot;, &quot;popup&quot;: &quot;R2+0+\\u5e73\\u65e5+2&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.628736833672, 35.3104734056088], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.633111386316, 35.3124437872117], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R2+0+\\u5e73\\u65e5+3&quot;, &quot;times&quot;: [1685937960000, 1685938020000, 1685938200000, 1685938320000, 1685938380000, 1685938440000, 1685938500000, 1685938680000, 1685938980000, 1685939040000, 1685939100000, 1685939280000, 1685939400000, 1685939460000, 1685939520000, 1685939580000, 1685939640000, 1685939820000, 1685939880000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R2+0+\\u5e73\\u65e5+3&quot;, &quot;popup&quot;: &quot;R2+0+\\u5e73\\u65e5+3&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.628736833672, 35.3104734056088], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.633111386316, 35.3124437872117], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R2+0+\\u5e73\\u65e5+4&quot;, &quot;times&quot;: [1685939940000, 1685940000000, 1685940180000, 1685940300000, 1685940360000, 1685940420000, 1685940480000, 1685940660000, 1685940960000, 1685941020000, 1685941080000, 1685941260000, 1685941380000, 1685941440000, 1685941500000, 1685941560000, 1685941620000, 1685941800000, 1685941860000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R2+0+\\u5e73\\u65e5+4&quot;, &quot;popup&quot;: &quot;R2+0+\\u5e73\\u65e5+4&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.628736833672, 35.3104734056088], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.633111386316, 35.3124437872117], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R2+0+\\u5e73\\u65e5+5&quot;, &quot;times&quot;: [1685944080000, 1685944140000, 1685944320000, 1685944440000, 1685944500000, 1685944560000, 1685944620000, 1685944800000, 1685945100000, 1685945160000, 1685945220000, 1685945400000, 1685945520000, 1685945580000, 1685945640000, 1685945700000, 1685945760000, 1685945940000, 1685946000000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R2+0+\\u5e73\\u65e5+5&quot;, &quot;popup&quot;: &quot;R2+0+\\u5e73\\u65e5+5&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.628736833672, 35.3104734056088], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.633111386316, 35.3124437872117], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R2+0+\\u5e73\\u65e5+6&quot;, &quot;times&quot;: [1685948220000, 1685948280000, 1685948460000, 1685948580000, 1685948640000, 1685948700000, 1685948760000, 1685948940000, 1685949240000, 1685949300000, 1685949360000, 1685949540000, 1685949660000, 1685949720000, 1685949780000, 1685949840000, 1685949900000, 1685950080000, 1685950140000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R2+0+\\u5e73\\u65e5+6&quot;, &quot;popup&quot;: &quot;R2+0+\\u5e73\\u65e5+6&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.628736833672, 35.3104734056088], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.633111386316, 35.3124437872117], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R3+0+\\u5e73\\u65e5+1&quot;, &quot;times&quot;: [1685928540000, 1685928720000, 1685928840000, 1685928900000, 1685928960000, 1685929020000, 1685929320000, 1685929380000, 1685929440000, 1685929620000, 1685929740000, 1685929800000, 1685929860000, 1685929920000, 1685930040000, 1685930220000, 1685930280000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R3+0+\\u5e73\\u65e5+1&quot;, &quot;popup&quot;: &quot;R3+0+\\u5e73\\u65e5+1&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R3+0+\\u5e73\\u65e5+2&quot;, &quot;times&quot;: [1685932620000, 1685932800000, 1685932920000, 1685932980000, 1685933040000, 1685933100000, 1685933400000, 1685933460000, 1685933520000, 1685933700000, 1685933820000, 1685933880000, 1685933940000, 1685934000000, 1685934120000, 1685934300000, 1685934360000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R3+0+\\u5e73\\u65e5+2&quot;, &quot;popup&quot;: &quot;R3+0+\\u5e73\\u65e5+2&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R3+0+\\u5e73\\u65e5+3&quot;, &quot;times&quot;: [1685942100000, 1685942280000, 1685942400000, 1685942460000, 1685942520000, 1685942580000, 1685942880000, 1685942940000, 1685943000000, 1685943180000, 1685943300000, 1685943360000, 1685943420000, 1685943480000, 1685943540000, 1685943720000, 1685943780000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R3+0+\\u5e73\\u65e5+3&quot;, &quot;popup&quot;: &quot;R3+0+\\u5e73\\u65e5+3&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}, {&quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {&quot;name&quot;: &quot;R3+0+\\u5e73\\u65e5+4&quot;, &quot;times&quot;: [1685946240000, 1685946420000, 1685946540000, 1685946600000, 1685946660000, 1685946720000, 1685947020000, 1685947080000, 1685947140000, 1685947320000, 1685947440000, 1685947500000, 1685947560000, 1685947620000, 1685947680000, 1685947860000, 1685947920000], &quot;icon&quot;: &quot;marker&quot;, &quot;iconstyle&quot;: {&quot;iconUrl&quot;: &quot;https://deton.github.io/folium_tripslayer/bus.svg&quot;, &quot;iconSize&quot;: [24, 24], &quot;iconAnchor&quot;: [12, 12]}, &quot;style&quot;: {&quot;color&quot;: &quot;#ff00ff&quot;}, &quot;tooltip&quot;: &quot;R3+0+\\u5e73\\u65e5+4&quot;, &quot;popup&quot;: &quot;R3+0+\\u5e73\\u65e5+4&quot;}, &quot;geometry&quot;: {&quot;type&quot;: &quot;LineString&quot;, &quot;coordinates&quot;: [[139.629465989449, 35.3091888465196], [139.626618982737, 35.3098223806385], [139.628112024185, 35.306984196272], [139.629604959444, 35.3068366829395], [139.630542326811, 35.3081907229082], [139.63248650319, 35.3108206884306], [139.62708642052743, 35.31633967944443], [139.62641987091095, 35.316293190801034], [139.628424113353, 35.3167226977435], [139.633111386316, 35.3124437872117], [139.63248650319, 35.3108206884306], [139.630542326811, 35.3081907229082], [139.629604959444, 35.3068366829395], [139.628112024185, 35.306984196272], [139.626618982737, 35.3098223806385], [139.628736833672, 35.3104734056088], [139.629465989449, 35.3091888465196]]}}]},\n",
" &quot;PT4M&quot;,\n",
" &quot;PT1M&quot;,\n",
" false,\n",
" false\n",
" );\n",
" \n",
" \n",
" tile_layer_be2bce1bfccdef0f95098478c5877c4a.addTo(map_249907cf333f26e7f55cb8611e5fa199);\n",
" \n",
"&lt;/script&gt;\n",
"&lt;/html&gt;\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
],
"text/plain": [
"<folium.folium.Map at 0x2096aedf410>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import folium\n",
"import folium.plugins\n",
"from folium_tripslayer import TripsLayer\n",
"\n",
"latlon = [dfst.at[0, 'stop_lat'], dfst.at[0, 'stop_lon']]\n",
"m = folium.Map(location=latlon, zoom_start=15)\n",
"\n",
"TripsLayer(geojson, loop=False, period=\"PT1M\", duration=\"PT4M\").add_to(m)\n",
"m.save('gtfsStopsTime.html')\n",
"m"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment