npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@turf/quadrat-analysis

v7.3.4

Published

Quadrat analysis lays a set of equal-size areas(quadrat) over the study area and counts the number of features in each quadrat and creates a frequency table.

Downloads

2,395,818

Readme

@turf/quadrat-analysis

quadratAnalysis

Quadrat analysis lays a set of equal-size areas(quadrat) over the study area and counts the number of features in each quadrat and creates a frequency table. The table lists the number of quadrats containing no features, the number containing one feature, two features, and so on, all the way up to the quadrat containing the most features. The method then creates the frequency table for the random distribution, usually based on a Poisson distribution. The method uses the distribution to calculate the probability for 0 feature occuring, 1 feature occuring, 2 features, and so on, and lists these probabilities in the frequency table. By comparing the two frequency tables, you can see whether the features create a pattern. If the table for the observed distribution has more quadrats containing many features than the table for the random distribution dose, then the features create a clustered pattern.

It is hard to judge the frequency tables are similar or different just by looking at them. So, we can use serval statistical tests to find out how much the frequency tables differ. We use Kolmogorov-Smirnov test.This method calculates cumulative probabilities for both distributions, and then compares the cumulative probabilities at each class level and selects the largest absolute difference D. Then, the test compares D to the critical value for a confidence level you specify. If D is greater than the critical value, the difference between the observed distribution and the random distribution is significant. The greater the value the bigger the difference.

Traditionally, squares are used for the shape of the quadrats, in a regular grid(square-grid). Some researchers suggest that the quadrat size equal twice the size of mean area per feature, which is simply the area of the study area divided by the number of features.

Parameters

  • pointFeatureSet FeatureCollection<Point> point set to study

  • options Object optional parameters (optional, default {})

    • options.studyBbox [number, number, number, number]? bbox representing the study area
    • options.confidenceLevel (20 | 15 | 10 | 5 | 2 | 1) a confidence level. The unit is percentage . 5 means 95%, value must be in K_TABLE (optional, default 20)

Examples

var bbox = [-65, 40, -63, 42];
var dataset = turf.randomPoint(100, { bbox: bbox });
var result = turf.quadratAnalysis(dataset);

Returns QuadratAnalysisResult result

K_TABLE

the confidence level

Type: Object

Properties

QuadratAnalysisResult

the return type of the quadratAnalysis

Type: object

Properties

  • criticalValue number
  • maxAbsoluteDifference number
  • isRandom boolean
  • observedDistribution Array<number> the cumulative distribution of observed features, the index represents the number of features in the quadrat.

This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.

Installation

Install this single module individually:

$ npm install @turf/quadrat-analysis

Or install the all-encompassing @turf/turf module that includes all modules as functions:

$ npm install @turf/turf