| Copyright | License : GPL-3 |
|---|---|
| Maintainer | hahn@geoinfo.tuwien.ac.at |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell98 |
RevGeocoder
Description
Requests the http://geocoder.opencagedata.com reverse geocoding service to transfer latitude and longitude values into an address.
- data QueryParameters = QueryParameters {}
- defaultParams :: QueryParameters
- type GeoCageDeveloperKey = Text
- type GeoCageLatitude = Double
- type GeoCageLongitude = Double
- reverseGeocode :: GeoCageLatitude -> GeoCageLongitude -> GeoCageDeveloperKey -> IO [Result]
- reverseGeocodeWith :: QueryParameters -> IO [Result]
- getReverseAPIResponse :: GeoCageLatitude -> GeoCageLongitude -> GeoCageDeveloperKey -> IO (Maybe ResponseBody)
- getReverseAPIResponseWith :: QueryParameters -> IO (Maybe ResponseBody)
- data ResponseBody = ResponseBody {}
- data Result = Result {
- bounds :: Bounds
- components :: Components
- confidence :: Integer
- formatted :: Text
- geometry :: Location
- data License = License {}
- data Rate = Rate {}
- data Status = Status {}
- data Timestamp = Timestamp {}
- data Components = Components {}
- data Location = Location {}
- data Bounds = Bounds {}
Documentation
data QueryParameters Source
data type including all possible parameters OpenCage API offers
Constructors
| QueryParameters | |
Fields
| |
Instances
defaultParams :: QueryParameters Source
minimal example of QueryParameters can be used to create your own parameters
type GeoCageDeveloperKey = Text Source
type GeoCageLatitude = Double Source
type GeoCageLongitude = Double Source
Arguments
| :: GeoCageLatitude | latitude value to reverse geocode |
| -> GeoCageLongitude | longitude value to reverse geocode |
| -> GeoCageDeveloperKey | OpenCage key |
| -> IO [Result] | list of results, empty if an error occured |
reverse geocode latitude and longitude, returns a list of Result values
Arguments
| :: QueryParameters | parameters for the request |
| -> IO [Result] | list of results, empty if an error occured |
reverse geocode passing all parameters via the QueryParameters type
Arguments
| :: GeoCageLatitude | latitude value to reverse geocode |
| -> GeoCageLongitude | longitude value to reverse geocode |
| -> GeoCageDeveloperKey | OpenCage key |
| -> IO (Maybe ResponseBody) | if successful Just a ResponseBody, otherwise Nothing |
reverse geocode latitude and longitude, returns the whole Response
getReverseAPIResponseWith Source
Arguments
| :: QueryParameters | parameters for the request |
| -> IO (Maybe ResponseBody) | if successful Just a ResponseBody, otherwise Nothing |
reverse geocode passing all parameters via the QueryParameters type
data ResponseBody Source
data type respecting OpenCage response encoded as JSON
Constructors
| ResponseBody | |
Instances
Constructors
| Result | |
Fields
| |
Constructors
| Timestamp | |
Fields
| |
data Components Source
Constructors
| Components | |
Instances
| Show Components | |
| Generic Components | |
| FromJSON Components | not all components are included into the response, if so there is an empty string as default value. |
| type Rep Components |