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

jsts

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsts

A JavaScript library of spatial predicates and functions for processing geometry

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
106K
decreased by-42.56%
Maintainers
1
Weekly downloads
 
Created

What is jsts?

The jsts (JavaScript Topology Suite) npm package is a JavaScript library for performing various geometric operations. It is a port of the well-known JTS Topology Suite, which is widely used in the GIS (Geographic Information Systems) community. The library provides a range of functionalities for creating, manipulating, and analyzing planar geometric objects.

What are jsts's main functionalities?

Geometry Creation

This feature allows you to create geometric objects from Well-Known Text (WKT) representations. In this example, a point geometry is created from a WKT string.

const jsts = require('jsts');
const reader = new jsts.io.WKTReader();
const point = reader.read('POINT (10 20)');
console.log(point);

Geometric Operations

This feature allows you to perform geometric operations such as union, intersection, and difference. In this example, the union operation is performed on two polygon geometries.

const jsts = require('jsts');
const reader = new jsts.io.WKTReader();
const geom1 = reader.read('POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))');
const geom2 = reader.read('POLYGON ((20 30, 35 35, 30 20, 20 30))');
const union = geom1.union(geom2);
console.log(union);

Spatial Analysis

This feature allows you to perform spatial analysis operations such as calculating distances between geometries. In this example, the distance between two point geometries is calculated.

const jsts = require('jsts');
const reader = new jsts.io.WKTReader();
const geom1 = reader.read('POINT (10 20)');
const geom2 = reader.read('POINT (30 40)');
const distance = geom1.distance(geom2);
console.log(distance);

Other packages similar to jsts

Keywords

FAQs

Package last updated on 15 Apr 2016

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