Examples4Wings Tiles
Get AIS vessel presence heatmap in PNG format
Example 4Wings tile request returning AIS vessel presence as a PNG heatmap, using a generated style.
Path parameters
| Parameter | Value | Description |
|---|---|---|
z/x/y | 2/3/1 | Tile coordinates |
Query parameters
| Parameter | Value | Description |
|---|---|---|
format | PNG | Tile output format |
interval | DAY | Daily temporal resolution |
datasets[0] | public-global-presence:latest | AIS vessel presence dataset |
date-range | 2020-01-01,2020-01-31 | Filter to January 2020 |
style | [STYLE] (base64 style blob) | Style generated by the Create a style for PNG tiles endpoint |
Request
# Make sure to replace [TOKEN] with your API Access Token
curl --location --request GET 'https://gateway.api.globalfishingwatch.org/v3/4wings/tile/heatmap/2/3/1?format=PNG&interval=DAY&datasets[0]=public-global-presence:latest&date-range=2020-01-01,2020-01-31&style=[STYLE]' \
-H "Authorization: Bearer [TOKEN]" \
-o "vessel-presence-tile.PNG"// Make sure to replace [TOKEN] with your API Access Token.
const res = await fetch(
'https://gateway.api.globalfishingwatch.org/v3/4wings/tile/heatmap/2/3/1?format=PNG&interval=DAY&datasets[0]=public-global-presence:latest&date-range=2020-01-01,2020-01-31&style=[STYLE]',
{ headers: { Authorization: 'Bearer [TOKEN]' } }
)
const blob = await res.blob()Make sure to replace [STYLE] with the style obtained in the previous endpoint "Create a style for generate PNG tiles" in the 'url' field
Response
If the request is successful, in this example the response will be a PNG file similar to this.