Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
324 views
in Technique[技术] by (71.8m points)

Here API batch distance calculation

Currently, is there a way to submit a list of origin and destination to Here API to batch processing and get driving distance? I saw supports said there was no such way but that was 6 months ago. I wonder if they developed the product now?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can try using Matrix Routing API with asynchronous option.

Here Matrix Routing API

The Matrix Routing service fulfills a single purpose: it calculates routing matrices (of travel times and/or distances). It supports matrices of any size up to 10,000 x 10,000.

This service is for you if you need to calculate a routing matrix

  1. with custom options and dynamic traffic applied, given the origins and destinations are within a certain region with diameter up to 400 km, or
  2. with routes of arbitrary length given a predefined set of options that can be used with free-flow speed traffic applied, or
  3. with custom options, dynamic traffic and no region size limitation, for up to 15 origins and 100 destinations, or up to 100 origins and 1 destination.

Sample code:

JSON Request Body:

{
    "origins": [{"lat": 0.0, "lng": 0.0}, {"lat": 0.1, "lng": 0.1}, ...],
    "destinations": [...],  // if omitted, origins are used as destinations
    "regionDefinition": {
        "type": "circle",
        "center": {"lat": 0.0, "lng": 0.0},
        "radius": 10000
    }
}

For more options you can look at Here Documentation


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
...