地理空间路由 [英] Geospatial Routing

查看:223
本文介绍了地理空间路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个物流程序员,我被要求确定GPS点是否是偏离路线,其中路线由多个地理空间点(纬度,经度)组成。

I'm a logistics programmer, and I've been asked to figure out if a GPS point is "off route" where the route consists of a number of geospatial points (latitude,longitude).

确定点是否在路线附近的最佳算法是什么?我将使用C#和SQL Server,但是如果我知道使用什么算法,这真的不重要。

What is the best algorithm for determining if a point is near the route? I will be using C# and SQL Server, but really that doesn't matter a whole lot if I know what algorithm to use.

我考虑了


  1. 找到两个最近的点,

  2. 对所有点对使用向量,然后检查它们是否与由GPS点定义的向量相似,以及

我没有数学学位,但我可以处理关于任何给定正确的术语和搜索引擎。

I don't have a mathematics degree, but I can probably handle about anything given the correct terms and a search engine.

我必须每小时至少进行4000次计算,因此使用映射解决方案可能由于音量而不可接受。

I will have to make at least 4000 calculations an hour so using a mapping solution is probably not acceptable due to volume.

推荐答案


我必须每小时至少进行4000次计算, b $ b映射解决方案由于数量可能不可接受。

I will have to make at least 4000 calculations an hour so using a mapping solution is probably not acceptable due to volume.

事实上,这是一个PERFECT示例,映射解决方案将是有益的。不是传统的看地图并确定距离,而是让数据库确定到您的GPS点的最近路线。

In fact, this is a PERFECT example where a mapping solution would be beneficial. Not your traditional "look at a map and determine distance", but rather "let the database determine what is the closest route to your GPS point.

由于你说你是不反对使用不同的数据库,您可以考虑:

Since you say you are not opposed to using a different database, you could consider:


  1. SQL Server 2008,它具有空间数据库引擎功能或

  2. PostgreSQL使用开源 PostGIS (空间)扩展,其具有MS SQL 2008明显更多的空间分析功能。

  1. SQL Server 2008, which has Spatial Database Engine functions, or
  2. PostgreSQL with the open-source PostGIS (spatial) extension, which has significantly more spatial analysis functions that MS SQL 2008.

查看PostGIS ST_Distance 功能或MS SQL Server 2008 STDistance 功能,这是一个很好的博客条目,描述SQL2005与SQL2008的优点。

Take a look at the PostGIS ST_Distance function or MS SQL Server 2008 STDistance function. This is a good blog entry that describes the benefits of SQL2005 vs SQL2008.

您也可以考虑在 gis.stackexchange 上阅读(或要求更详细的映射)帖子。这整个组专门用于空间分析。

You might also consider reading (or asking more detailed mapping) posts over at gis.stackexchange. That whole group is dedicated to spatial analysis. Some good discussions for you to take a look at would be

  • Find closest lat long to an input lat long (SQL Server 2008)
  • PostGIS : nearest point on a linestring to a given point

这篇关于地理空间路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆