Map Tiles
Overview
For mapping applications, Sofar Ocean provides a map tile server that returns a raster tile with visual representations of select variables. The raster tile PNG images returned by this endpoint can be used to visualize a digital slippy map using third party mapping libraries. For example, libraries such as Leaflet.js or Mapbox.js.
More information on the specific tile format and the slippy map specification can be found on the Open Street Map wiki.
Endpoint
Retrieve a map tile representation of weather data
GET
https://api.sofarocean.com/marine-weather/v1/models/:model/tile/:zoom/:x/:y.png
Returns 256 pixel x 256 pixel PNG images of raster marine weather data.
Path Parameters
Name | Type | Description |
---|---|---|
model* | string | The ID of the model for which you want to display tile data from. |
zoom* | string | The desired zoom level to be used when cutting tiles. |
x* | string | The x coordinate index of the tile to be returned. |
y* | string | The y coordinate index of the tile to be returned. |
Query Parameters
Name | Type | Description |
---|---|---|
token* | string | A valid API token |
colormap | string | A string describing the range of colors to use for the generated tiles. See the colormap options for all of the available options.
Defaults to |
variableID* | string | A string ID specifying the specific data desired from a given model. Must have an existing association with the given model parameter. |
timestamp | string | A date string describing the point in time for weather data. Must be a valid ISO 8601 formatted timestamp. Will only return tiles when the timestamp represents a whole hour (No minutes or seconds) and the given model/variable combination has data available at that time. Some models only have data available every 3 hours (T00, T03, ..., T21) so a tile request for 'T04:00:00' will return a 404 error. If no timestamp is provided, defaults to the most recently available data for the requested model and variable. |
Additional Information
Supported Variables
The Map Tiles endpoint supports raster tile requests for the following variables:
significantWaveHeight
meanPeriod
peakPeriod
significantWaveHeightWindWaves
peakPeriodWindWaves
significantWaveHeightFirstSwell
peakPeriodFirstSwell
significantWaveHeightSecondSwell
peakPeriodSecondSwell
significantWaveHeightThirdSwell
peakPeriodThirdSwell
Colormap Options
Name | Preview Scale |
---|---|
| |
| |
| |
| |
| |
| |
|
Examples
Valid examples and their corresponding responses are available on the Map Tiles examples page.
Last updated