Skip to content

Get Elevation Profile

Retrieve the elevation profile of a polyline in JSON and CSV format. See Height models for more details about the data used by this service.

https://api3.geo.admin.ch/rest/services/profile.json
https://api3.geo.admin.ch/rest/services/profile.csv

TIP

For large datasets, use POST to send the payload in the request body

Request Details

To interact with the profile service, you need to provide specific parameters in your request. This endpoint only has query parameters that modify the behavior of the request, some are required and some are optional.

Query Parameters

ParametersDescription
geom (required)A GeoJSON representation of a polyline (type = LineString). The LineString should not have more than PROFILE_MAX_AMOUNT_POINTS, generally 5'000 coordinates.
sr (optional)The reference system to use (EPSG code). Valid value are 2056 (for LV95) and 21781 (for LV03). Strongly advised to set one, but if not given, trying to guess which one to use.
nb_points (optional)The number of points used for the polyline segmentation. Default "200".
offset (optional)The offset value (INTEGER) in order to use the exponential moving algorithm . For a given value the offset value specify the number of values before and after used to calculate the average.
distinct_points (optional)If True, it will ensure the coordinates given to the service are part of the response. Possible values are True or False, default to False.
callback (optional)Only available for profile.json. The name of the callback function.

Examples

Request
Response
sh
$ curl https://api3.geo.admin.ch/rest/services/profile.json?geom={%22type%22:%22LineString%22,%22coordinates%22:[[2550050,1206550],[2556950,1204150],[2561050,1207950]]}
Request
Response
sh
$ curl https://api3.geo.admin.ch/rest/services/profile.csv?geom={"type":"LineString","coordinates":[[2550050,1206550],[2556950,1204150],[2561050,1207950]]}