catchment-area
Version:
A utility for computing the catchment area of given source and destination points. A source may correspond to a health facility while the destinations (catchment areas) are the settlements served by the facility
33 lines (28 loc) • 1.2 kB
Markdown
`catchment-area` is a node library for generating catchment areas based on a set of sources and associated destinations. A use case for this library is generating catchment areas where the sources are health facilities and destinations are settlements.
`npm i catchment-area` or `yarn add catchment-area`
```javascript
import CatchmentAreaGenerator from 'catchment-area'
// const { CatchmentAreaGenerator } = require('catchment-area')
const configObject = {
"sources": [0, 1],
"destinations": [2, 3, 4, 5, 6],
"coordinates": [
[],
[],
[],
[],
[],
[],
[]
],
"profile":"car",
"drivetimes": [10] // in Minutes
}
const travelSpeed = 80 // in Kilometers per hour (km/hr)
const generator = new CatchmentAreaGenerator(configObject, travelSpeed)
const catchmentAreas = generator.run()
console.log(catchmentAreas)
```