{"id":17218454,"url":"https://github.com/perliedman/node-hgt","last_synced_at":"2025-04-13T22:31:34.648Z","repository":{"id":29816586,"uuid":"33361051","full_name":"perliedman/node-hgt","owner":"perliedman","description":"Query hgt files (typically SRTM elevation data) with performance","archived":false,"fork":false,"pushed_at":"2020-05-25T04:08:52.000Z","size":989,"stargazers_count":45,"open_issues_count":12,"forks_count":20,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-09-17T05:10:03.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perliedman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-03T11:51:08.000Z","updated_at":"2024-05-30T13:25:43.000Z","dependencies_parsed_at":"2022-08-28T12:50:37.556Z","dependency_job_id":null,"html_url":"https://github.com/perliedman/node-hgt","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Fnode-hgt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Fnode-hgt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Fnode-hgt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Fnode-hgt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perliedman","download_url":"https://codeload.github.com/perliedman/node-hgt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219845248,"owners_count":16556449,"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":[],"created_at":"2024-10-15T03:46:52.115Z","updated_at":"2024-10-15T03:46:52.727Z","avatar_url":"https://github.com/perliedman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-hgt\n========\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/perliedman/node-hgt.svg)](https://greenkeeper.io/)\n\n[![npm version](https://img.shields.io/npm/v/node-hgt.svg)](https://www.npmjs.com/package/node-hgt) [![Build status](https://travis-ci.org/perliedman/node-hgt.svg?branch=master)](https://travis-ci.org/perliedman/node-hgt)\n\nRead and query HGT files, for example from SRTM, for elevation data with high performance.\nOptionally, this module can also use cached and automatically download HGT files as required.\n\nnode-hgt tries to be reasonably performant. A rough benchmark shows it can do 1.8M elevation calculations\nper second on my years old laptop.\n\n## Install\n\n```\nnpm install --save node-hgt\n```\n\n## Usage\n\nLoad and query a HGT file:\n\n```js\n    var hgt = new Hgt(__dirname + '/data/N57E011.hgt', [57, 11]);\n    \n    // Return elevation in meters above sea level.\n    // By default, elevation is interpolated bilinearly.\n    hgt.getElevation([57, 11])\n```\n\nUse a cache directory of HGT files for querying. Missing data will be downloaded\nusing the elevation data index from [imagico.de](http://www.imagico.de/map/demsearch.php),\nby default.\n\n```js\n    var tileset = new TileSet('./data/');\n    tileset.getElevation([57.7, 11.9], function(err, elevation) {\n        if (err) {\n            console.log('getElevation failed: ' + err.message);\n        } else {\n            console.log(elevation);\n        }\n    });\n```\n\nThere's also a synchronous tile set, if you know before hand which area you will query:\n\n```js\n    var tileset = new SyncTileSet('./data/', [57, 11], [58, 12], function(err) {\n        if (err) {\n            console.log(err);\n            return;\n        }\n\n        // All tiles are loaded (or downloaded, if they were not already on disk)\n        // and queries can be made synchronous.\n\n        var elevation = tileset.getElevation([57.7, 11.9]);\n        console.log(elevation);\n    });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperliedman%2Fnode-hgt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperliedman%2Fnode-hgt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperliedman%2Fnode-hgt/lists"}