Skip to content

Latest commit

 

History

History
43 lines (38 loc) · 1.32 KB

File metadata and controls

43 lines (38 loc) · 1.32 KB

Russ Vernick's Application Submission

Introduction

Here's a Typescript implementation of a floodzone analysis for parcels. The happy path takes the command line arguments into the parcelAnalysis library to:

  • Verify file
  • Read file
  • Parse Parcels and Floodzones
  • Iterate through Parcels searching for the riskiest
  • Output the risk level for the parcel if there is one

There are unit tests for most of the processes listed above as well an an end to end test. I had some difficulty getting lint working and abandoned the effort.

Building

npm install

Running

npx ts-node src/bin/runClassification.ts <DATA_FILE_PATH>

or

npm run analyze <DATA_FILE_PATH>

E.G

npx ts-node src/bin/runClassification data/case1.txt

Testing

npm test

Assumptions

  1. id is a number, could be a string
  2. Areas are boxes, allowing for a single value to represent: left, right, top, bottom. more complicated shapes would be best teased out

Follow Up

  1. copy/paste on parsing of Parcels and Floodzones might be better as a unified way of reading an area
  2. The processing is not completely separate from the processing. Wouldn't be too hard to split if a different sorting or multi-level analysis was desired.
  3. Was having trouble getting lint to work from the command line, so left it for now