mirror of
https://github.com/geohacker/bmtc.git
synced 2025-12-08 18:23:31 +00:00
12 lines
299 B
JavaScript
12 lines
299 B
JavaScript
var turf = require('turf');
|
|
var lines = require('../data/reach_lines.json');
|
|
|
|
lines.features.forEach(function (line) {
|
|
var length = turf.lineDistance(line, 'kilometers');
|
|
// console.log(line);
|
|
line.properties = {
|
|
'distance': length
|
|
};
|
|
});
|
|
|
|
console.log(JSON.stringify(lines)); |