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

@turf/distance

Package Overview
Dependencies
Maintainers
4
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/distance

turf distance module

  • 5.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.4M
decreased by-11.26%
Maintainers
4
Weekly downloads
 
Created

What is @turf/distance?

@turf/distance is a module of the Turf.js library, which provides geospatial analysis tools. This specific module calculates the distance between two geographical points using various measurement units such as miles, kilometers, and degrees.

What are @turf/distance's main functionalities?

Calculate Distance in Kilometers

This feature calculates the distance between two geographical points in kilometers. The 'from' and 'to' variables represent the coordinates of the two points.

const turf = require('@turf/distance');
const from = [0, 0];
const to = [1, 1];
const options = { units: 'kilometers' };
const distance = turf(from, to, options);
console.log(distance);

Calculate Distance in Miles

This feature calculates the distance between two geographical points in miles. The 'from' and 'to' variables represent the coordinates of the two points.

const turf = require('@turf/distance');
const from = [0, 0];
const to = [1, 1];
const options = { units: 'miles' };
const distance = turf(from, to, options);
console.log(distance);

Calculate Distance in Degrees

This feature calculates the distance between two geographical points in degrees. The 'from' and 'to' variables represent the coordinates of the two points.

const turf = require('@turf/distance');
const from = [0, 0];
const to = [1, 1];
const options = { units: 'degrees' };
const distance = turf(from, to, options);
console.log(distance);

Other packages similar to @turf/distance

Keywords

FAQs

Package last updated on 09 Nov 2017

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