{"id":21975071,"url":"https://github.com/watergis/terrain-rgb","last_synced_at":"2025-04-28T15:43:11.630Z","repository":{"id":40304618,"uuid":"321041472","full_name":"watergis/terrain-rgb","owner":"watergis","description":"This module is to get elevation from terrain RGB / terrarium tilesets by longitude and latitude.","archived":false,"fork":false,"pushed_at":"2025-02-14T01:34:45.000Z","size":578,"stargazers_count":18,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T04:09:44.307Z","etag":null,"topics":["elevation","terrain-rgb","terrarium"],"latest_commit_sha":null,"homepage":"https://watergis.github.io/terrain-rgb/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/watergis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["JinIgarashi"],"open_collective":"watergis"}},"created_at":"2020-12-13T10:46:59.000Z","updated_at":"2025-04-03T05:30:42.000Z","dependencies_parsed_at":"2024-04-15T07:12:13.853Z","dependency_job_id":"1859f8cf-9f32-4240-8d53-c70b97f382d4","html_url":"https://github.com/watergis/terrain-rgb","commit_stats":{"total_commits":33,"total_committers":5,"mean_commits":6.6,"dds":0.5151515151515151,"last_synced_commit":"9069e14323742b87e8ecab09a5ca18efe459bdc8"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fterrain-rgb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fterrain-rgb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fterrain-rgb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watergis%2Fterrain-rgb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watergis","download_url":"https://codeload.github.com/watergis/terrain-rgb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250992706,"owners_count":21519527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elevation","terrain-rgb","terrarium"],"created_at":"2024-11-29T15:49:31.848Z","updated_at":"2025-04-28T15:43:11.619Z","avatar_url":"https://github.com/watergis.png","language":"TypeScript","funding_links":["https://github.com/sponsors/JinIgarashi","https://opencollective.com/watergis"],"categories":[],"sub_categories":[],"readme":"# terrain-rgb\n\n![License](https://img.shields.io/github/license/watergis/terrain-rgb)\n[![version](https://img.shields.io/npm/v/@watergis/terrain-rgb.svg)](https://www.npmjs.com/package/@watergis/terrain-rgb)\n![](https://github.com/watergis/terrain-rgb/workflows/build/badge.svg)\n![](https://github.com/watergis/terrain-rgb/workflows/Node.js%20Package/badge.svg)\n\nThis module is to get elevation from terrain RGB tilesets by longitude and latitude.\n\n## Install\n\n```\nnpm i @watergis/terrain-rgb\n```\n\n## demo\n\n[code sandbox](https://codesandbox.io/s/terrain-rgb-g4nym)\n\n## Usage\n\nThis module can be used for PNG or WEBP terrain RGB tilesets.\n\n```ts\nimport { TerrainRGB } from \"@watergis/terrain-rgb\";\n\nconst url = \"https://wasac.github.io/rw-terrain/tiles/{z}/{x}/{y}.png\";\nconst trgb = new TerrainRGB(url, 512);\n\nconst elevation = await trgb.getElevation([30.0529622, -1.9575129], 15);\nconsole.log(elevation);\n```\n\nTMS(Tile Map Service) tiles are also supported with\n\n```ts\nconst trgb = new TerrainRGB(url, 512, 5, 15, true);\n```\n\nIf it can't find tile, it will return 404 error.\n\nIf its terrain RGB tilesets was resampled by gdal2tiles, the result of elevation might not be the same with original DEM image.\n\nIf you want to use `terrarium` DEM, use `Terrarium` class as follows.\n\n```ts\nimport { Terrarium } from \"@watergis/terrain-rgb\";\n```\n\nboth `png` and `webp` formats are supported by the library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatergis%2Fterrain-rgb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatergis%2Fterrain-rgb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatergis%2Fterrain-rgb/lists"}