简体   繁体   中英

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. 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. Can I access Google/Bing/other map services from C# to compute these distances?

Thank you very much.

Can I access Google/Bing/other map services from C# to compute these distances?

Probably not.

Google's documentation on usage limits:

Use of the Google Directions API is subject to a query limit of 2,500 directions requests per day. Individual directions requests may contain up to 8 intermediate waypoints in the request. Google Maps Premier customers may query up to 100,000 directions requests per day, with up to 23 waypoints allowed in each request.

Bing also has limits :

  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

For this task,Google has Directions Web Services that can generate route information through json and xml formats.

In order to access this web services,you need to receive a private key from 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 .

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.

Hope this helps
Myra

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM