Create a Style for PNG Tiles
Create a style document defining how 4Wings data is drawn. Required before requesting PNG tiles.
A Style is a document that defines the visual appearance of a map, in this case the map will be in PNG format, it includes what data to draw, the order to draw it in, and how to style the data when drawing it.
Generate PNG
Authorization
ApiKeyAuth In: header
Query Parameters
Color in hexadecimal used to generate the color ramp
Tiles are available at several time resolutions (hourly, daily and 10 days), it means one frame every one hour, one day or 10 days. For each resolution, the max displayable length items: 1 hour (20 days), 1 day (1 year), 10 days (several years depending on the dataset for AIS Fishing effort it starts in 2012)
Value in
- "10DAYS"
- "DAY"
- "HOUR"
- "MONTH"
- "YEAR"
Specify the datasets that will be used to create the style. You can learn more about which are the possible datasets here. The parameters should be defined using an index, in case only one dataset is going to be sent: ?dataset[0]=xxxxx, in case of multiple datasets: ?dataset[0]=xxxxx&dataset[1]=yyyyy
Filters are applied to the dataset parameter with the corresponding index. For example if we want to apply a filter to dataset[0], we should apply the filter attributes to filter[0].For AIS fishing effort, the possible filters are: flag, geartype
Start date and end date to filter the data
Vessel group ids to filter (separated by comma). Vessel groups applied at dataset with index 0. At the same as datasets, this query param could be send with different index to apply filters to other datasets.
curl -X POST "https://example.com/v3/4wings/generate-png?color=%23361c0c&interval=10DAYS&datasets%5B0%5D=public-global-fishing-effort%3Alatest&filters%5B0%5D=flag+in+%28%27ESP%27%29&date-range=2021-01-01%2C2021-03-01&vessel-groups%5B0%5D=1%2C2"{ "colorRamp": { "stepsByZoom": { "0": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "1": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "2": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "3": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "4": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "5": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "6": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "7": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "8": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "9": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "10": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "11": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ], "12": [ { "color": "rgba(255, 255, 255, 0)", "value": 10 } ] } }, "url": "https://gateway.api.globalfishingwatch.org/v1/4wings/tile/heatmap/{z}/{x}/{y}?format=png&interval=%s&datasets[0]=public-global-fishing-effort:latest"}{ "error": "Unauthorized", "messages": [ { "detail": "string", "title": "string" } ], "statusCode": 401}{ "error": "Forbidden", "messages": [ { "detail": "string", "title": "string" } ], "statusCode": 403}{ "error": "UnprocessableEntity", "messages": [ { "detail": "string", "title": "string" } ], "statusCode": 422}{ "error": "Service Unavailable", "messages": [ { "detail": "string", "title": "string" } ], "statusCode": 503}Examples using AIS apparent fishing effort:
- EXAMPLE 1 - Filtering by time period
- EXAMPLE 2 - Filtering by time period and gear type. Check Gear Types supported here.
Examples using SAR (Synthetic-aperture radar) vessel detections:
- EXAMPLE 3 - Filtering any SAR vessel detections by time period
- EXAMPLE 4 - Filtering SAR vessel detections that didn't match with AIS vessels
Examples using AIS Vessel Presence: