Skip to content

Commit

Permalink
updated test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin IGARASHI committed Dec 13, 2020
1 parent c74e2d8 commit e4c29ca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ 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.
30 changes: 15 additions & 15 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ const trgb = new TerrainRGB(url, 512)

describe('success case', (): void => {

test('30.0529622, -1.9575129', async() => {
const elevation = await trgb.getElevation([30.0529622, -1.9575129], 15);
expect(elevation).toEqual(1452);
test('30.48535, -2.03089 ', async() => {
const elevation = await trgb.getElevation([30.48535, -2.03089], 15);
expect(elevation).toEqual(1347);
});

test('29.500, -1.786', async() => {
const elevation = await trgb.getElevation([29.500, -1.786], 15);
expect(elevation).toEqual(2316);
test('30.30905, -2.01723', async() => {
const elevation = await trgb.getElevation([30.30905, -2.01723], 15);
expect(elevation).toEqual(1586);
});

test('29.831, -2.547', async() => {
const elevation = await trgb.getElevation([29.831, -2.547], 15);
expect(elevation).toEqual(1588);
test('29.46279, -2.12171', async() => {
const elevation = await trgb.getElevation([29.46279, -2.12171], 15);
expect(elevation).toEqual(1997);
});

test('30.624, -2.048', async() => {
const elevation = await trgb.getElevation([30.624, -2.048], 15);
expect(elevation).toEqual(1625);
test('29.76760, -2.68676', async() => {
const elevation = await trgb.getElevation([29.76760, -2.68676], 15);
expect(elevation).toEqual(1710);
});

test('30.615, -1.978', async() => {
const elevation = await trgb.getElevation([30.615, -1.978], 15);
expect(elevation).toEqual(1562);
test('30.78230, -2.25379', async() => {
const elevation = await trgb.getElevation([30.78230, -2.25379], 15);
expect(elevation).toEqual(1392);
});
})

0 comments on commit e4c29ca

Please sign in to comment.