cyang-kth / fmm

Fast map matching, an open source framework in C++
https://fmm-wiki.github.io/
Apache License 2.0
891 stars 215 forks source link

How is cpath made from opath? #190

Closed paymonnb closed 3 years ago

paymonnb commented 3 years ago

How is cpath made from opath?

I visualized opath and cpath using each path edge's start node. Since I need the connected nodes list(not separated from previous node), I supposed to use cpath. However cpath seems much unrealistic than opath. Is there any method to improve cpath to be more realistic or make opath to be connected?

opath

opath

cpath

cpath
cyang-kth commented 3 years ago

You can check the illustration here

https://fmm-wiki.github.io/docs/documentation/output/

image

The cpath is created by connecting the opath. The reason you see unrealistic path could be your network contains topology errors and some edges are misconnected.

paymonnb commented 3 years ago

Thank you for your answer.

I downloaded my network based on your 'download_network' code in osmnx_example.

bounds = (126.733235, 126.789141, 37.480174, 37.512656)
x1,x2,y1,y2 = bounds
boundary_polygon = Polygon([(x1,y1),(x2,y1),(x2,y2),(x1,y2)])
G = ox.graph_from_polygon(boundary_polygon, network_type='all_private',simplify=False)
start_time = time.time()
save_graph_shapefile_directional(G, filepath='./network')
print("--- %s seconds ---" % (time.time() - start_time))

I set the network_type to 'all_private'. Is there any problem in my code above?

paymonnb commented 3 years ago

I think cpath has mulitple path like this picture. Original gps data is similar with line above.

multiple cpath
cyang-kth commented 3 years ago

I think at the intersection, the lines are not connected correctly.