Mapzen and Copernicus DEM difference Visualization

// Mapzen and Copernicus DEM difference Visualization
//VERSON = 3
function setup() {
  return {
    input: [
      { datasource: "map", bands: ["DEM"] },
      { datasource: "cop", bands: ["DEM"] },
    ],
    output: [{ id: "default", bands: 3, sampleType: "UINT8" }],
  };
}

function evaluatePixel(samples) {
  var map = samples.map[0];
  var cop = samples.cop[0];
  let d_dem = map.DEM - cop.DEM;
  const ramps = [
    [-300, [202, 0, 32]],
    [-100, [244, 128, 85]],
    [-40, [255, 160, 125]],
    [-10, [255, 211, 195]],
    [-5, [255, 255, 255]],
    [5, [255, 255, 255]],
    [10, [196, 209, 255]],
    [40, [155, 127, 255]],
    [100, [73, 98, 222]],
    [300, [8, 0, 176]],
  ];
  const visualizer = new ColorRampVisualizer(ramps);
  vis_dem = visualizer.process(d_dem);
  return {
    default: vis_dem,
  };
}

Evaluate and Visualize

Description

Sentinel Hub supports Mapzen DEM and Copernicus DEM. Mapzen DEM is based on SRTM30 (Shuttle Radar Topography Mission) and other sources. Copernicus DEM is based on WorldDEM that is infilled on a local basis with the following DEMs: ASTER, SRTM90, SRTM30, SRTM30plus, GMTED2010, TerraSAR-X Radargrammetric DEM, ALOS World 3D-30m. More information can be found in our documentation.

This script returns a blue-white-red visualization of the difference (Mapzen DEM - Copernicus DEM) between Mapzen DEM and Copernicus DEM, and highlights where the most positive/negative values occur in your area of interest. Below is an example output showing the difference of Mapzen DEM and Copernicus DEM over the Alpine region around Mont Blanc.

dem difference

Color legend

A darker blue colour indicates larger positive differences of Mapzen DEM’s values over Copernicus DEM’s values, whereas a darker red colour indicates larger negative differences. All values greater/less than 300/-300 are mapped to 300/-300 for better visualization.

dem difference legend

Author of the script

Chung-Xiang Hong