import pandas as pd
import numpy as np
import geopandas as gpd
import transbigdata as tbd
import networkx as nx
import warnings
warnings.filterwarnings('ignore')
line,stop = tbd.getbusdata('昆明市',['1号线','2号线','3号线','4号线'])
line.plot()
stop.plot()
metroline_splited = tbd.split_subwayline(line,stop)
metroline_splited.plot(column = pd.Series(metroline_splited.index))
#Modeling for subway network topology
line['speed'] = 60 #operation speed 55km/h
line['stoptime'] = 50 #stop time at each stations 50s
G = tbd.metro_network(line,stop, transfertime=50)
nx.draw(G,node_size=200)
path = tbd.get_shortest_path(G,stop,'','')
path
Obtaining city id: 昆明市success
Get bus data: 1号线
地铁1号线(环城南路-大学城南) success
地铁1号线(大学城南-环城南路) success
地铁1号线(昆明南火车站-环城南路) success
地铁1号线(环城南路-昆明南火车站) success
Get bus data: 2号线
地铁2号线(环城南路-北部汽车站) success
地铁2号线(北部汽车站-环城南路) success
地铁2号线二期(环城南路-海东公园) success
地铁2号线二期(海东公园-环城南路) success
Get bus data: 3号线
地铁3号线(东部汽车站-西山公园) success
地铁3号线(西山公园-东部汽车站) success
观鸥三号线(拓东体育馆(东风东路)-海埂大坝车场) success
观鸥三号线(海埂大坝车场-拓东体育馆(东风东路)) success
Get bus data: 4号线
地铁4号线(金川路-昆明南火车站) success
地铁4号线(昆明南火车站-金川路) success
观鸥四号线(官渡广场(国贸路)-海埂大坝车场) success
观鸥四号线(海埂大坝车场-官渡广场(国贸路)) success
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In[1], line 20
17 G = tbd.metro_network(line,stop, transfertime=50)
18 nx.draw(G,node_size=200)
---> 20 path = tbd.get_shortest_path(G,stop,'','')
21 path
File D:\python\3.12版本\Lib\site-packages\transbigdata\metro.py:213, in get_shortest_path(G, stop, ostation, dstation)
191 '''
192 Obtain the travel path of shortest path from the metro nextwork
193
(...)
210 travel path: list of station names
211 '''
212 import networkx as nx
--> 213 o = stop[stop['stationnames'] == ostation]['line'].iloc[0]+ostation
214 d = stop[stop['stationnames'] == dstation]['line'].iloc[0]+dstation
215 return nx.shortest_path(G, source=o, target=d, weight='weight')
File D:\python\3.12版本\Lib\site-packages\pandas\core\indexing.py:1153, in _LocationIndexer.__getitem__(self, key)
1150 axis = self.axis or 0
1152 maybe_callable = com.apply_if_callable(key, self.obj)
-> 1153 return self._getitem_axis(maybe_callable, axis=axis)
File D:\python\3.12版本\Lib\site-packages\pandas\core\indexing.py:1714, in _iLocIndexer._getitem_axis(self, key, axis)
1711 raise TypeError("Cannot index by location index with a non-integer key")
1713 # validate the location
-> 1714 self._validate_integer(key, axis)
1716 return self.obj._ixs(key, axis=axis)
File D:\python\3.12版本\Lib\site-packages\pandas\core\indexing.py:1647, in _iLocIndexer._validate_integer(self, key, axis)
1645 len_axis = len(self.obj._get_axis(axis))
1646 if key >= len_axis or key < -len_axis:
-> 1647 raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds
transbigdata
import pandas as pd
import numpy as np
import geopandas as gpd
import transbigdata as tbd
import networkx as nx
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['fangsong'] # 设置中文字体为仿宋
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
km = gpd.read_file(r'C:\Users\Redmi\Desktop\GIS\课程作业\全国公交路线信息\云南\km.json')
km.crs = None
km.head()
fig = plt.figure(1, (13, 5), dpi=150)
ax1 = plt.subplot(111)
km.plot(ax=ax1)
plt.title('昆明市json图(ruomu hu)')
plt.xticks([], fontsize=10)
plt.yticks([], fontsize=10);
Transbigdata 练习
import osmnx as ox
import matplotlib.pyplot as plt
streets_graph = ox.graph_from_place('云南, 昆明', network_type='drive')#address:Los Angeles城市名,California
streets_graph = ox.projection.project_graph(streets_graph)
streets = ox.graph_to_gdfs(ox.get_undirected(streets_graph), nodes=False, edges=True,
node_geometry=False, fill_edge_geometry=True)
f, ax = plt.subplots(figsize=(10, 10))
streets.plot(ax=ax, linewidth=0.2)
ax.set_axis_off()
plt.show()
Osmnx
import osmnx as ox
import networkx as nx
#根据点和半径获取地图
wurster_hall = (24.86,102.86)
one_mile = 1500 # meters
G = ox.graph_from_point(wurster_hall, dist=one_mile, network_type="drive")
fig, ax = ox.plot_graph(G, node_size=0)
#获取地点中的具体设施,可视化
G = ox.graph_from_place(
"New York, New York, USA",
retain_all=False,
truncate_by_edge=True,
simplify=True,
custom_filter='["railway"~"subway"]',
)
fig, ax = ox.plot_graph(G, node_size=0, edge_color="w", edge_linewidth=0.2)
#获取设施的几何,可视化
place = "Civic Center, Los Angeles, California"
tags = {"building": True}
gdf = ox.geometries_from_place(place, tags)
fig, ax = ox.plot_footprints(gdf, figsize=(3, 3))
#根据地点获取路网,并可视化
G = ox.graph_from_place("kunming, yunnan, china", network_type="drive")
fig, ax = ox.plot_graph(G)
#将图结构的路网转变成geopandas格式的节点和边
gdf_nodes, gdf_edges = ox.graph_to_gdfs(G)
gdf_nodes.head()
# 将geopandas格式的边和节点转变成Networkx的图
G2 = ox.graph_from_gdfs(gdf_nodes, gdf_edges, graph_attrs=G.graph)
# 计算边的中心度,赋予边权重,并渲染出来
edge_centrality = nx.closeness_centrality(nx.line_graph(G))
nx.set_edge_attributes(G, edge_centrality, "edge_centrality")
edge_centrality = nx.closeness_centrality(nx.line_graph(G))
nx.set_edge_attributes(G, edge_centrality, "edge_centrality")
#最短路径搜索
#为网络添加速度和旅行时间
G = ox.speed.add_edge_speeds(G)
G = ox.speed.add_edge_travel_times(G)
# 将节点匹配到网络的最近路段上
orig = ox.distance.nearest_nodes(G, X=-122.245846, Y=37.828903)
dest = ox.distance.nearest_nodes(G, X=-122.215006, Y=37.812303)
# 生成最短路径并渲染
route = ox.shortest_path(G, orig, dest, weight="travel_time")
fig, ax = ox.plot_graph_route(G, route, node_size=0)
#路径长度计算
edge_lengths = ox.utils_graph.get_route_edge_attributes(G, route, "length")
round(sum(edge_lengths))
---------------------------------------------------------------------------
TimeoutError Traceback (most recent call last)
File D:\python\3.12版本\Lib\site-packages\urllib3\connection.py:174, in HTTPConnection._new_conn(self)
173 try:
--> 174 conn = connection.create_connection(
175 (self._dns_host, self.port), self.timeout, **extra_kw
176 )
178 except SocketTimeout:
File D:\python\3.12版本\Lib\site-packages\urllib3\util\connection.py:95, in create_connection(address, timeout, source_address, socket_options)
94 if err is not None:
---> 95 raise err
97 raise socket.error("getaddrinfo returns an empty list")
File D:\python\3.12版本\Lib\site-packages\urllib3\util\connection.py:85, in create_connection(address, timeout, source_address, socket_options)
84 sock.bind(source_address)
---> 85 sock.connect(sa)
86 return sock
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
During handling of the above exception, another exception occurred:
ConnectTimeoutError Traceback (most recent call last)
File D:\python\3.12版本\Lib\site-packages\urllib3\connectionpool.py:715, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
714 # Make the request on the httplib connection object.
--> 715 httplib_response = self._make_request(
716 conn,
717 method,
718 url,
719 timeout=timeout_obj,
720 body=body,
721 headers=headers,
722 chunked=chunked,
723 )
725 # If we're going to release the connection in ``finally:``, then
726 # the response doesn't need to know about the connection. Otherwise
727 # it will also try to release it and we'll have a double-release
728 # mess.
File D:\python\3.12版本\Lib\site-packages\urllib3\connectionpool.py:404, in HTTPConnectionPool._make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
403 try:
--> 404 self._validate_conn(conn)
405 except (SocketTimeout, BaseSSLError) as e:
406 # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.
File D:\python\3.12版本\Lib\site-packages\urllib3\connectionpool.py:1060, in HTTPSConnectionPool._validate_conn(self, conn)
1059 if not getattr(conn, "sock", None): # AppEngine might not have `.sock`
-> 1060 conn.connect()
1062 if not conn.is_verified:
File D:\python\3.12版本\Lib\site-packages\urllib3\connection.py:363, in HTTPSConnection.connect(self)
361 def connect(self):
362 # Add certificate verification
--> 363 self.sock = conn = self._new_conn()
364 hostname = self.host
File D:\python\3.12版本\Lib\site-packages\urllib3\connection.py:179, in HTTPConnection._new_conn(self)
178 except SocketTimeout:
--> 179 raise ConnectTimeoutError(
180 self,
181 "Connection to %s timed out. (connect timeout=%s)"
182 % (self.host, self.timeout),
183 )
185 except SocketError as e:
ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x0000012860BA48F0>, 'Connection to nominatim.openstreetmap.org timed out. (connect timeout=180)')
During handling of the above exception, another exception occurred:
MaxRetryError Traceback (most recent call last)
File D:\python\3.12版本\Lib\site-packages\requests\adapters.py:486, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
485 try:
--> 486 resp = conn.urlopen(
487 method=request.method,
488 url=url,
489 body=request.body,
490 headers=request.headers,
491 redirect=False,
492 assert_same_host=False,
493 preload_content=False,
494 decode_content=False,
495 retries=self.max_retries,
496 timeout=timeout,
497 chunked=chunked,
498 )
500 except (ProtocolError, OSError) as err:
File D:\python\3.12版本\Lib\site-packages\urllib3\connectionpool.py:801, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
799 e = ProtocolError("Connection aborted.", e)
--> 801 retries = retries.increment(
802 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
803 )
804 retries.sleep()
File D:\python\3.12版本\Lib\site-packages\urllib3\util\retry.py:594, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
593 if new_retry.is_exhausted():
--> 594 raise MaxRetryError(_pool, url, error or ResponseError(cause))
596 log.debug("Incremented Retry for (url='%s'): %r", url, new_retry)
MaxRetryError: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /search?format=json&polygon_geojson=1&dedupe=0&limit=50&q=New+York%2C+New+York%2C+USA (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000012860BA48F0>, 'Connection to nominatim.openstreetmap.org timed out. (connect timeout=180)'))
During handling of the above exception, another exception occurred:
ConnectTimeout Traceback (most recent call last)
Cell In[5], line 11
8 fig, ax = ox.plot_graph(G, node_size=0)
10 #获取地点中的具体设施,可视化
---> 11 G = ox.graph_from_place(
12 "New York, New York, USA",
13 retain_all=False,
14 truncate_by_edge=True,
15 simplify=True,
16 custom_filter='["railway"~"subway"]',
17 )
18 fig, ax = ox.plot_graph(G, node_size=0, edge_color="w", edge_linewidth=0.2)
20 #获取设施的几何,可视化
File D:\python\3.12版本\Lib\site-packages\osmnx\graph.py:379, in graph_from_place(query, network_type, simplify, retain_all, truncate_by_edge, which_result, buffer_dist, clean_periphery, custom_filter)
375 # create a GeoDataFrame with the spatial boundaries of the place(s)
376 if isinstance(query, (str, dict)):
377 # if it is a string (place name) or dict (structured place query),
378 # then it is a single place
--> 379 gdf_place = geocoder.geocode_to_gdf(
380 query, which_result=which_result, buffer_dist=buffer_dist
381 )
382 elif isinstance(query, list):
383 # if it is a list, it contains multiple places to get
384 gdf_place = geocoder.geocode_to_gdf(query, buffer_dist=buffer_dist)
File D:\python\3.12版本\Lib\site-packages\osmnx\geocoder.py:138, in geocode_to_gdf(query, which_result, by_osmid, buffer_dist)
136 gdf = gpd.GeoDataFrame()
137 for q, wr in zip(query, which_result):
--> 138 gdf = pd.concat([gdf, _geocode_query_to_gdf(q, wr, by_osmid)])
140 # reset GeoDataFrame index and set its CRS
141 gdf = gdf.reset_index(drop=True)
File D:\python\3.12版本\Lib\site-packages\osmnx\geocoder.py:179, in _geocode_query_to_gdf(query, which_result, by_osmid)
157 """
158 Geocode a single place query to a GeoDataFrame.
159
(...)
175 a GeoDataFrame with one row containing the result of geocoding
176 """
177 limit = 50 if which_result is None else which_result
--> 179 results = _nominatim._download_nominatim_element(query, by_osmid=by_osmid, limit=limit)
181 # choose the right result from the JSON response
182 if not results:
183 # if no results were returned, raise error
File D:\python\3.12版本\Lib\site-packages\osmnx\_nominatim.py:64, in _download_nominatim_element(query, by_osmid, limit, polygon_geojson)
61 raise TypeError(msg)
63 # request the URL, return the JSON
---> 64 return _nominatim_request(params=params, request_type=request_type)
File D:\python\3.12版本\Lib\site-packages\osmnx\_nominatim.py:106, in _nominatim_request(params, request_type, pause, error_pause)
104 # transmit the HTTP GET request
105 utils.log(f"Get {prepared_url} with timeout={settings.timeout}")
--> 106 response = requests.get(
107 url,
108 params=params,
109 timeout=settings.timeout,
110 headers=_downloader._get_http_headers(),
111 **settings.requests_kwargs,
112 )
114 # handle 429 and 504 errors by pausing then recursively re-trying request
115 if response.status_code in {429, 504}: # pragma: no cover
File D:\python\3.12版本\Lib\site-packages\requests\api.py:73, in get(url, params, **kwargs)
62 def get(url, params=None, **kwargs):
63 r"""Sends a GET request.
64
65 :param url: URL for the new :class:`Request` object.
(...)
70 :rtype: requests.Response
71 """
---> 73 return request("get", url, params=params, **kwargs)
File D:\python\3.12版本\Lib\site-packages\requests\api.py:59, in request(method, url, **kwargs)
55 # By using the 'with' statement we are sure the session is closed, thus we
56 # avoid leaving sockets open which can trigger a ResourceWarning in some
57 # cases, and look like a memory leak in others.
58 with sessions.Session() as session:
---> 59 return session.request(method=method, url=url, **kwargs)
File D:\python\3.12版本\Lib\site-packages\requests\sessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
584 send_kwargs = {
585 "timeout": timeout,
586 "allow_redirects": allow_redirects,
587 }
588 send_kwargs.update(settings)
--> 589 resp = self.send(prep, **send_kwargs)
591 return resp
File D:\python\3.12版本\Lib\site-packages\requests\sessions.py:703, in Session.send(self, request, **kwargs)
700 start = preferred_clock()
702 # Send the request
--> 703 r = adapter.send(request, **kwargs)
705 # Total elapsed time of the request (approximately)
706 elapsed = preferred_clock() - start
File D:\python\3.12版本\Lib\site-packages\requests\adapters.py:507, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies)
504 if isinstance(e.reason, ConnectTimeoutError):
505 # TODO: Remove this in 3.0.0: see #2811
506 if not isinstance(e.reason, NewConnectionError):
--> 507 raise ConnectTimeout(e, request=request)
509 if isinstance(e.reason, ResponseError):
510 raise RetryError(e, request=request)
ConnectTimeout: HTTPSConnectionPool(host='nominatim.openstreetmap.org', port=443): Max retries exceeded with url: /search?format=json&polygon_geojson=1&dedupe=0&limit=50&q=New+York%2C+New+York%2C+USA (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000012860BA48F0>, 'Connection to nominatim.openstreetmap.org timed out. (connect timeout=180)'))
数据分析
import pandas as pd
import json
import matplotlib.pyplot as plt
# 设置图片清晰度
plt.rcParams['figure.dpi'] = 300
# 正常显示中文
plt.rcParams['font.sans-serif'] = ['fangso']
# 正常显示负号
plt.rcParams['axes.unicode_minus'] = False
# 加载数据
data = []
with open(r'C:\Users\Redmi\Desktop\数据集\交通流.txt', encoding='utf-8') as file:
for line in file:
obj = pd.json_normalize(eval(line))
# 对 stats 列进行处理,将其展开并与原数据合并
stats_df = pd.json_normalize(obj['stats'].explode())
combined_df = pd.concat([obj.drop('stats', axis=1).reset_index(drop=True), stats_df], axis=1)
data.append(combined_df)
# 将所有 DataFrame 合并成一个
df = pd.concat(data, ignore_index=True)
df
genTime | nodeId.region | nodeId.nodeId | statType.interval.interval | mapElementType | ptcType | vehicleType | timestamp | density | mapElement.laneStatInfo.laneId | ... | mapElement.laneStatInfo.linkStatInfo.nodeStatInfo.nodeId.nodeId | mapElement.laneStatInfo.extId | congestion | delay | speedArea | queueLength | volume | mapElement.movementStatInfo.turnDirection | mapElement.movementStatInfo.nodeStatInfo.nodeId.region | mapElement.movementStatInfo.nodeStatInfo.nodeId.nodeId | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1739279283 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739279283465 | 3359.0 | 1.032088e+09 | ... | 10.0 | 3079293404110025631 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
1 | 1739279283 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739279283466 | 4135.0 | 3.767599e+09 | ... | 10.0 | 3079293404110055961 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
2 | 1739279283 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739279283466 | NaN | 1.367934e+09 | ... | 10.0 | 3079293404110025619 | 4.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
3 | 1739279283 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739279283466 | NaN | 1.032088e+09 | ... | 10.0 | 3079293404110025631 | NaN | 2625.0 | NaN | NaN | NaN | NaN | NaN | NaN |
4 | 1739279283 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739279283466 | NaN | 1.032088e+09 | ... | 10.0 | 3079293404110025631 | 4.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
86424 | 1739290198 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739290198463 | 569.0 | 3.432194e+09 | ... | 10.0 | 3079293404110055955 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
86425 | 1739290198 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739290198463 | NaN | 3.432194e+09 | ... | 10.0 | 3079293404110055955 | 4.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
86426 | 1739290199 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739290199467 | NaN | 3.432194e+09 | ... | 10.0 | 3079293404110055955 | NaN | 1320.0 | NaN | NaN | NaN | NaN | NaN | NaN |
86427 | 1739290199 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739290199468 | 569.0 | 3.432194e+09 | ... | 10.0 | 3079293404110055955 | NaN | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
86428 | 1739290199 | 1 | 10 | 1 | MAP_ELEMENT_TYPE_LANE | OBJECTTYPE_MOTOR | PASSENGER_VEHICLE_TYPE_UNKNOWN | 1739290199468 | NaN | 3.432194e+09 | ... | 10.0 | 3079293404110055955 | 4.0 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
86429 rows × 22 columns
轨迹
import transbigdata as tbd
import pandas as pd
#Read_data
data = pd.read_csv(r'C:\Users\Redmi\Desktop\数据集\第6章-出租车 GPS 数据-时空大数据处理基础\第6章-出租车 GPS 数据-时空大数据处理基础\data\TaxiData-Sample.csv')
data.columns = ['VehicleNum','Time','Lng','Lat','OpenStatus','Speed']
data
VehicleNum | Time | Lng | Lat | OpenStatus | Speed | |
---|---|---|---|---|---|---|
0 | 34745 | 20:24:07 | 113.809898 | 22.627399 | 0 | 0 |
1 | 34745 | 20:24:27 | 113.809898 | 22.627399 | 0 | 0 |
2 | 34745 | 20:22:07 | 113.811348 | 22.628067 | 0 | 0 |
3 | 34745 | 20:10:06 | 113.819885 | 22.647800 | 0 | 54 |
4 | 34745 | 19:59:48 | 113.820213 | 22.674967 | 0 | 23 |
... | ... | ... | ... | ... | ... | ... |
544993 | 28265 | 21:35:13 | 114.321503 | 22.709499 | 0 | 18 |
544994 | 28265 | 09:08:02 | 114.322701 | 22.681700 | 0 | 0 |
544995 | 28265 | 09:14:31 | 114.336700 | 22.690100 | 0 | 0 |
544996 | 28265 | 21:19:12 | 114.352600 | 22.728399 | 0 | 0 |
544997 | 28265 | 19:08:06 | 114.137703 | 22.621700 | 0 | 0 |
544998 rows × 6 columns
from leuvenmapmatching.matcher.distance import DistanceMatcher
from leuvenmapmatching.map.inmem import InMemMap
from leuvenmapmatching import visualization as mmviz
#obtain OD from trajectory data
oddata = tbd.taxigps_to_od(data,col = ['VehicleNum','Time','Lng','Lat','OpenStatus'])
#extract deliver and idle trip trajectories
data_deliver,data_idle = tbd.taxigps_traj_point(data,oddata,col=['VehicleNum', 'Time', 'Lng', 'Lat', 'OpenStatus'])
# obtain road network
import osmnx as ox
bounds = [113.75, 22.4, 114.62, 22.86]
north, south, east, west = bounds[3], bounds[1], bounds[2], bounds[0]
G = ox.graph_from_bbox(north, south, east, west, network_type='drive')
oddata
C:\Users\Redmi\AppData\Local\Temp\ipykernel_18932\84526281.py:9: FutureWarning: The `north`, `south`, `east`, and `west` parameters are deprecated and will be removed in the v2.0.0 release. Use the `bbox` parameter instead.
G = ox.graph_from_bbox(north, south, east, west, network_type='drive')
VehicleNum | stime | slon | slat | etime | elon | elat | ID | |
---|---|---|---|---|---|---|---|---|
19999 | 22396 | 00:19:41 | 114.013016 | 22.664818 | 00:23:01 | 114.021400 | 22.663918 | 0 |
20093 | 22396 | 00:41:51 | 114.021767 | 22.640200 | 00:43:44 | 114.026070 | 22.640266 | 1 |
20216 | 22396 | 00:45:44 | 114.028099 | 22.645082 | 00:47:44 | 114.030380 | 22.650017 | 2 |
19092 | 22396 | 01:08:26 | 114.034897 | 22.616301 | 01:16:34 | 114.035614 | 22.646717 | 3 |
19711 | 22396 | 01:26:06 | 114.046021 | 22.641251 | 01:34:48 | 114.066048 | 22.636183 | 4 |
... | ... | ... | ... | ... | ... | ... | ... | ... |
183651 | 36805 | 22:49:12 | 114.114365 | 22.550632 | 22:50:40 | 114.115501 | 22.557983 | 5811 |
183036 | 36805 | 22:52:07 | 114.115402 | 22.558083 | 23:03:12 | 114.118484 | 22.547867 | 5812 |
180331 | 36805 | 23:03:45 | 114.118484 | 22.547867 | 23:20:09 | 114.133286 | 22.617750 | 5813 |
181803 | 36805 | 23:36:19 | 114.112968 | 22.549601 | 23:43:12 | 114.089485 | 22.538918 | 5814 |
180898 | 36805 | 23:46:14 | 114.091217 | 22.540768 | 23:53:36 | 114.120354 | 22.544300 | 5815 |
5816 rows × 8 columns
#save road network
ox.save_graphml(G,'shenzhen.graphml')
# Read the road network
import osmnx as ox
filepath = "shenzhen.graphml"
G = ox.load_graphml(filepath)
#Obtain the road GeoDataFrame and road centroid
nodes, edges = ox.graph_to_gdfs(G, nodes=True, edges=True)
edges['lon'] = edges.centroid.x
edges['lat'] = edges.centroid.y
#convert to projection coordinates
G_p = ox.project_graph(G, to_crs=2416)
nodes_p, edges_p = ox.graph_to_gdfs(G_p, nodes=True, edges=True)
edges_p.plot()
C:\Users\Redmi\AppData\Local\Temp\ipykernel_18932\1208862378.py:7: UserWarning: Geometry is in a geographic CRS. Results from 'centroid' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.
edges['lon'] = edges.centroid.x
C:\Users\Redmi\AppData\Local\Temp\ipykernel_18932\1208862378.py:8: UserWarning: Geometry is in a geographic CRS. Results from 'centroid' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.
edges['lat'] = edges.centroid.y
<Axes: >
# create road network
map_con = InMemMap(name='pNEUMA', use_latlon=False) # , use_rtree=True, index_edges=True)
for node_id, row in nodes_p.iterrows():
map_con.add_node(node_id, (row['y'], row['x']))
for node_id_1, node_id_2, _ in G_p.edges:
map_con.add_edge(node_id_1, node_id_2)
# Extract one of the trajectory using transbigdata
import geopandas as gpd
tmp_gdf = data_deliver[data_deliver['ID'] == 27].sort_values(by='Time')
# trajectory densify
tmp_gdf = tbd.traj_densify(
tmp_gdf, col=['ID', 'Time', 'Lng', 'Lat'], timegap=15)
# convert coordinate
tmp_gdf['geometry'] = gpd.points_from_xy(tmp_gdf['Lng'], tmp_gdf['Lat'])
tmp_gdf = gpd.GeoDataFrame(tmp_gdf)
tmp_gdf.crs = {'init': 'epsg:4326'}
tmp_gdf = tmp_gdf.to_crs(2416)
# obtain trajectoies
path = list(zip(tmp_gdf.geometry.y, tmp_gdf.geometry.x))
# create mapmatcher
matcher = DistanceMatcher(map_con,
max_dist=500,
max_dist_init=170,
min_prob_norm=0.0001,
non_emitting_length_factor=0.95,
obs_noise=50,
obs_noise_ne=50,
dist_noise=50,
max_lattice_width=20,
non_emitting_states=True)
# mapmatching
states, _ = matcher.match(path, unique=True)
# plot the result
mmviz.plot_map(map_con, matcher=matcher,
show_labels=False, show_matching=True, # show_graph=True,
filename=None)
D:\python\3.12版本\Lib\site-packages\transbigdata\traj.py:530: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
data[Time] = pd.to_datetime(data[Time])
D:\python\3.12版本\Lib\site-packages\pyproj\crs\crs.py:141: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
in_crs_string = _prepare_from_proj_string(in_crs_string)
Searching closeby nodes with linear search, use an index and set max_dist
(<Figure size 2000x1179.53 with 1 Axes>, <Axes: xlabel='X', ylabel='Y'>)
#Obtain the path GeoDataFrame
pathdf = pd.DataFrame(matcher.path_pred_onlynodes,columns = ['u'])
pathdf['v'] = pathdf['u'].shift(-1)
pathdf = pathdf[-pathdf['v'].isnull()]
pathgdf = pd.merge(pathdf,edges_p.reset_index())
pathgdf = gpd.GeoDataFrame(pathgdf)
pathgdf.plot()
pathgdf.crs = {'init':'epsg:2416'}
pathgdf_4326 = pathgdf.to_crs(4326)
D:\python\3.12版本\Lib\site-packages\pyproj\crs\crs.py:141: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
in_crs_string = _prepare_from_proj_string(in_crs_string)
#Visualize with road network
import matplotlib.pyplot as plt
fig = plt.figure(1,(8,8),dpi = 100)
ax = plt.subplot(111)
plt.sca(ax)
fig.tight_layout(rect = (0.05,0.1,1,0.9))
#visualization bounds
bounds = pathgdf_4326.unary_union.bounds
gap = 0.003
bounds = [bounds[0]-gap,bounds[1]-gap,bounds[2]+gap,bounds[3]+gap]
#plot the matched path
pathgdf_4326.plot(ax = ax,zorder = 1)
#plot the road network geometry
tbd.clean_outofbounds(edges,bounds,col = ['lon','lat']).plot(ax = ax,color = '#111',lw = 0.05)
#plot the trajectory points
tmp_gdf.to_crs(4326).plot(ax = ax,color = 'red',markersize = 8,zorder = 12)
plt.axis('off')
plt.xlim(bounds[0],bounds[2])
plt.ylim(bounds[1],bounds[3])
plt.show()
!pip install plot_map -i https://mirrors.cloud.tencent.com/pypi/simple
Looking in indexes: https://mirrors.cloud.tencent.com/pypi/simple
Requirement already satisfied: plot_map in d:\python\3.12版本\lib\site-packages (0.3.7)
Requirement already satisfied: geopandas in d:\python\3.12版本\lib\site-packages (from plot_map) (0.14.3)
Requirement already satisfied: matplotlib in d:\python\3.12版本\lib\site-packages (from plot_map) (3.9.2)
Requirement already satisfied: fiona>=1.8.21 in d:\python\3.12版本\lib\site-packages (from geopandas->plot_map) (1.9.5)
Requirement already satisfied: packaging in d:\python\3.12版本\lib\site-packages (from geopandas->plot_map) (23.2)
Requirement already satisfied: pandas>=1.4.0 in d:\python\3.12版本\lib\site-packages (from geopandas->plot_map) (2.1.4)
Requirement already satisfied: pyproj>=3.3.0 in d:\python\3.12版本\lib\site-packages (from geopandas->plot_map) (3.6.1)
Requirement already satisfied: shapely>=1.8.0 in d:\python\3.12版本\lib\site-packages (from geopandas->plot_map) (2.0.3)
Requirement already satisfied: contourpy>=1.0.1 in d:\python\3.12版本\lib\site-packages (from matplotlib->plot_map) (1.2.0)
Requirement already satisfied: cycler>=0.10 in d:\python\3.12版本\lib\site-packages (from matplotlib->plot_map) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in d:\python\3.12版本\lib\site-packages (from matplotlib->plot_map) (4.47.2)
Requirement already satisfied: kiwisolver>=1.3.1 in d:\python\3.12版本\lib\site-packages (from matplotlib->plot_map) (1.4.5)
Requirement already satisfied: numpy>=1.23 in d:\python\3.12版本\lib\site-packages (from matplotlib->plot_map) (1.26.3)
Requirement already satisfied: pillow>=8 in d:\python\3.12版本\lib\site-packages (from matplotlib->plot_map) (10.2.0)
Requirement already satisfied: pyparsing>=2.3.1 in d:\python\3.12版本\lib\site-packages (from matplotlib->plot_map) (3.1.1)
Requirement already satisfied: python-dateutil>=2.7 in d:\python\3.12版本\lib\site-packages (from matplotlib->plot_map) (2.8.2)
Requirement already satisfied: attrs>=19.2.0 in d:\python\3.12版本\lib\site-packages (from fiona>=1.8.21->geopandas->plot_map) (23.2.0)
Requirement already satisfied: certifi in d:\python\3.12版本\lib\site-packages (from fiona>=1.8.21->geopandas->plot_map) (2023.11.17)
Requirement already satisfied: click~=8.0 in d:\python\3.12版本\lib\site-packages (from fiona>=1.8.21->geopandas->plot_map) (8.1.7)
Requirement already satisfied: click-plugins>=1.0 in d:\python\3.12版本\lib\site-packages (from fiona>=1.8.21->geopandas->plot_map) (1.1.1)
Requirement already satisfied: cligj>=0.5 in d:\python\3.12版本\lib\site-packages (from fiona>=1.8.21->geopandas->plot_map) (0.7.2)
Requirement already satisfied: six in d:\python\3.12版本\lib\site-packages (from fiona>=1.8.21->geopandas->plot_map) (1.16.0)
Requirement already satisfied: setuptools in d:\python\3.12版本\lib\site-packages (from fiona>=1.8.21->geopandas->plot_map) (69.0.3)
Requirement already satisfied: pytz>=2020.1 in d:\python\3.12版本\lib\site-packages (from pandas>=1.4.0->geopandas->plot_map) (2023.4)
Requirement already satisfied: tzdata>=2022.1 in d:\python\3.12版本\lib\site-packages (from pandas>=1.4.0->geopandas->plot_map) (2023.4)
Requirement already satisfied: colorama in d:\python\3.12版本\lib\site-packages (from click~=8.0->fiona>=1.8.21->geopandas->plot_map) (0.4.6)
间隔
import transbigdata as tbd
import pandas as pd
import geopandas as gpd
#read data
data = pd.read_csv(r'C:\Users\Redmi\Desktop\数据集\第6章-出租车 GPS 数据-时空大数据处理基础\第6章-出租车 GPS 数据-时空大数据处理基础\data\TaxiData-Sample.csv')
data.columns = ['VehicleNum','time','slon','slat','OpenStatus','Speed']
#encode geohash
data['geohash'] = tbd.geohash_encode(data['slon'],data['slat'],precision=6)
data['geohash']
#Aggregate
dataagg = data.groupby(['geohash'])['VehicleNum'].count().reset_index()
dataagg['lon_geohash'],dataagg['lat_geohash'] = tbd.geohash_decode(dataagg['geohash'])
dataagg['geometry'] = tbd.geohash_togrid(dataagg['geohash'])
dataagg = gpd.GeoDataFrame(dataagg)
dataagg
geohash | VehicleNum | lon_geohash | lat_geohash | geometry | |
---|---|---|---|---|---|
0 | w3uf3x | 1 | 108.001099 | 10.280457 | POLYGON ((107.99561 10.27771, 107.99561 10.283... |
1 | webzz6 | 12 | 113.878784 | 22.469788 | POLYGON ((113.87329 22.46704, 113.87329 22.472... |
2 | webzz7 | 21 | 113.878784 | 22.475281 | POLYGON ((113.87329 22.47253, 113.87329 22.478... |
3 | webzzd | 1 | 113.889771 | 22.469788 | POLYGON ((113.88428 22.46704, 113.88428 22.472... |
4 | webzzf | 2 | 113.900757 | 22.469788 | POLYGON ((113.89526 22.46704, 113.89526 22.472... |
... | ... | ... | ... | ... | ... |
2022 | ws1d9u | 1 | 114.691772 | 22.964172 | POLYGON ((114.68628 22.96143, 114.68628 22.966... |
2023 | ws1ddh | 6 | 114.702759 | 22.964172 | POLYGON ((114.69727 22.96143, 114.69727 22.966... |
2024 | ws1ddj | 2 | 114.702759 | 22.969666 | POLYGON ((114.69727 22.96692, 114.69727 22.972... |
2025 | ws1ddm | 4 | 114.713745 | 22.969666 | POLYGON ((114.70825 22.96692, 114.70825 22.972... |
2026 | ws1ddq | 7 | 114.713745 | 22.975159 | POLYGON ((114.70825 22.97241, 114.70825 22.977... |
2027 rows × 5 columns
import matplotlib.pyplot as plt
import plot_map
bounds = [113.6,22.4,114.8,22.9]
fig =plt.figure(1,(8,8),dpi=480)
ax =plt.subplot(111)
plt.sca(ax)
tbd.plot_map(plt,bounds,zoom = 12,style = 4)
cax = plt.axes([0.05, 0.33, 0.02, 0.3])
plt.title('count')
plt.sca(ax)
dataagg.plot(ax = ax,column = 'VehicleNum',cax = cax,legend = True)
tbd.plotscale(ax,bounds = bounds,textsize = 6,compasssize = 1,accuracy = 2000,rect = [0.06,0.03],zorder = 10)
plt.axis('off')
plt.xlim(bounds[0],bounds[2])
plt.ylim(bounds[1],bounds[3])
plt.show()
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'
[WinError 183] 当文件已存在时,无法创建该文件。: 'C:\\Users\\Redmi\\Desktop\\出租车轨迹数据处理tileimg'