Gathering detailed insights and metrics for @turf/turf
Gathering detailed insights and metrics for @turf/turf
Gathering detailed insights and metrics for @turf/turf
Gathering detailed insights and metrics for @turf/turf
A modular geospatial engine written in JavaScript and TypeScript
npm install @turf/turf
Typescript
Module System
Node Version
NPM Version
71.6
Supply Chain
78.9
Quality
87.5
Maintenance
100
Vulnerability
97
License
Total
61,120,328
Last Day
18,759
Last Week
813,245
Last Month
3,176,602
Last Year
23,565,195
9,412 Stars
3,683 Commits
944 Forks
181 Watching
46 Branches
161 Contributors
Updated on 07 Dec 2024
Minified
Minified + Gzipped
TypeScript (86.68%)
JavaScript (13.31%)
Shell (0.01%)
Cumulative downloads
Total Downloads
Last day
14.8%
18,759
Compared to previous day
Last week
30.5%
813,245
Compared to previous week
Last month
0.1%
3,176,602
Compared to previous month
Last year
53.8%
23,565,195
Compared to previous year
114
A modular geospatial engine written in JavaScript
Turf is a JavaScript library for spatial analysis. It includes traditional spatial operations, helper functions for creating GeoJSON data, and data classification and statistics tools. Turf can be added to your website as a client-side plugin, or you can run Turf server-side with Node.js (see below).
1# get all of turf 2npm install @turf/turf 3 4# or get individual packages 5npm install @turf/helpers 6npm install @turf/buffer
Download the minified file, and include it in a script tag. This will expose a global variable named turf
.
1<script src="turf.min.js" charset="utf-8"></script>
You can also include it directly from a CDN:
1<script src="https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js"></script>
TypeScript definitions are packaged with each module. No DefinitelyTyped packages required.
Ports of Turf.js are available in:
Turf for Swift is experimental and its public API is subject to change. Please use with care.
The Turf for Dart port is still in progress, the implementation status can be found in the README.
Turf uses GeoJSON for all geographic data. Turf expects the data to be standard WGS84 longitude, latitude coordinates. Check out geojson.io for a tool to easily create this data.
NOTE: Turf expects data in (longitude, latitude) order per the GeoJSON standard.
Most Turf functions work with GeoJSON features. These are pieces of data that represent a collection of properties (ie: population, elevation, zipcode, etc.) along with a geometry. GeoJSON has several geometry types such as:
Turf provides a few geometry functions of its own. These are nothing more than simple (and optional) wrappers that output plain old GeoJSON. For example, these two methods of creating a point are functionally equivalent:
1// Note order: longitude, latitude. 2var point1 = turf.point([-73.988214, 40.749128]); 3 4var point2 = { 5 type: 'Feature', 6 geometry: { 7 type: 'Point', 8 // Note order: longitude, latitude. 9 coordinates: [-73.988214, 40.749128] 10 }, 11 properties: {} 12};
Turf packages are compiled to target ES2017. However, the browser version of @turf/turf is transpiled to also include support for IE11. If you are using these packages and need to target IE11, please transpile the following packages as part of your build:
@turf/*
robust-predicates
rbush
tinyqueue
This project exists thanks to all the people who contribute. If you are interested in helping, check out the Contributing Guide.
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
No vulnerabilities found.
Reason
12 commit(s) and 18 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
project is fuzzed
Details
Reason
Found 28/29 approved changesets -- score normalized to 9
Reason
6 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-02
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More