Skip to content

Instantly share code, notes, and snippets.

@bplaat
Last active October 24, 2023 19:16
Show Gist options
  • Save bplaat/60e0ff3462798607b337ab07292c0b76 to your computer and use it in GitHub Desktop.
Save bplaat/60e0ff3462798607b337ab07292c0b76 to your computer and use it in GitHub Desktop.
Node.js script to convert Google Maps Saved Places to SerenityOS Maps Favorite format
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('Saved Places.json').toString());
const favorites = data.features
.filter(place => place.geometry.coordinates[0] != 0 && place.geometry.coordinates[1] != 0)
.map(place => {
return {
name: place.properties.location.name,
latitude: place.geometry.coordinates[1],
longitude: place.geometry.coordinates[0],
zoom: 17
};
});
fs.writeFileSync('MapsFavorites.json', JSON.stringify(favorites, undefined, 4));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment