Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

geojson-elevation

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geojson-elevation

Add elevation data to GeoJSON objects

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

GeoJSON Elevation

npm version

Add juicy elevation data to your fresh GeoJSON.

Install

npm install --save geojson-elevation

Use

The module exports a single function, addElevation:

addElevation(geojson, elevationProvider, cb)

Where

  • geojson is the GeoJSON object to add elevation data to
  • elevationProvider is an object with the method getElevation(latLng, cb) - typically, you pass a TileSet instance from node-hgt
  • cb is a callback that is called when the elevation data has been added (or an error occurs), the callback should take to args: err (undefined if the operation succeeds) and geojson, which is the GeoJSON instance that was passed to the function

Example:

var addElevation = require('geojson-elevation').addElevation,
    TileSet = require('node-hgt').TileSet;

addElevation(geojson, new TileSet('./data'), function(err) {
    if (!err) {
        console.log(JSON.stringify(geojson));
    } else {
        console.log(err);
    }
});

Keywords

FAQs

Package last updated on 08 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc