2.1.1 • Published 5 months ago

@watergis/terrain-rgb v2.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 months ago

terrain-rgb

License version npm.io npm.io

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);

TMS(Tile Map Service) tiles are also supported with

const trgb = new TerrainRGB(url, 512, 5, 15, true);

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.

If you want to use terrarium DEM, use Terrarium class as follows.

import { Terrarium } from "@watergis/terrain-rgb";

both png and webp formats are supported by the library.

2.1.1

5 months ago

2.0.2

5 months ago

2.1.0

5 months ago

2.0.1

5 months ago

2.0.0

5 months ago

1.2.0

1 year ago

1.1.9

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago