Last active
October 24, 2023 19:16
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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