Skip to content

Implement resampling paint property to raster, hillshade, color relief layers #4117

@larsmaxfield

Description

@larsmaxfield

Implement resampling paint property to raster, hillshade, color relief layers

This issue tracks the implementation of resampling as a new style spec paint property for raster, hillshade, and color relief layers.

Examples

layers: [
  {
    id: 'raster',
    type: 'raster',
    source: 'rasterSource',
    paint: {
      'resampling': 'nearest',  // 'linear' or 'nearest'; default 'linear'
      'raster-resampling': 'nearest',  // Soft-deprecated
      ...
    },
  },
  {
    id: 'hills',
    type: 'hillshade',
    source: 'hillshadeSource',
    paint: {
      'resampling': 'nearest',  // 'linear' or 'nearest'; default 'linear'
      ...
    },
  },
  {
    id: 'color-relief',
    type: 'color-relief',
    source: 'colorReliefSource',
    paint: {
      'resampling': 'nearest',  // 'linear' or 'nearest'; default 'linear'
      ...
    },
  },
]
resampling 'nearest' 'linear'
Hillshade Nearest neighbor resampling in a hillshade layer Bilinear resampling in a hillshade layer
Color relief Nearest neighbor resampling in a color relief layer Bilinear resampling in a color relief layer

Impact

No change to existing functionality. The default resampling for raster, hillshade, and color relief remains bilinear. The new property lets us opt-in to nearest neighbor for color relief and hillshade layers, which was previously limited to only rater layers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions