---
title: "Read a terrarium-encoded elevation tile"
method: GET
path: "/terrain/{z}/{x}/{y}.png"
tags: ["terrain"]
---

# Read a terrarium-encoded elevation tile

`GET /terrain/{z}/{x}/{y}.png`

## Request

- Base URL: `https://api.mapsource.io`
- URL: `https://api.mapsource.io/terrain/{z}/{x}/{y}.png`
- Auth: HTTP bearer

Returns a Terrarium-encoded Mapzen Terrain PNG for MapLibre raster-dem sources.

When to use: Display hillshading or 3D terrain using the catalog's tile template and zoom range.

When not to use: Use sampleElevation for a single coordinate without decoding a tile.

## Path parameters

- `z` integer, required
- `x` integer, required
- `y` integer, required

## Response `200`

Read a terrarium-encoded elevation tile

- string, binary: A terrarium-encoded PNG elevation tile.

## Other responses

- `400`: Error with a stable machine code.
- `401`: Error with a stable machine code.
- `429`: Error with a stable machine code.
- `500`: Error with a stable machine code.

---

[API](https://skmtc.dev/mapsource/apis/mapsource-overpass-api.md) · [All operations](https://skmtc.dev/mapsource/apis/mapsource-overpass-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mapsource/apis/mapsource-overpass-api/revisions/8af8c2769e7b?raw)
