Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Releasing is documented in RELEASE.md
### Added
- accept [`sac_scale=strolling`](https://wiki.openstreetmap.org/wiki/Key:sac_scale) ([#2149](https://github.com/GIScience/openrouteservice/pull/2149))
- show export endpoint in status ([#2105](https://github.com/GIScience/openrouteservice/issue/2105))
- Documentation on the fields of Json and Geojson responses of the directions endpoint ([#2084](https://github.com/GIScience/openrouteservice/issue/2084)

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,38 @@ Additionally, there is one simple GET request that does not allow advanced reque

The **JSON** return type is best suited for further processing.

### GPX

The **GPX** return type is an XML dialect from openrouteservice based on the [GPS Exchange Format](https://www.topografix.com/gpx.asp) with an own [XML Schema](https://raw.githubusercontent.com/GIScience/openrouteservice-schema/main/gpx/v2/ors-gpx.xsd).
It is a very old standard for lightweight interchange of GPS data and thus being used by hundreds of software programs and Web services.

### GeoJSON

**GeoJSON** is a format for encoding a variety of geographic data structures, see [geojson.org](https://datatracker.ietf.org/doc/html/rfc7946).
It is widely used and can therefore be easily processed or displayed in many applications, e.g. in [QGIS](https://qgis.org/) or on [geojson.io](http://geojson.io/)

More information about the result types can be found in the [API Playground](https://openrouteservice.org/dev/#/api-docs/directions_service).

### Shared Structure (JSON and GeoJSON)

Both the **JSON** and **GeoJSON** outputs contain the same routing information, organized in slightly different formats.

| Field | Description |
| ---------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`summary`** | Total `distance` (m) and `duration` (s) for the route. |
| **`segments`** | List of route parts between waypoints, each with `distance`, `duration`, and `steps`. |
| **`steps`** | Turn-by-turn navigation instructions with `instruction`, `name`, `distance` (m), `duration` (s), and `way_points`. |
| **`way_points`** | Indices marking the start and end positions of each segment along the geometry. |
| **`bbox`** | Bounding box `[minLon, minLat, maxLon, maxLat]` of the route. |
| **`geometry`** | The path of the route. In JSON it is [encoded](https://developers.google.com/maps/documentation/utilities/polylinealgorithm), while in GeoJSON it is a `LineString` with explicit coordinates. |
| **`metadata`** | Contains additional details about the request and routing engine, including `attribution`, `service`, `timestamp`, `query`, and `engine` info. |

In the **GeoJSON** format, the route data is organized as a standard **FeatureCollection**:

* **`type`**: `"FeatureCollection"`
* **`features`**: array of route features

* each **feature** includes

* **`geometry`**: route path as a `LineString`
* **`properties`**: contains the same information as in the JSON format (`summary`, `segments`, `steps`, etc.)

### GPX

The **GPX** return type is an XML dialect from openrouteservice based on the [GPS Exchange Format](https://www.topografix.com/gpx.asp) with an own [XML Schema](https://raw.githubusercontent.com/GIScience/openrouteservice-schema/main/gpx/v2/ors-gpx.xsd).
It is a very old standard for lightweight interchange of GPS data and thus being used by hundreds of software programs and Web services.
Loading