Skip to content

This module is to get elevation from terrain RGB tilesets by longitude and latitude.

License

Notifications You must be signed in to change notification settings

Georepublic/terrain-rgb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terrain-rgb

GitHub

This module is to get elevation from terrain RGB tilesets by longitude and latitude.

Install

npm i @watergis/terrain-rgb

demo

code sandbox

Usage

This module can be used for PNG or WEBP terrain RGB tilesets.

import {TerrainRGB} from '@watergis/terrain-rgb';

const url = 'https://wasac.github.io/rw-terrain/tiles/{z}/{x}/{y}.png';
const trgb = new TerrainRGB(url, 512);
const elevation = await trgb.getElevation([30.0529622, -1.9575129], 15);
console.log(elevation);

If it can't find tile, it will return 404 error.

If its terrain RGB tilesets was resampled by gdal2tiles, the result of elevation might not be the same with original DEM image.

About

This module is to get elevation from terrain RGB tilesets by longitude and latitude.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%