@atmosx/placefile-parser
v2.0.1
Published
WX Placefile Parser and Creation - Built for standalone and Project AtmosphericX Integration.
Downloads
126
Maintainers
Readme
Installation (NPM)
npm install @atmosx/placefile-parserExample Usage
const { PlacefileManager } = require('@atmosx/placefile-parser'); // CJS
import { PlacefileManager } from '@atmosx/placefile-parser'; // ESM
const sample = fs.readFileSync("test", "utf-8"); // For testing...
// Parsing a basic placefile
PlacefileManager.parsePlacefile(sample).then((objects) => {
console.log("Parsed Objects:", objects);
})
// Parsing a table
PlacefileManager.parseTable(sample).then((table) => {
console.log("Parsed Table:", table);
})
// Parsing GeoJSON
PlacefileManager.parseGeoJSON(sample).then((geojson) => {
console.log("Parsed GeoJSON:", geojson);
})
// Creating a placefile
PlacefileManager.createPlacefile({
refresh: 60,
threshold: 50,
title: "Sample Placefile",
settings: "ShowLabels, ShowIcons",
type: "Point",
objects: [
{
coordinates: [34.0522, -118.2437],
label: "Los Angeles",
color: "255 0 0",
},
{
coordinates: [40.7128, -74.0060],
label: "New York",
color: "0 0 255",
}
]
}).then((placefile) => {
console.log("Generated Placefile:\n", placefile);
});References
Documentation |
Discord Server |
Project Board |
Code of Conduct |
Contributing |
License |
Security |
Changelogs |
Acknowledgements
- k3yomi
- Lead developer @ AtmosphericX and maintainer of this module.
- StarflightWx
- For testing and providing feedback (Co-Developer and Spotter @ AtmosphericX)
