{
  "version": 8,
  "id": "weather_sppi",
  "name": "Combined SPPI Weather Style",
  "sprite": "https://tiles.weather.giscloud.ru/sprite/weather",
  "glyphs": "https://tiles.weather.giscloud.ru/fonts/{fontstack}/{range}.pbf",
  "metadata": {
    "filters": {
      "zones": [
        {"id": "sigmet"},
        {"id": "airmet"},
        {"id": "gamet"}
      ],
      "roshydro": [
        {"id": "image_tmp_roshydro"},
        {"id": "image_rh_roshydro"},
        {"id": "roshydro_wind_points"}
      ],
      "metars": [ {"id": "metars"} ]
    },
    "locale": {
      "ru": {
        "sigmet": "SIGMET",
        "airmet": "AIRMET",
        "gamet": "GAMET",
        "image_tmp_roshydro": "Температура",
        "image_rh_roshydro": "Влажность",
        "roshydro_wind_points": "Ветер",
        "metars": "METAR/SPECI",
        "zones": "Зоны погодных явлений"
      },
      "en-US": {
        "sigmet": "SIGMET",
        "airmet": "AIRMET",
        "gamet": "GAMET",
        "image_tmp_roshydro": "Temperature",
        "image_rh_roshydro": "Humidity",
        "roshydro_wind_points": "Wind",
        "metars": "METAR/SPECI",
        "zones": "Weather zones"
      }
    }
  },
  "sources": {
    "sigmets_source": { "type": "vector", "url": "https://tiles.weather.giscloud.ru/sources/sigmets" },
    "airmets_source": { "type": "vector", "url": "https://tiles.weather.giscloud.ru/sources/airmets" },
    "gamets_source": { "type": "vector", "url": "https://tiles.weather.giscloud.ru/sources/gamets" },
    "roshydro_wind_points": {
      "type": "vector",
      "url": "https://tiles.weather.giscloud.ru/sources/roshydro_wind_points"
    },
    "image_tmp_roshydro": {
      "type": "image",
      "url": "https://tiles.weather.giscloud.ru/rb_tiles/image_tmp_roshydro",
      "meta_url": "https://tiles.weather.giscloud.ru/sources/image_tmp_roshydro",
      "query_params":  [ "level", "time", "frc", "format", "quality"],
      "coordinates": [
        [-180.625, 85.05112878],
        [179.375, 85.05112878],
        [179.375, -85.05112878],
        [-180.625, -85.05112878]
      ]
    },
    "image_rh_roshydro": {
      "type": "image",
      "url": "https://tiles.weather.giscloud.ru/rb_tiles/image_rh_roshydro",
      "meta_url": "https://tiles.weather.giscloud.ru/sources/image_rh_roshydro",
      "query_params":  [ "level", "time", "frc", "format", "quality"],
      "coordinates": [
        [-180.625, 85.05112878],
        [179.375, 85.05112878],
        [179.375, -85.05112878],
        [-180.625, -85.05112878]
      ]
    },
    "metars": {
      "type": "vector",
      "url": "https://tiles.weather.giscloud.ru/sources/metars"
    }
  },
  "layers": [
    {
      "id": "sigmets_fill",
      "type": "fill",
      "source": "sigmets_source",
      "metadata": {"filter_id": "sigmet"},
      "source-layer": "sigmets",
      "paint": {
        "fill-color": "rgba(66, 212, 245, 0.1)",
        "fill-outline-color": "rgba(66, 212, 245, 1)",
        "fill-opacity": 1
      }
    },
    {
      "id": "airmets_fill",
      "type": "fill",
      "source": "airmets_source",
      "metadata": {"filter_id": "airmet"},
      "source-layer": "airmets",
      "paint": {
        "fill-color": "rgba(245, 81, 66, 0.1)",
        "fill-outline-color": "rgba(245, 81, 66, 1)",
        "fill-opacity": 1
      }
    },
    {
      "id": "gamets_fill",
      "type": "fill",
      "source": "gamets_source",
      "metadata": {"filter_id": "gamet"},
      "source-layer": "gamets",
      "paint": {
        "fill-color": "rgba(245, 156, 66, 0.1)",
        "fill-outline-color": "rgba(245, 156, 66, 1)",
        "fill-opacity": 1
      }
    },
    {
      "id": "image_rh_roshydro",
      "type": "raster",
      "source": "image_rh_roshydro",
      "metadata": {
        "filter_id": "image_rh_roshydro"
      },
      "layout": { "visibility": "visible" },
      "paint": {
        "raster-opacity": 0.8,
        "raster-resampling": "linear"
      }
    },
    {
      "id": "image_tmp_roshydro",
      "type": "raster",
      "source": "image_tmp_roshydro",
      "metadata": {
        "filter_id": "image_tmp_roshydro"
      },
      "layout": { "visibility": "visible" },
      "paint": {
        "raster-opacity": 0.8,
        "raster-resampling": "linear"
      }
    },
    {
      "id": "metars-station-wind",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "filter": [
        "all",
        [ "has", "wind_speed_kt" ],
        [ ">", ["get", "wind_speed_kt"], 0 ]
      ],
      "layout": {
        "icon-image": [
          "concat",
          "wind_",
          ["to-string", ["get", "wind_speed_kt"]]
        ],
        "icon-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          0, 0.2,
          2, 0.3,
          10, 1
        ],
        "icon-allow-overlap": true,
        "icon-rotate": ["get", "wind_dir_deg"],
        "icon-pitch-alignment": "viewport",
        "icon-rotation-alignment": "viewport",
        "visibility": "visible"
      }
    },
    {
      "id": "metars-station-sky",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "layout": {
        "icon-image": [
          "concat",
          "clouds/cloud_",
          ["to-string", ["get", "sky_coverage"]]
        ],
        "icon-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          0, 0.2,
          2, 0.3,
          10, 0.8
        ],
        "icon-allow-overlap": true,
        "icon-pitch-alignment": "map",
        "icon-rotation-alignment": "map",
        "visibility": "visible"
      }
    },
    {
      "id": "metars-station-cloud-high",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "layout": {
        "icon-image": [
          "concat",
          "metar_icons/cloudwise/high_level/",
          ["to-string", ["get", "clouds_high_level"]]
        ],
        "icon-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          0, 0.15,
          6, 0.3,
          10, 0.55
        ],
        "icon-offset": [0, -105],
        "icon-allow-overlap": true,
        "icon-ignore-placement": true,
        "icon-pitch-alignment": "map",
        "icon-rotation-alignment": "map",
        "visibility": "visible"
      }
    },
    {
      "id": "metars-station-cloud-middle",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "layout": {
        "icon-image": [
          "concat",
          "metar_icons/cloudwise/middle_level/",
          ["to-string", ["get", "clouds_middle_level"]]
        ],
        "icon-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          0, 0.15,
          6, 0.3,
          10, 0.55
        ],
        "icon-offset": [0, -60],
        "icon-allow-overlap": true,
        "icon-ignore-placement": true,
        "icon-pitch-alignment": "map",
        "icon-rotation-alignment": "map"
      }
    },
    {
      "id": "metars-station-cloud-low",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "layout": {
        "icon-image": [
          "concat",
          "metar_icons/cloudwise/low_level/",
          ["to-string", ["get", "clouds_low_level"]]
        ],
        "icon-size": ["interpolate", ["linear"], ["zoom"], 6, 0.3, 10, 0.7],
        "icon-offset": [0, 40],
        "icon-allow-overlap": true,
        "icon-ignore-placement": true,
        "icon-pitch-alignment": "map",
        "icon-rotation-alignment": "map",
        "text-pitch-alignment": "auto"
      }
    },
    {
      "id": "metars-station-phenomena",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "filter": ["all"],
      "layout": {
        "icon-image": [
          "concat",
          "metar_icons/phenomena/",
          ["to-string", ["get", "weather_icon_code"]]
        ],
        "icon-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          0, 0.2,
          6, 0.3,
          10, 0.5
        ],
        "icon-offset": [-67, 0],
        "icon-allow-overlap": true,
        "icon-ignore-placement": true,
        "icon-pitch-alignment": "map",
        "icon-rotation-alignment": "map"
      }
    },
    {
      "id": "metars-station-pressure-tendency-code",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "layout": {
        "icon-image": [
          "concat",
          "metar_icons/pressure_tendency/",
          ["to-string", ["get", "pressure_tendency_code"]]
        ],
        "icon-size": ["interpolate", ["linear"], ["zoom"], 6, 0.3, 10, 0.5],
        "icon-allow-overlap": true,
        "icon-pitch-alignment": "map",
        "icon-rotation-alignment": "map"
      },
      "paint": {
        "icon-translate": [
          "interpolate",
          ["linear"],
          ["zoom"],
          6, ["literal", [36, 8]],
          8, ["literal", [50, 14]],
          10, ["literal", [77, 14.5]]
        ],
        "icon-translate-anchor": "viewport"
      }
    },
    {
      "id": "metars-station-pressure-tendency-delta",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "maxzoom": 24,
      "layout": {
        "text-field": [
          "concat",
          [
            "case",
            [">", ["to-number", ["get", "pressure_tendency_delta"]], 0],
            "+",
            ""
          ],
          ["to-string", ["get", "pressure_tendency_delta"]]
        ],
        "text-font": ["Arial"],
        "text-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          6, 10,
          8, 16,
          10, 22
        ],
        "text-anchor": "center",
        "text-offset": [1.7, 1.5],
        "text-pitch-alignment": "viewport",
        "text-rotation-alignment": "viewport",
        "text-keep-upright": true,
        "text-allow-overlap": true,
        "text-ignore-placement": true,
        "visibility": "visible"
      },
      "paint": {
        "text-color": "#000000",
        "text-halo-color": "#ffffff",
        "text-halo-width": 1.6,
        "text-translate": [
          "interpolate",
          ["linear"],
          ["zoom"],
          6, ["literal", [0, -5]],
          8, ["literal", [-3, -6]],
          10, ["literal", [-0.5, -12]]
        ],
        "text-translate-anchor": "viewport"
      }
    },
    {
      "id": "metars-station-temp",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "maxzoom": 24,
      "layout": {
        "text-field": ["to-string", ["get", "temperature_c"]],
        "text-font": ["Arial"],
        "text-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          6, 10,
          8, 16,
          10, 22
        ],
        "text-anchor": "center",
        "text-offset": [-2, -0.5],
        "text-pitch-alignment": "viewport",
        "text-rotation-alignment": "viewport",
        "text-keep-upright": true,
        "visibility": "visible"
      },
      "paint": {
        "text-color": "#000000",
        "text-halo-color": "#ffffff",
        "text-halo-width": 1.2,
        "text-translate": [
          "interpolate",
          ["linear"],
          ["zoom"],
          6, ["literal", [-6, -7]],
          8, ["literal", [-11, -7]],
          10, ["literal", [-12, -6]]
        ],
        "text-translate-anchor": "viewport"
      }
    },
    {
      "id": "metars-station-dewpoint",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "layout": {
        "text-field": ["to-string", ["get", "dew_point_c"]],
        "text-font": ["Arial"],
        "text-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          6, 10,
          8, 16,
          10, 22
        ],
        "text-anchor": "center",
        "text-offset": [-2, 2],
        "text-pitch-alignment": "viewport",
        "text-rotation-alignment": "viewport",
        "text-keep-upright": true,
        "text-allow-overlap": true,
        "text-ignore-placement": true,
        "visibility": "visible"
      },
      "paint": {
        "text-color": "#000000",
        "text-halo-color": "#ffffff",
        "text-halo-width": 1.6,
        "text-translate": [
          "interpolate",
          ["linear"],
          ["zoom"],
          6, ["literal", [2, -8]],
          8, ["literal", [7.5, -10.5]],
          10, ["literal", [7, -11]]
        ],
        "text-translate-anchor": "viewport"
      }
    },
    {
      "id": "metars-station-pressure",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "maxzoom": 24,
      "layout": {
        "text-field": [
          "to-string",
          ["round", ["get", "sea_level_pressure_hpa"]]
        ],
        "text-font": ["Arial"],
        "text-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          6, 10,
          8, 16,
          10, 22
        ],
        "text-anchor": "center",
        "text-offset": [2, -0.5],
        "text-pitch-alignment": "viewport",
        "text-rotation-alignment": "viewport",
        "text-keep-upright": true,
        "visibility": "visible"
      },
      "paint": {
        "text-color": "#000000",
        "text-halo-color": "#ffffff",
        "text-halo-width": 2,
        "text-translate": [
          "interpolate",
          ["linear"],
          ["zoom"],
          6, ["literal", [0, 3]],
          8, ["literal", [-5, 6]],
          10, ["literal", [-0.5, 4.5]]
        ],
        "text-translate-anchor": "map"
      }
    },
    {
      "id": "metars-icao-unzoom",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 0,
      "layout": {
        "text-field": ["to-string", ["get", "icao"]],
        "text-font": ["Arial"],
        "text-size": {
          "stops": [
            [0, 8],
            [6, 14],
            [8, 18],
            [10, 20],
            [12, 24]
          ],
          "base": 1
        },
        "text-allow-overlap": false,
        "text-ignore-placement": false,
        "text-optional": true,
        "text-variable-anchor": ["top"],
        "text-radial-offset": [
          "interpolate",
          ["linear"],
          ["zoom"],
          0, -1,
          2, 1,
          4, 1,
          6, 1.6,
          8, 2.4,
          10, 3
        ],
        "text-offset": [0, 0],
        "text-padding": 2,
        "text-pitch-alignment": "viewport",
        "text-rotation-alignment": "viewport",
        "symbol-placement": "point",
        "symbol-z-order": "source",
        "visibility": "visible"
      },
      "paint": {
        "text-color": "#000000",
        "text-halo-color": ["step", ["zoom"], "#000000", 6, "#ffffff"],
        "text-halo-width": [
          "interpolate",
          ["linear"],
          ["zoom"],
          0, 0.1,
          6, 0.2,
          8, 1.1,
          10, 0.9
        ],
        "text-halo-blur": ["step", ["zoom"], 0.05, 6, 0]
      }
    },
    {
      "id": "metars-station-expired",
      "type": "symbol",
      "metadata": {"filter_id": "metars"},
      "source": "metars",
      "source-layer": "metars",
      "minzoom": 6,
      "filter": ["==", ["get", "expired"], true],
      "layout": {
        "icon-image": "metar_icons/expired",
        "icon-size": ["interpolate", ["linear"], ["zoom"], 6, 0.3, 10, 0.5],
        "icon-anchor": "center",
        "icon-allow-overlap": true,
        "icon-ignore-placement": true,
        "icon-pitch-alignment": "map",
        "icon-rotation-alignment": "map",
        "visibility": "visible"
      },
      "paint": {
        "icon-opacity": 0.8,
        "icon-translate": [
          "interpolate",
          ["exponential", 1.12],
          ["zoom"],
          0, ["literal", [-20, 0]],
          2, ["literal", [-5, 0]],
          4, ["literal", [-10, 0]],
          6, ["literal", [-35, 0]],
          8, ["literal", [-50, 0]],
          10, ["literal", [-80, 0]]
        ],
        "icon-translate-anchor": "map"
      }
    },
    {
      "id": "roshydro_wind_points",
      "type": "symbol",
      "metadata": {"filter_id": "roshydro_wind_points"},
      "source": "roshydro_wind_points",
      "source-layer": "roshydro_wind_points",
      "layout": {
        "icon-image": [
          "concat",
          "wind_",
          [
            "to-string",
            [
              "let",
              "knots",
              ["*", ["get", "speed"], 1.94384449],
              [
                "case",
                ["<=", ["var", "knots"], 0.3],
                0,
                [">", ["var", "knots"], 300],
                0,
                ["<=", ["var", "knots"], 2],
                1,
                ["*", 5, ["ceil", ["/", ["-", ["var", "knots"], 2], 5]]]
              ]
            ]
          ]
        ],
        "icon-rotate": [
          "case",
          [">", ["get", "direction"], 360],
          0,
          ["round", ["get", "direction"]]
        ],
        "icon-size": [
          "interpolate",
          ["linear"],
          ["zoom"],
          0, 0.4,
          2, 0.5,
          10, 0.8
        ],
        "icon-allow-overlap": true,
        "icon-rotation-alignment": "map",
        "icon-pitch-alignment": "map"
      }
    }
  ]
}