Security News
UK Officials Consider Banning Ransomware Payments from Public Entities
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
simplify-geojson
Advanced tools
Apply Ramer-Douglas-Peucker line simplification to GeoJSON features or feature collections in JS or on the CLI
Apply Ramer–Douglas–Peucker line simplification to GeoJSON features or feature collections in JS or on the CLI.
This module uses https://github.com/seabre/simplify-geometry for the simplification and wraps it in a interface for easily simplifying GeoJSON.
npm install simplify-geojson
cat data.geojson | simplify-geojson -t 0.01
Tolerance is specified by either -t
or --tolerance
and is a number in degrees (e.g. lat/lon distance). 1 degree is roughly equivalent to 69 miles. the default is 0.001, which is around a city block long.
var simplify = require('simplify-geojson')
var simplified = simplify(geojson, tolerance)
geojson
can be any of the following:
All segments in any of the supported types will be simplified (including holes in polygons, for instance).
Convert a CSV with lat/lon columns into geojson, then simplify that geojson, then open it in geojson.io (CSV is from my GPS logger and was my bike commute this morning):
npm install simplify-geojson geojsonio-cli csv2geojson -g
curl https://raw.github.com/maxogden/simplify-geojson/master/test-data/oakland-route.csv | \
csv2geojson --lat "LATITUDE N/S" --lon "LONGITUDE E/W" --line true | \
simplify-geojson -t 0.001 | \
geojsonio
Simplify alaska's border outline and count the number of lines of the simplified geojson output (tweak -t
to see how it affects length):
curl https://rawgit.com/johan/world.geo.json/master/countries/USA/AK.geo.json | \
simplify-geojson -t 0.01 | \
wc -l
Contributors welcome! Please read the contributing guidelines before getting started.
FAQs
Apply Ramer-Douglas-Peucker line simplification to GeoJSON features or feature collections in JS or on the CLI
The npm package simplify-geojson receives a total of 6,441 weekly downloads. As such, simplify-geojson popularity was classified as popular.
We found that simplify-geojson demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.