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
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
token*
string
colormap
string
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
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
thermal
velocity
jet
turbo
ylGnBu
glOrRd
density
Examples
Valid examples and their corresponding responses are available on the Map Tiles examples page.
Last updated