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

lineclip

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lineclip

A fast polyline and polygon clipping library.

  • 1.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
376K
increased by122.01%
Maintainers
1
Weekly downloads
 
Created

What is lineclip?

The lineclip npm package is a JavaScript library used for clipping lines and polygons to rectangular bounding boxes. It is useful in geographic information systems (GIS) and other applications where you need to clip geometries to a specific area.

What are lineclip's main functionalities?

Line Clipping

This feature allows you to clip a line to a rectangular bounding box. The code sample demonstrates how to clip a line that crosses the bounding box defined by the coordinates [-5, -5, 5, 5].

const lineclip = require('lineclip');
const line = [[-10, 10], [10, -10]];
const bbox = [-5, -5, 5, 5];
const clippedLine = lineclip(line, bbox);
console.log(clippedLine);

Polygon Clipping

This feature allows you to clip a polygon to a rectangular bounding box. The code sample demonstrates how to clip a polygon that extends beyond the bounding box defined by the coordinates [-5, -5, 5, 5].

const lineclip = require('lineclip');
const polygon = [[-10, 10], [10, 10], [10, -10], [-10, -10], [-10, 10]];
const bbox = [-5, -5, 5, 5];
const clippedPolygon = lineclip.polygon(polygon, bbox);
console.log(clippedPolygon);

Other packages similar to lineclip

Keywords

FAQs

Package last updated on 23 Sep 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