Copyright | (c) Marco Zocca 2018 |
---|---|
License | GPL-3 |
Maintainer | zocca.marco gmail |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Geocoding
:: Text | API key (available for free on https://developer.mapquest.com) |
-> GeoQuery | Query address |
-> IO (Maybe (Coords Float)) |
Call the MapQuest Geocoding API with a given address and extract the coordinates from the parsed result.
Example usage : assuming the user has bound key to hold the API key string, the following can be run in a GHCi shell :
>>>
request key (GQ "Via Irnerio" "Bologna" "Italy")
Just (Coords {lat = 44.49897, long = 11.34503})
>>>
request key (GQFree "Hong Kong")
Just (Coords {lat = 22.264412, long = 114.16706})