Closed JunzeYang closed 4 months ago
You need to translate the multi line strings to individual lines and add the nodes in between. The toolbox assumes straight lines.
If you are using the osmnx toolbox to read OpenStreetMap, this is also achieved by setting the simplify
attribute to false and not applying the simplify_graph function. OSM only has straight edges by default and multiline segments are a simplification of the OSM map.
OK, I will try out your suggestions. Many thanks!
Hello,
I am currently working on a city-level map matching project using GPS trajectories, where the road network is simplified by removing pseudo nodes between adjacent links. Therefore, the
geometry
field in the GeoDataFramelinks
is multi-line strings inLineString
format representing actual road geometry, rather than line segments connecting the head and tail nodes of links. However, when creating the InMemMap objectmap_con
, it seems that I can only add node coordinates usingadd_node(node, loc)
and add links usingadd_edge(node_a, node_b)
. The resulting links are line segments connecting head and tail nodes (left figure), rather than multi-line strings aligned with the actual map (right figure), which could lead to inaccurate map matching. Since the network is large, is it possible to achieve this requirement without adding new nodes?Thanks a lot!