[英]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也有局限性 :
- Use is on public-facing, non-password protected Web sites 在面向公众,不受密码保护的网站上使用
- 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.