Gathering detailed insights and metrics for simplify-geojson-visvalingam
Gathering detailed insights and metrics for simplify-geojson-visvalingam
Gathering detailed insights and metrics for simplify-geojson-visvalingam
Gathering detailed insights and metrics for simplify-geojson-visvalingam
Takes a GeoJSON object and returns a simplified version. Uses the Visvalingam–Wyatt algorithm with additional logic for stable simplification and preservation of common boundaries.
npm install simplify-geojson-visvalingam
Typescript
Module System
Node Version
NPM Version
66.7
Supply Chain
99.2
Quality
81
Maintenance
100
Vulnerability
100
License
TypeScript (96.81%)
Python (2.11%)
JavaScript (1.08%)
Built with Next.js • Fully responsive • SEO optimized • Open source ready
Total Downloads
607
Last Day
5
Last Week
6
Last Month
29
Last Year
607
MIT License
17 Stars
32 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Jun 18, 2025
Latest Version
1.3.4
Package Id
simplify-geojson-visvalingam@1.3.4
Unpacked Size
75.94 kB
Size
11.97 kB
File Count
9
NPM Version
11.3.0
Node Version
22.14.0
Published on
May 12, 2025
Cumulative downloads
Total Downloads
Last Day
0%
5
Compared to previous day
Last Week
500%
6
Compared to previous week
Last Month
-57.4%
29
Compared to previous month
Last Year
0%
607
Compared to previous year
Takes a GeoJSON object and returns a simplified version. Uses the Visvalingam–Wyatt algorithm with additional logic for stable simplification and preservation of common boundaries.
npm i --save simplify-geojson-visvalingam
geojson
GeoJSON object to be simplified, should extends GeoJsonObject in TypeScript
options
Object Optional parameters (optional, default {}
), should be of type SimplifyOptions in TypeScript
options.tolerance
number simplification tolerance, the minimum Cartesian area of a triangle formed by a point and its two neighbors to preserve that point (optional, default 0
)options.fraction
number the fraction of all points to be removed (optional, default 0
)options.mutate
boolean allows GeoJSON input to be mutated (optional, default true
)
tolerance
andfraction
can be used together to make the simplification satisfy both options, but if neither is provided, thegeojson
will remain unsimplified
Feature
objects even if all their geometry will be removed, the GeoJSON structure will remain intactLineString
objects will never be removed1import simplify from 'simplify-geojson-visvalingam' 2 3// CommonJS 4// const simplify = require('simplify-geojson-visvalingam').default 5 6const geojson = { 7 "type": "Polygon", 8 "coordinates": [ 9 [ 10 [-70.603637, -33.399918], 11 [-70.614624, -33.395332], 12 [-70.639343, -33.392466], 13 [-70.659942, -33.394759], 14 [-70.683975, -33.404504], 15 [-70.697021, -33.419406], 16 [-70.701141, -33.434306], 17 [-70.700454, -33.446339], 18 [-70.694274, -33.458369], 19 [-70.682601, -33.465816], 20 [-70.668869, -33.472117], 21 [-70.646209, -33.473835], 22 [-70.624923, -33.472117], 23 [-70.609817, -33.468107], 24 [-70.595397, -33.458369], 25 [-70.587158, -33.442901], 26 [-70.587158, -33.426283], 27 [-70.590591, -33.414248], 28 [-70.594711, -33.406224], 29 [-70.603637, -33.399918] 30 ] 31 ] 32} 33const options = { 34 tolerance: 0.00008, // remove all points that form a triangle with a smaller Cartesian area 35} 36const result = simplify(geojson, options)
1import { type Polygon } from 'geojson' 2import simplify, { type SimplifyOptions } from 'simplify-geojson-visvalingam' 3 4const geojson: Polygon = { 5 "type": "Polygon", 6 "coordinates": [ 7 [ 8 [-70.603637, -33.399918], 9 [-70.614624, -33.395332], 10 [-70.639343, -33.392466], 11 [-70.659942, -33.394759], 12 [-70.683975, -33.404504], 13 [-70.697021, -33.419406], 14 [-70.701141, -33.434306], 15 [-70.700454, -33.446339], 16 [-70.694274, -33.458369], 17 [-70.682601, -33.465816], 18 [-70.668869, -33.472117], 19 [-70.646209, -33.473835], 20 [-70.624923, -33.472117], 21 [-70.609817, -33.468107], 22 [-70.595397, -33.458369], 23 [-70.587158, -33.442901], 24 [-70.587158, -33.426283], 25 [-70.590591, -33.414248], 26 [-70.594711, -33.406224], 27 [-70.603637, -33.399918] 28 ] 29 ] 30} 31const options: SimplifyOptions = { 32 fraction: 0.5, // remove 50% of all points 33} 34const result = simplify(geojson, options)
No vulnerabilities found.