获取路线的算法
我有一个沿 gpx 路线按距离排列的点组成的。我想用它来根据我拥有的基础轨迹数据生成方向。它工作得很好,只是数据不准确会导致 gpx 轨道上的缓冲区找不到任何踪迹的一些间隙。如果间隙小于某个单位,我想忽略这些部分。
=========================
miles | nearest trail
=========================
1 | a
2 | a
3 | a
4 | none *assume it is actually 'a'
5 | a
6 | a
7 | none
8 | none
9 | none
10 | b *assume it is actually 'none'
11 | none
12 | none
13 | c
14 | c
15 | c
我想得到这个:
=====================
trail | travel for
=====================
a | 6 miles
none | 6 miles
c | 3 miles
当我不断遇到问题时,我正在寻找一些关于如何做到这一点的建议。我目前有 mysql 表中的数据并使用 php。
I have a consisting of points along a gpx route by distance. I want to use this to generate directions based upon the underlying trail data I have. It works great except that the inaccuracies of the data cause some gaps where the buffer on the gpx track doesn't find any trails. I want to ignore these sections if the gap is smaller than a certain unit.
=========================
miles | nearest trail
=========================
1 | a
2 | a
3 | a
4 | none *assume it is actually 'a'
5 | a
6 | a
7 | none
8 | none
9 | none
10 | b *assume it is actually 'none'
11 | none
12 | none
13 | c
14 | c
15 | c
I want to get this:
=====================
trail | travel for
=====================
a | 6 miles
none | 6 miles
c | 3 miles
I am looking for some suggestions on how to do this as I keep running into problems. I currently have the data in a mysql table and am using php.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用隐马尔可夫模型。如果你给它提供之前在轨道 y 上之后在轨道 x 上的概率(因此 x=y 的概率将非常高和低),以及当实际在轨道 x 上时记录轨道 y 的概率(这将是x=y 时较高,y=none 时较低,否则较低),您可以根据 维特比算法。
You could use a Hidden Markov model. If you feed it the probabilities of being on track x after being on track y previously (so the probability for x=y would be pretty high and low otherwise), and the probability of recording track y when actually on track x (which would be high for x=y, lowish for y=none, and low otherwise), you can calculate a most probable actual path based on the observations with the Viterbi algorithm.
本质上,听起来您需要一张地图,具体来说,最短路径地图。听起来你有一些代码,但如果不发布它,我就无话可说。
Essentially it sounds like you need a map, a shortest path map to be specific. It sounds like you have some code, but without posting it there is not much I can say about it.