dot-density
Input population regions (geojson polygons), output dot-density (geojson points)
Last updated 5 years ago by anandthakker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install dot-density 
SYNC missed versions from official npm registry.

js-standard-style

Install

npm install -g dot-density for CLI or npm install --save dot-density for use as library.

CLI

cat someCensusData.geojson | dot-density --population POP10 --sampleRate 0.1

API

FeaturePopulationCallback

Parameters

  • feature Feature A geojson feature

Returns Number The feature's population

index

Produce dot density from population polygons

Parameters

  • data Feature or FeatureCollection an input
  • options object
    • options.population String or FeaturePopulationCallback the property key or accessor function providing each feature's population.
    • options.sampleRate [number] Number of dots per person (optional, default 1)
    • options.stochastic [boolean] If true, then use a weighted dice roll to decide wwhether to add a point when population * sampleRate yields a fractional value. (optional, default false)

Examples

var dots = require('dot-density')
var points = dots(featureCollection, { population: 'POP10' })
console.log(points) // array of Point features

Returns FeatureCollection A dot density FeatureCollection

Current Tags

  • 1.1.1                                ...           latest (5 years ago)

4 Versions

  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |