portree_kid 4 years ago
parent 3ecace714e
commit 30d6bce2d8

@ -274,19 +274,23 @@ module.exports.readPavement = function (f, icao, cb) {
lineReader.createInterface({ lineReader.createInterface({
input: fs.createReadStream(f).pipe(zlib.createGunzip()) input: fs.createReadStream(f).pipe(zlib.createGunzip())
}).on('line', function (line) { }).on('line', function (line) {
var fields = line.split(/[ ]+/); try {
// var fields = line.match('([0-9]+)'); var fields = line.split(/[ ]+/);
if (fields == null) // var fields = line.match('([0-9]+)');
return; if (fields == null)
var scanMethod = scanMethods[fields[0]]; return;
if (scanMethod != null) { var scanMethod = scanMethods[fields[0]];
currentFeature = scanMethod(fields, icao, pavementLayerGroup, currentFeature); if (scanMethod != null) {
} currentFeature = scanMethod(fields, icao, pavementLayerGroup, currentFeature);
else {
if (fields[0] == '99') {
lineReader.close();
} }
// console.log('Ignored:', line); else {
if (fields[0] == '99') {
lineReader.close();
}
// console.log('Ignored:', line);
}
} catch (error) {
console.error('Error reading : ' + line + error);
} }
}).on('error', function (err) { }).on('error', function (err) {
console.error(err); console.error(err);

Loading…
Cancel
Save