Comments (3)
This probably means no matching is found. If you projected to meters than the values 2 and 1 are quite small (e.g. noise of only 1m is expected). More realistic values would be around 50m.
You can increase the output by setting the logging level (using the logging module):
leuvenmapmatching.logger.setLevel(logging.INFO) # or if you want to see all steps: logging.DEBUG
leuvenmapmatching.logger.addHandler(logging.StreamHandler(sys.stdout)) # add only if you don't see any output, otherwise it appears double
from leuvenmapmatching.
I am facing the same error for a similar setup
from leuvenmapmatching.
Yes using the logger did help. I was able to obtain the states after playing around with the parameters. However, now I am currently facing another issue with the states. I am using the following code to get the edge ids
matcher = DistanceMatcher(map_con, max_dist=1000, max_dist_init=2000, # meter min_prob_norm=0.001, non_emitting_length_factor=0.75, obs_noise=10, obs_noise_ne=75, # meter dist_noise=10, # meter non_emitting_edgeid=False) edgeid, lastidx = matcher.match(path)
Here map_con
is generated with the following code
# Creation of the Leuven Map object from the OSM network
map_con = InMemMap("myosm", use_latlon=True, use_rtree=True, index_edges=True)
# Add the OSM network into the Leuven Map object
nodes_id = list(graph.nodes)
for node in nodes_id:
lat = graph.nodes[node]['y']
lon = graph.nodes[node]['x']
map_con.add_node(node, (lat, lon))
edges_id = list(graph.edges)
for edge in edges_id:
node_a, node_b = edge[0], edge[1]
map_con.add_edge(node_a, node_b)
map_con.add_edge(node_b, node_a)
map_con.purge()
I am getting edgeids for all of my 2000 GPS points. However , some edge ids do not match to any road in the graph obtained from open street network.
For example the point 19.136265,74.008378
is snapped to road with edge id 6038805371, 6038806293
.
The graph I use is generated using osmnx with -
G = ox.graph_from_bbox(20.045204,18.569678,74.3,73.637611,network_type = 'drive')
and converted into a geodataframe using -
trip_nodes, trip_streets = ox.graph_to_gdfs(G)
trip_streets then is the following geodataframe -
However, now when in try to index into trip_streets using u = 6038805371, v = 6038806293 , key = 0/1/2
, I get a KeyError.
This happens in my case for 8 more roads given by edgeids
6038806293 , 6038792279
| 6038792279 6038792985
| 6038792985 6038792245
| 6038792245 6038792997
6038792997 6038792249
| 6038779847 6038779861
| 6038779861 6038779869
| 6038779869 2213151251
I wonder why this happens. My aim is to ultimately find the geometry of the edge onto which my GPS point has been projected for which I need to use the edgeids obtained from the function to index out the geometry from a OSM geodataframe.
Any help will be appreciated.
Best
Edit 1 - Formated better
from leuvenmapmatching.
Related Issues (20)
- How Can I get the matched nodes? HOT 11
- Can someone please put their working example? HOT 5
- Map matching does not work HOT 1
- osmnx, Geopandas, DistanceMatcher HOT 1
- Visualisation HOT 5
- No route satisfies mapmatch criteria HOT 1
- Map object has missing edges when importing from OSMNX HOT 2
- SimpleMatcher math domain error HOT 7
- does timestamp could be used for matching? HOT 1
- I have two questions about matching details。 HOT 8
- Different matching results with the same code and data source HOT 4
- Is it possible to map match a single gps point? HOT 1
- Can the matcher handle the case when there are multiple edges between two nodes? HOT 3
- How to use copy "copy_lastinterface" function and "match_incremental" properly ?
- How to match GPX data that pass through an area with no road network? HOT 7
- match method returns more points than input coordinates HOT 3
- Could you provide test data like "route.gpx" HOT 2
- What does "Stopped early at observation 0, no starting points/edges x found for which |x - (30.57,114.16)| < 250" mean? HOT 1
- I can plot the match results using mmviz.plot_map, but matcher.path_pred_onlynodes is empty. HOT 3
- How to exclude the first/last edges from the match if they have only a small overlap with the source trajectory? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leuvenmapmatching.