Skip to content

Color terrain by normal-derived attributes: slope, aspect, curvature, matcap etc #6711

@jo-chemla

Description

@jo-chemla

User Story

As a map user, I can color terrain by slope, aspect, curvature - or additional normal-derived attributes - so that I can better visualize micro and macro relief and other relief/terrain-related topographical features.

Rationale

Recent maplibre features introduced additional hillshade options (discussion #5665 and pr #5768 inspired by gdal: combined, multi-dir, igor), hypsometric tint (discussion maplibre/maplibre-style-spec#1067 and pr #5666) or contours. In various mapping contexts it is useful to add other visualization modes - based off of the surface normal - for the micro-scale (similar to hillshade) to highlight micro-relief, topographical indicators of on-the-ground features, or for the macro-scale (similar to hypso) to grasp the environment at a glance (aspect, slope etc).

Some of these attributes can be live-computed, shader-side, directly from the surface normal vector. They could then be colormapped via paint color-relief-color interpolate:

  • slope is the z component of the normal vector,
  • aspect is the angle between up/north vector and the normal
  • slightly more convoluted, matcap is using a sphere texture that describes the color of the light ray coming from eye to surface reflected by surface normal (easy equation, but requires eye position being passed to the shader as uniform)
  • others like curvature would be a 2nd order derivative of the surface, so 1st degree derivative of the normal vector field.

Happy to hear everyon's thoughts about adding (some of) these rendering modes!

More advanced visualization modes can be viewed on the EU area on EcoDataCube from @Open-Earth-Monitor (open the Layers side-panel, open the Soil & Terrain section, and search for DTM to get the list). They are actually sourced from OpenLandMap GEDTM30 (STAC), which applied WhiteBox Geospatial tools on the terrain dataset to extract:

  • slope
  • pos/neg openness
  • min/max/profile/tangential/ring curvature
  • difference from mean
  • shape index
  • spherical deviation of normals

Impact

The advanced morphological descriptors are probably not needed, but some simple like slope, aspect, and evnentually normals/matcap would be useful.

Example extracted from Morphosedimentary characterization of the Capbreton submarine canyon system, Bay of Biscay (Cantabrian Sea) by Gómez Ballesteros) et al
Image

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