Initial mock-up cache tool

This commit is contained in:
2026-08-09 13:17:23 -04:00
commit 184f135779
7 changed files with 317 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
// Copyright (c) 2026 Elizabeth Cray
const fs = require('fs');
require('dotenv').config();
const osmData = JSON.parse(fs.readFileSync('osm_data.json', 'utf8'));
const geoJsonTemplate = {
type: "FeatureCollection",
features: [],
};
if (osmData && osmData.elements && osmData.elements.length > 0) {
osmData.elements.forEach(element => {
if (element.type === 'node' && element.lat && element.lon) {
geoJsonTemplate.features.push({
type: "Feature",
geometry: {
type: "Point",
coordinates: [element.lon, element.lat],
},
properties: element.tags || {},
});
}
});
fs.writeFileSync('osm_data.geojson', JSON.stringify(geoJsonTemplate, null, 2));
}