Share via


Maps Legends - Get

Get Legend
Generate a legend image for a given colormap.

If the colormap has non-contiguous values at the beginning or end, which aren't desired in the output image, they can be trimmed by specifying the number of values to trim.

Args: cmap_name (string): The name of the registered colormap to generate a legend for height (float, optional): The output height of the legend image width (float, optional): The output width of the legend image 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

Returns: HTTP response with jpeg encoded image data

GET https://contoso-catalog.gwhqfdeddydpareu.uksouth.geocatalog.spatio.azure.com/data/legend/colormap/{cmapName}?api-version=2025-04-30-preview
GET https://contoso-catalog.gwhqfdeddydpareu.uksouth.geocatalog.spatio.azure.com/data/legend/colormap/{cmapName}?api-version=2025-04-30-preview&height={height}&width={width}&trim_start={trim_start}&trim_end={trim_end}

URI Parameters

Name In Required Type Description
cmapName
path True

string

maxLength: 500
pattern: .*

The name of the registered colormap to generate a legend for

api-version
query True

string

minLength: 1

The API version to use for this operation.

height
query

number (double)

The output height of the legend image

trim_end
query

integer (int32)

Number of items to trim from the end of the cmap

trim_start
query

integer (int32)

Number of items to trim from the start of the cmap

width
query

number (double)

The output width of the legend image

Responses

Name Type Description
200 OK

file

Return an image.

Media Types: "image/png", "application/json"

204 No Content

There is no content to send for this request, but the headers may be useful.

Media Types: "image/png", "application/json"

Other Status Codes

Azure.Core.Foundations.ErrorResponse

An unexpected error response.

Media Types: "image/png", "application/json"

Headers

x-ms-error-code: string

Security

OAuth2Auth

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
https://geocatalog.spatio.azure.com/.default

Examples

MapsLegends_Get

Sample request

GET https://contoso-catalog.gwhqfdeddydpareu.uksouth.geocatalog.spatio.azure.com/data/legend/colormap/rdylgn?api-version=2025-04-30-preview&height=0.08&width=4.1

Sample response

"PNG raw file bytes"

Definitions

Name Description
Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors.

Azure.Core.Foundations.Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror

Azure.Core.Foundations.InnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Name Type Description
error

Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

Azure.Core.Foundations.InnerError

Inner error.