test = function(){
let index = []
longLines.forEach(function(r){
let crosses = longLines.filter(m => turf.booleanCrosses(m, r))
if (crosses.length == 0){
r.properties.length = turf.length(r)
index.push(r)
} else {
let feat = crosses.map(s => turf.lineSplit(r,s))
let t = feat.map(f => f.features.map((m) => {
m.properties.id = r.properties.id;
m.properties.name = r.properties.name;
m.properties.length = turf.length(m);
return m })).flat()
index.push(t)
}
})
return index.flat().sort((a,b) => {return turf.length(a) - turf.length(b)}).reverse()}();