为我的应用程序映射 api?
我正在编写 ac# silverlight 应用程序,它将点显示到地图上。
基本上需要发生的是: 1. 我有一个位置数据集。例如,我需要从我的数据集(我当前位置的)中找到十个最近的位置,和/或搜索像“伦敦”这样的位置,并在我可以读取的 XML 文件中为我提供距离该位置最近的位置。 2. 然后,我需要使用我有权访问的 API,该 API 请求有关这十个位置的信息并通过休息接口返回数据。
第 2 点很好。但解决第 1 点的最佳方法是什么。人们是否会将数据集上传到 bing 或 google 等地图 API,并在您向他们提供当前位置或搜索指定地点时让他们返回所需的结果?
非常感谢您的指导
I am writing a c# silverlight application which displays points onto a map.
Basically what needs to happen is this:
1. I have a dataset of locations. I need to find for example the ten nearest locations from my dataset (of my current location), and/or, search a location like 'london' and give me the nearest locations from there in a XML file I can read.
2. I then need to use my an API I have access to which requests information about these ten locations and returns data via a rest interface.
Point number 2 is fine. But what is the best way of going about point number 1. Do people upload there dataset to a mapping API like bing or google and let them return the required results if you give them your current location or search for a specified place?
Many thanks for any guidance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在建立自己的数据库吗?如果是这样,您可以使用 PostGIS 扩展查看类似 PostgreSQL 的内容,或者,如果您有此许可证, Microsoft SQL Server 2008 空间。这两个数据库都可以处理空间查询。您可以编写一个 SQL 查询,该查询基本上使用当前位置作为输入,然后选择距离该位置最近的 10 个点/要素。
您还可以尝试将数据上传到 MapQuest 数据管理器(其开发者服务)使用其搜索 API 在数据管理器中搜索数据表并根据需要返回要素。您可以指定 XML 作为结果的格式。我认为使用他们的搜索 API 的一个好处是它可以进行各种类型的搜索,例如半径、矩形,甚至可以沿着路线进行搜索。例如,如果您在两个位置之间绘制了一条路线,它可以找到该路线距离内的所有内容。空间数据库也可以做到这一点,但可能更难设置,具体取决于您的经验水平。
这仅取决于您想自己做多少事情以及您拥有的数据集有多大。希望这有助于为您指明正确的方向!
Are you setting up your own database? If so, you can look at something like PostgreSQL with the PostGIS extension or, if you have a license for this, Microsoft SQL Server 2008 Spatial. Both of these databases can handle spatial queries. You can write a SQL query that basically uses the current location as an input and then selects the 10 closest points/features to that location.
You could also try something like uploading your data to MapQuest's Data Manager (part of their Developer Services) to use their Search API to search your data table in the Data Manager and return features as needed. You can specify XML as a format for your results. I think a benefit of using their Search API is that it can do various kinds of searches, like radius, rectangle, and it can even search along a route line. So for instance, if you had a route plotted between two locations, it can find everything within a distance of that route. A spatial database could also do this, but it might be harder to set up, depending on your level of experience.
It just depends on how much you want to do yourself and how large of a dataset you have. Hope this helps to point you in the right direction!