Skip to content

vossr/Earth-elevation-Web-Mercator

Repository files navigation

Try here:

JAXA AW3D30 to WGS84 Web Mercator zxy quadtree conversion

Data download (220 GB)

Elevation encoding

  • The pseudo base-256 rgb24 encoding
  • -10000 + ((R * 256 * 256 + G * 256 + B) * 0.1)
  • Can runtime decode to float texture, so vertex shader don't need to spam the conversion

Usage

  • edit generate_webmercator.py select res and z
  • python3 generate_webmercator.py
  • python3 generate_lower_levels.py fast combine quadtree 2x2 tiles to upper tiles
  • can gdal_translate to .mbtiles (SQLite database caches to RAM)

Conversion speed optimizations

  • Precompute heightmap for egm96 (gravitational undulation calculations are slow)
  • Operate with lists instead of single elevation samples
  • Don't save tiles with no elevation data (image encoder slow)
  • Early exit by testing output tile corners for elevation data existence
  • multiprocessing
  • After optimization image encoder remains as a bottleneck
  • Level 9 output size 13GB

License

Image data under jaxa licence: