catchment-area
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.
Installation
npm i catchment-area
or yarn add catchment-area
Usage
// const { CatchmentAreaGenerator } = require('catchment-area') const configObject = "sources": 0 1 "destinations": 2 3 4 5 6 "coordinates": 8521614074707031 12041335177559377 8546504974365234 11986935141127049 8402481079101562 11965776606631184 8450889587402344 12078938641761814 8558778762817383 11999024987663574 8549938201904297 12007420395469195 8554229736328125 11956876093184725 "profile":"car" "drivetimes": 10 // in Minutesconst travelSpeed = 80 // in Kilometers per hour (km/hr) const generator = configObject travelSpeedconst catchmentAreas = generator console