Blend

Allows you to combine the imagery from multiple providers. The simplest use case for this is to "sandwich" or "composite" semi-transparent images on top of each other. For example you can put county boundaries on top of a flood map or include a watermark on your maps. Multiple blending modes are available to fine-tune the effect.

This can only be used with layers that return JPEG or PNG images. Tiles will be scaled down to the lowest resolution to be combined and the combined result always output in PNG format.

Each downstream provider is called in parallel.

The following diagram depicts a possible request flow when using the Blend provider with the layers parameter. Note that each downstream layer is individually cached; this is useful when it’s expected for requests to also come in for each of the individual layers but an unnecessary cost if not. If you only expect requests for the blended layer, either use the providers parameter option or simply disable caching in the downstream layer(s). Blend request flow

Name should be "blend"

Parameter Description Type Required Default

providers

The providers to blend together. Order matters

Provider[]

Yes

None

mode

How to blend the images. Examples of the modes. Possible values: "add", "color burn", "color dodge", "darken", "difference", "divide", "exclusion", "lighten", "linear burn", "linear light", "multiply", "normal", "opacity", "overlay", "screen", "soft light", "subtract"

String

No

normal

opacity

Only applicable if mode is "opacity". A value between 0 and 1 controlling the amount of opacity

Float

No

0

layer

An alternative to the providers parameter for specifying references to other layers that utilize patterns. Equivalent to specifying a number of Ref providers in providers

Object - See next rows

No

None

layer.pattern

A string with one or more placeholders present wrapped in curly brackets that match the layer placeholder you want to refer towards

String

Yes

None

layer.values

An entry per instantiation of the layer, each entry should have a value for each placeholder in the pattern with the key being the placeholder and the value being the replacement value

{"k":"v"}[]

Yes

None

Example:

provider:
  name: blend
  mode: normal
  layer:
    pattern: noaa_poststorm_{date}{version}
    values:
      - date: 20230902
        version: a
      - date: 20230901
        version: b
      - date: 20230901
        version: a
      - date: 20230831
        version: b
      - date: 20230831
        version: a