简体   繁体   English

从C#批量访问Google或Bing地图

[英]Batch accessing Google or Bing Maps from C#

Good morning, 早上好,

I am currently working on a project in which I need to compute the pairwise distance between some 4000 points. 我目前正在一个项目中,我需要计算大约4000点之间的成对距离。 Since I have the coordinates of all the points, computing the straight-line distance between them was not very difficult... But now I would like to compute the same ~ 8 million distances using not the straight-line path but the shortest path by road, as given by GPS software. 由于我具有所有点的坐标,因此计算它们之间的直线距离并不是很困难...但是现在我想使用的不是直线路径,而是使用最短路径来计算相同的〜800万个距离道路,由GPS软件提供。 Can I access Google/Bing/other map services from C# to compute these distances? 我可以通过C#访问Google / Bing /其他地图服务来计算这些距离吗?

Thank you very much. 非常感谢你。

Can I access Google/Bing/other map services from C# to compute these distances? 我可以通过C#访问Google / Bing /其他地图服务来计算这些距离吗?

Probably not. 可能不是。

Google's documentation on usage limits: Google的使用限制文档

Use of the Google Directions API is subject to a query limit of 2,500 directions requests per day. 使用Google Directions API每天最多可查询2500个路线请求。 Individual directions requests may contain up to 8 intermediate waypoints in the request. 各个路线请求中最多可以包含8个中间航路点。 Google Maps Premier customers may query up to 100,000 directions requests per day, with up to 23 waypoints allowed in each request. Google Maps Premier客户每天最多可查询100,000个路线请求,每个请求中最多可允许23个航路点。

Bing also has limits : Bing也有局限性

  1. Use is on public-facing, non-password protected Web sites 在面向公众,不受密码保护的网站上使用
  2. Limit of 125,000 sessions or 500,000 transactions in a 12 month period 在12个月内限制125,000个会话或500,000个事务

For this task,Google has Directions Web Services that can generate route information through json and xml formats. 对于此任务,Google具有Directions Web服务,该服务可以通过json和xml格式生成路线信息。

In order to access this web services,you need to receive a private key from Google. 为了访问此Web服务,您需要从Google接收私钥。
And you need to specify the information as request string,described in here 你需要指定中记载的信息为请求字符串, 在这里
Then you should convert your key to base64string within HMACSHA1 algorithm.There is a documentation here . 然后你应该在HMACSHA1算法中将你的密钥转换为base64string这里有一个文档。

In the end you have a url with your request information plus your key.Then,you can simply request this url to get xml and json.All you have to do is to read response. 最后,你有一个包含你的请求信息和你的密钥的网址。然后,你可以简单地请求这个网址来获取xml和json。你要做的就是读取响应。

Hope this helps 希望这可以帮助
Myra 迈拉

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 对于 Bing 地图或 Google 地图或 ArcGIS - C# 中的太阳能终结者(太阳足迹) - For Bing Maps or Google Maps or ArcGIS - Solar Teminator (Sun Footprint) in C# C# Bing Maps SDK 非常慢 - C# Bing Maps SDK is painfully slow 使用经度和纬度搜索bing地图-C# - Search bing maps with latitude and longitude - c# C#中的必应地图-更改图钉图像 - Bing Maps in C# - Change Pushpin Image 从utr执行Google / Bing地图搜索 - Perform a Google/Bing Maps search from a utr 是否可以使用C#将Bing / Google地图自动填充邮政地址文本框放置在桌面Windows窗体应用程序中? - Is it possible to place Bing/Google Maps autocomplete postal address textbox in desktop windows form app using C#? 在C#中,如何通过经度和纬度值从“必应地图”中获取最近的位置? - In C#, how do I get a nearest place from Bing Maps from a longitude and latitude value? Bing Maps C#GPX Route Viewer无法编译:无法从LocationCollection转换为LocationRect - Bing Maps C# GPX Route Viewer won't compile: cannot convert from LocationCollection to LocationRect 如何在C#中从bing映射创建缩略图/快照以实现通用解决方案 - How to create thumbnail/snapshot from bing maps in c# for universal solution 图钉标注Bing Maps SDK Metro App XAML C# - Pushpin callout bing maps sdk metro app xaml c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM