Created
March 28, 2023 07:23
-
-
Save glaforge/4176e0ad13b396001c92ab5cd584b3d8 to your computer and use it in GitHub Desktop.
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
@Grab("com.google.openlocationcode:openlocationcode:1.0.4") | |
import com.google.openlocationcode.OpenLocationCode | |
// Eiffel Tower | |
def (lat, lon) = [48.8584, 2.29447] | |
def eiffelTowerPlusCode = OpenLocationCode.encode(lat, lon) | |
println "Eiffel Tower +code: ${eiffelTowerPlusCode}" | |
def decoded = OpenLocationCode.decode('8FW4V75V+9Q') | |
println "Original coord: ${decoded.centerLatitude}, ${decoded.centerLongitude}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment