This file contains 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
// BANO https://www.data.gouv.fr/fr/datasets/base-d-adresses-nationale-ouverte-bano/ | |
// Tested on the 5.086.571 objects available mid-September 2023 | |
type BanoCity = { | |
adm_weight: number | |
city: string | |
departement: string | |
id: string | |
importance: number | |
lat: number |
This file contains 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
/** | |
* Returns the distance in meter between 2 GPS coordinates | |
* @param {number} lat1 - Latitude of the first coordinate | |
* @param {number} lon1 - Longitude of the first coordinate | |
* @param {number} lat2 - Latitude of the second coordinate | |
* @param {number} lon2 - Longitude of the second coordinate | |
* @returns {number} The distance in meter (float) | |
*/ | |
function getDistanceFromGPS(lat1, lon1, lat2, lon2) { | |
if ( |