---
title: "Get Interval Legend"
method: GET
path: "/data/legend/interval/{classmapName}"
tags: ["Map Legends"]
---

# Get Interval Legend

`GET /data/legend/interval/{classmapName}`

Generate values and color swatches mapping for a given interval classmap.

Args:
trim_start (int, optional): Number of items to trim from
the start of the cmap
trim_end (int, optional): Number of items to trim from the end of the cmap

## Path parameters

- `classmapName` string, required

## Query parameters

- `api-version` string, required
- `trim_start` integer
- `trim_end` integer

## Response `200`

Interval legend response model.

Represents a color map for intervals, where each interval is defined by:
- A numeric range `[min, max]` representing the interval boundaries.
- An RGBA color `[red, green, blue, alpha]` associated with the interval.

The response is a 2D array of interval definitions, where each element is a pair:
- The first element is an array of two numbers `[min, max]` defining the interval.
- The second element is an array of four numbers `[red, green, blue, alpha]` defining the RGBA color.

Example:
```json
[
  [
    [-2, 0], [0, 0, 0, 0]
  ],
  [
    [1, 32], [255, 255, 178, 255]
  ]
]
```
This example defines two intervals:
- The interval `[-2, 0]` is mapped to the color `[0, 0, 0, 0]` (transparent black).
- The interval `[1, 32]` is mapped to the color `[255, 255, 178, 255]` (opaque yellow).

- array[]
  - IntervalLegendsElement[]
    - unknown

## Other responses

- `204` — There is no content to send for this request, but the headers may be useful.
- `default` — An unexpected error response.

## Changes

- **2025-05-15** (2025-04-30-preview) `00cbc3d6d8e0` — 2 info
  - api operation id `MapsIntervalLegends_GetByClassMapName` removed and replaced with `MapsIntervalLegends_GetByClassmapName`
  - added the success response with the status `204`

[Change history](https://skmtc.dev/azure/apis/orbital-microsoft-planetarycomputer/changes/data/legend/interval/:classmapName/get.md)

---

[API](https://skmtc.dev/azure/apis/orbital-microsoft-planetarycomputer.md) · [All operations](https://skmtc.dev/azure/apis/orbital-microsoft-planetarycomputer/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/azure/orbital-microsoft-planetarycomputer/revisions/00cbc3d6d8e0/schema)
