Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
turf count module
turf.count(polygons, points, countField)
Takes a FeatureCollection of Point features and a FeatureCollection of Polygon features and calculates the number of points that fall within the set of polygons.
parameter | type | description |
---|---|---|
polygons | FeatureCollection | a FeatureCollection of Polygon features |
points | FeatureCollection | a FeatureCollection of Point features |
countField | String | a field to append to the attributes of the Polygon features representing Point counts |
var polygons = turf.featurecollection([
turf.polygon([[
[-112.072391,46.586591],
[-112.072391,46.61761],
[-112.028102,46.61761],
[-112.028102,46.586591],
[-112.072391,46.586591]
]]),
turf.polygon([[
[-112.023983,46.570426],
[-112.023983,46.615016],
[-111.966133,46.615016],
[-111.966133,46.570426],
[-112.023983,46.570426]
]])
]);
var points = turf.featurecollection([
turf.point([-112.0372, 46.608058], {population: 200}),
turf.point([-112.045955, 46.596264],
{population: 600})
]);
var counted = turf.count(polygons, points, 'pt_count');
var result = turf.featurecollection(
points.features.concat(counted.features));
//=result
Requires nodejs.
$ npm install turf-count
$ npm test
FAQs
turf count module
The npm package turf-count receives a total of 65 weekly downloads. As such, turf-count popularity was classified as not popular.
We found that turf-count demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.