1.0.7 • Published 1 year ago

@openscope-project/euroscope-sector-reader v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Euroscope Sector Reader

Updates

  • 04/24/2023

    • Add chinese gbk decoding support
  • 04/22/2023

    • Add symbReader
  • 04/21/2023

    • Fixed error when reading sectors from VATSIM UK DIVISION
    • Add rwyReader

Available Readers

sctReader

  • FUNCTION: sctReader(path, options);

  • PARAMS

    • path: path to the sct file you want to read.
    • options: convert option.
  • OPTIONS:

    • preProcessCoord

      valuedescription
      trueWill preprocess coordinate into number
      falseWon't preprocess coordinate into number
    • coordPreProcessType

      valuedescription
      defaultJust convert to number
      mercatorConvert to number, and mercatorize
      customConvert coordinate using custom function
      mercatorcustomConvert to number, and mercatorize, then convert using custom function
      nativemercatorConvert to number, and mercatorize using native c++ function
      nativedefaultJust convert to number, but using native c++ function
      nativemercatorcustomConvert to number, and mercatorize using native c++ function, then convert using custom function
    • preProcessDefinition

      valuedescription
      trueWill preprocess data
      falseWon't preprocess definition data
    • definitionPreProcessType

      valuedescription
      defaultpreprocess data into 16bit color value
      custompreprocess definition data using custom function
  • EXAMPLE

import {sctReader} from '@openscope-project/euroscope-sector-reader';
const fPath = "some/existing/path/to/sctFile.sct";
sctReader(fPath, {
    preProcessCoord: true,
    coordPreProcessType: 'default'
}).then(sctObject => {
    // Your operation to the object
    console.log(Object.entries(sctObject));
});

eseReader

  • FUNCTION: eseReader(path, options);

  • PARAMS

    • path: path to the ese file you want to read.
    • options: convert option.
  • OPTIONS:

    • preProcessCoord

      valuedescription
      trueWill preprocess coordinate into number
      falseWon't preprocess coordinate into number
    • coordPreProcessType

      valuedescription
      defaultJust convert to number
      mercatorConvert to number, and mercatorize
      customConvert coordinate using custom function
      mercatorcustomConvert to number, and mercatorize, then convert using custom function
      nativemercatorConvert to number, and mercatorize using native c++ function
      nativedefaultJust convert to number, but using native c++ function
      nativemercatorcustomConvert to number, and mercatorize using native c++ function, then convert using custom function
  • EXAMPLE

import {eseReader} from '@openscope-project/euroscope-sector-reader';
const fPath = "some/existing/path/to/eseFile.ese";
eseReader(fPath, {
    preProcessCoord: true,
    coordPreProcessType: 'default'
}).then(eseObject => {
    // Your operation to the object
    console.log(Object.entries(eseObject));
});

prfReader

  • FUNCTION: prfReader(path);

  • PARAMS

    • path: path to the prf file you want to read.
  • EXAMPLE

prfReader('path/to/something').then(value=>{console.log(value)});

asrReader

  • FUNCTION: asrReader(path);

  • PARAMS

    • path: path to the asr file you want to read.
  • EXAMPLE

asrReader('path/to/something').then(value=>{console.log(value)});

rwyReader

  • FUNCTION: rwyReader(path);

  • PARAMS

    • path: path to the asr file you want to read.
  • EXAMPLE

rwyReader(path.join(__dirname, 'path/to/something)')).then(value=>{
    console.log(value);
});

symbReader

  • FUNCTION: symbReader(path, options);

  • PARAMS

    • path: path to the sct file you want to read.
    • options: convert option.
  • OPTIONS:

    • preProcessColor

      valuedescription
      trueWill preprocess data
      falseWon't preprocess color data
    • colorPreProcessType

      valuedescription
      defaultpreprocess data into 16bit color value
      custompreprocess definition data using custom function
  • EXAMPLE

import {symbReader} from '@openscope-project/euroscope-sector-reader';
const fPath = "some/existing/path/to/symbolFile.txt";
sctReader(fPath, {
    preProcessColor: true,
    coordPreProcessType: 'custom',
    customColorPreProcessCallback: (input) =>{
      return '0';
    }
}).then(obj => {
    // Your operation to the object
    console.log(Object.entries(obj));
});
1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago