Socket
Socket
Sign inDemoInstall

@turf/line-slice-along

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/line-slice-along

turf line-slice-along module


Version published
Weekly downloads
480K
increased by5.52%
Maintainers
4
Weekly downloads
 
Created

What is @turf/line-slice-along?

@turf/line-slice-along is a module from the Turf.js library that allows you to slice a line segment from a given GeoJSON LineString based on start and stop distances along the line. This is useful for various geospatial operations where you need to extract a specific segment of a line based on distance measurements.

What are @turf/line-slice-along's main functionalities?

Slice a LineString

This feature allows you to slice a segment from a LineString based on start and stop distances. The code sample demonstrates how to use the `lineSliceAlong` function to extract a segment from a given LineString.

const turf = require('@turf/turf');

const line = turf.lineString([
  [-77.031669, 38.878605],
  [-77.029609, 38.881946],
  [-77.020339, 38.884084],
  [-77.025661, 38.885821],
  [-77.021884, 38.889563],
  [-77.019824, 38.892368]
]);

const start = 0.5; // start distance in kilometers
const stop = 2.5; // stop distance in kilometers

const slicedLine = turf.lineSliceAlong(line, start, stop);
console.log(JSON.stringify(slicedLine));

Other packages similar to @turf/line-slice-along

Keywords

FAQs

Package last updated on 30 Jun 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