Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@turf/quadrat-analysis
Advanced tools
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.
pointFeatureSet
FeatureCollection<Point> point set to study
options
Object optional parameters (optional, default {}
)
var bbox = [-65, 40, -63, 42];
var dataset = turf.randomPoint(100, { bbox: bbox });
var result = turf.quadratAnalysis(dataset);
Returns Object result QuadratAnalysisResult
the confidence level
Type: Object
the return type of the quadratAnalysis
Type: Object
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.
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
FAQs
turf quadrat-analysis module
We found that @turf/quadrat-analysis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.