Closed manojkmohan closed 2 years ago
Accomplished with
const geo = require('./main.json');
const fs = require('fs');
console.log(`Loaded ${geo.features.length} features`)
for (const lsg of geo.features) {
const qid = lsg.properties.wikidata;
if (qid) {
console.log(`Writing ${qid}`)
fs.writeFileSync(`features/${qid}.geojson`, JSON.stringify(lsg))
} else {
console.log(`Skipping undefined`)
}
}
for file in features/*.geojson
do
echo "Converting $file"
if [ ! -f "output/${file%.geojson}.png" ]; then
timeout -v 10 geojson-renderer -c cache -d 300x150 -e -o "output/${file%.geojson}.png" -f png "$file"
sleep 1
fi
done
lsg shapes need to be Qid.png with a standard plain stype