{"id":15204124,"url":"https://github.com/maptiler/dem-elevation-profiler","last_synced_at":"2025-10-02T21:30:39.609Z","repository":{"id":197610674,"uuid":"699012873","full_name":"maptiler/dem-elevation-profiler","owner":"maptiler","description":"Convert a geojson LineString to a elevation profile.","archived":true,"fork":false,"pushed_at":"2023-10-10T15:38:10.000Z","size":1353,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-12-22T11:40:42.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/maptiler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-01T17:01:56.000Z","updated_at":"2024-06-18T16:16:52.000Z","dependencies_parsed_at":"2023-10-01T18:46:08.003Z","dependency_job_id":null,"html_url":"https://github.com/maptiler/dem-elevation-profiler","commit_stats":null,"previous_names":["maptiler/dem-elevation-profiler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fdem-elevation-profiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fdem-elevation-profiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fdem-elevation-profiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptiler%2Fdem-elevation-profiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maptiler","download_url":"https://codeload.github.com/maptiler/dem-elevation-profiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235043602,"owners_count":18927006,"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-09-28T05:21:42.715Z","updated_at":"2025-10-02T21:30:39.208Z","avatar_url":"https://github.com/maptiler.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dem-elevation-profiler\n\n## About\n\nConvert a geojson LineString to a elevation profile.\n\n## Install\n\n```bash\n# NPM\nnpm install dem-elevation-profiler\n# PNPM\npnpm add dem-elevation-profiler\n# Yarn\nyarn add dem-elevation-profiler\n# Bun\nbun add dem-elevation-profiler\n```\n\n## Usage\n\n```ts\nimport profile from 'dem-elevation-profiler'\n// if nodejs or bun the tileRequest can be local using sharp\nimport sharp from 'sharp'\n\n// create a geojson LineString\nconst path = {\n  type: 'Feature' as const,\n  properties: {},\n  geometry: {\n    type: 'LineString' as const,\n    coordinates: GeoJSON.Position[] = [...]\n  }\n}\n// OR create the LineString geometry directly\nconst path = {\n  type: 'LineString' as const,\n  coordinates: GeoJSON.Position[] = [...]\n}\n\n// build the options\nconst options = {\n  metric: 'm' as 'm' | 'ft',\n  zoom: 13,\n  tileSize: 512,\n  tileRequest: async (x: number, y: number, z: number) =\u003e {\n  const buf = await sharp(`test/fixtures/${z}-${x}-${y}.webp`)\n      .raw()\n      .toBuffer({ resolveWithObject: true })\n    return {\n      channels: buf.info.channels,\n      image: new Uint8ClampedArray(buf.data)\n    }\n  },\n  elevationParser: (r: number, g: number, b: number, _a: number) =\u003e {\n    return -10000 + ((r * 256 * 256 + g * 256 + b) * 0.1)\n  }\n}\n\n// profile the geometry\nawait profile(path, options)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptiler%2Fdem-elevation-profiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaptiler%2Fdem-elevation-profiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptiler%2Fdem-elevation-profiler/lists"}