anyboxer

npm routeboxer

Usage no npm install needed!

<script type="module">
  import anyboxer from 'https://cdn.skypack.dev/anyboxer';
</script>

README

anyboxer

server-side routeboxer

Installation

npm install anyboxer --save

Usage

var anyBoxer = require('anyboxer');

var options = {
    split: false,
    reverse: true
}

anyBoxer(data, options, function(err, boxes) {
    //
});

Where data has a FeatureCollection format.

If split is true the result will be divided. Default split is false.

If reverse is true then each [lat, lon] coordinates will become [lon, lat].

data example

var data = { 
    "type": "FeatureCollection",
    "features": [
        {
           "type": "Feature",
           "geometry": {
               "type": "LineString",
               "coordinates": [ [0,0], [1,1] ] // [ [lat, lon], [lat, lon] ]
           },
           "properties": {
              "fat": 5
           }
        },
    ]
};

License

MIT