You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

lineclip

Package Overview
Dependencies
Maintainers
28
Versions
8
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.

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
228K
-15.08%
Maintainers
28
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

algorithm

FAQs

Package last updated on 16 Jul 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.