mpa-reg-based-classification

1.0.1 • Public • Published

Javascript implementation of A regulation-based classification system for Marine Protected Areas.

CircleCI Unit Tests

Installation

npm install mpa-reg-based-classification

Usage

classifyZone(gearTypes: [String], aquacultureActivities: String, anchoringActivities: String)

You can pass the full description of activities from the publication verbatim but that will bind your application to an exact phrasing. The strings are long so this is both error prone and limits flexibility. Best to use the provided constants as a shorthand.

import {classifyZone, constants} from "mpa-reg-based-classification";

const gearTypes = constants.GEAR_TYPES;
const aquaculture = constants.AQUACULTURE_AND_BOTTOM_EXPLOITATION;
const anchoring = constants.BOATING_AND_ANCHORING;

const classification = classifyZone(
  [
    gearTypes.SPEARFISHING,
    gearTypes.LINES
  ],
  aquaculture.NOT_ALLOWED,
  anchoring.FULLY_REGULATED
);

console.log(classification);
>>> 4

classifyMPA([[gearTypes: [String], aquacultureActivities: String, anchoringActivities: String, area:number]])

classifyMPA accepts an array of the same arguments as classifyZone for multiple zones, with the addition of an area for each zone. Unit doesn't matter.

Readme

Keywords

Package Sidebar

Install

npm i mpa-reg-based-classification

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

23.1 kB

Total Files

11

Last publish

Collaborators

  • underbluewaters