MapScale Docs
•••
Products
Product · Routing

Routing

Calculate routes, travel-time matrices and reachable areas for Thailand mobility workflows.

What you’ll achieve

Use Route for a journey, Matrix for many origin/destination pairs and Isochrone for coverage areas.

Route, Matrix or Isochrone?

Route returns a path between ordered waypoints. Matrix compares travel time and distance between many points. Isochrone returns the area reachable from one point within a time limit.

Calculate a route

Coordinates are longitude,latitude pairs separated by semicolons. Use POST when you have more waypoints or want a JSON request body.

LIVE API PLAYGROUND

Sign in or create an account

Continue to run live requests directly from the docs.

Edit the inputs, send a real request, and inspect the live response.

Editable inputs

Request preview
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/route?coordinates=100.5018%2C13.7563%3B100.5348%2C13.7466&profile=driving&lang=th"
Live response
Default response
{
  "code": "Ok",
  "routes": [
    {
      "distance": 5420,
      "duration": 780,
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            100.5018,
            13.7563
          ],
          [
            100.5348,
            13.7466
          ]
        ]
      },
      "legs": [
        {
          "distance": 5420,
          "duration": 780
        }
      ]
    }
  ],
  "waypoints": [
    {
      "location": [
        100.5018,
        13.7563
      ]
    },
    {
      "location": [
        100.5348,
        13.7466
      ]
    }
  ]
}

A second route example

A longer leg — duration and distance scale, the response shape does not.

LIVE API PLAYGROUND

Sign in or create an account

Continue to run live requests directly from the docs.

Edit the inputs, send a real request, and inspect the live response.

Editable inputs

Request preview
curl \
  -H "X-MapScale-Key: $MAPSCALE_API_KEY" \
  "https://api.mapscale.io/v1/route?coordinates=100.5348%2C13.7466%3B100.6014%2C13.6900&profile=driving&lang=th"
Live response
Default response
{
  "code": "Ok",
  "routes": [
    {
      "distance": 5420,
      "duration": 780,
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            100.5018,
            13.7563
          ],
          [
            100.5348,
            13.7466
          ]
        ]
      },
      "legs": [
        {
          "distance": 5420,
          "duration": 780
        }
      ]
    }
  ],
  "waypoints": [
    {
      "location": [
        100.5018,
        13.7563
      ]
    },
    {
      "location": [
        100.5348,
        13.7466
      ]
    }
  ]
}

Production guidance

Run routing requests from your server when they contain private operational data. Cache stable routes briefly, handle no-route responses, and show the snapped waypoints when precision matters.

Next stepPlan delivery routes

On this page