Skip to content
kdelchev edited this page Apr 26, 2013 · 9 revisions

Describe output in json format

Viaroute Plugin

Described in Descriptors/JSONDescriptor.h. See also: http://developers.cloudmade.com/wiki/navengine/JSON_format / http://developers.cloudmade.com/projects/routing-http-api/examples/js-response and http://developers.cloudmade.com/wiki/routing-http-api/Response_structure

version

status

  • 0 - SUCCESSFUL
  • 1 - UNKNOWN_SERVER_ERROR
  • 2 - INVALID_PARAMETER
  • 3 - PARAMETER_OUT_OF_RANGE
  • 4 - REQUIRED_PARAMETER_MISSING
  • 5 - SERVICE_UNAVAILABLE
  • 202 - ROUTE_IS_BLOCKED
  • 205 - DB_CORRUPTED
  • 206 - DB_IS_NOT_OPEN
  • 207 - NO_ROUTE
  • 208 - INVALID_START_POINT
  • 209 - INVALID_END_POINT
  • 210 - START_AND_END_POINTS_ARE_EQUAL

status_message

route_geometry

route_instructions

Route instructions are returned in an array. Each part is an array of 8 fields ["instruction","streetname",length,position,time,"length","earth_direction",azimuth]

Example: ["Turn left","High Street",200,4,10,"200m","NE",22.5]

  • 0 - driving directions : integer numbers as defined in the source file DataStructures/TurnInstructions.h.

  • 1 - way name (string)

  • 2 - length in meters (integer)

  • 3 - position

  • 4 - time in seconds

  • 5 - length with unit (string)

  • 6 - Direction abreviation (string) N: north, S: south, E: east, W: west, NW: North West, ...

  • 7 - azimuth (float)

route_summary

  • total_distance : (integer) total length in meters

  • total_time : (integer) total trip time in seconds

  • start_point : (string)

  • end_point : (string)

route_name

Array of strings giving the name of roads.

via_points

Array of via points, each via point is an array of coordinates: [lat, lon]

hint_data

Alternatives

If alternatives are requested (alt=true), following arrays may contain elements, one for each alternate route:

alternative_geometries

array of route_geometry

alternative_instructions

array of route_instructions

alternative_summaries

Array of route_summary

alternative_names

Array of route_name

Clone this wiki locally