GeocoderOpenCage-0.1: Geocoder and Reverse Geocoding Service Wrapper

CopyrightLicense : GPL-3
Maintainerhahn@geoinfo.tuwien.ac.at
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

RevGeocoder

Description

Requests the http://geocoder.opencagedata.com reverse geocoding service to transfer latitude and longitude values into an address.

Synopsis

Documentation

data QueryParameters Source

data type including all possible parameters OpenCage API offers

Constructors

QueryParameters 

Fields

para_latitude :: Double

latitude value to reverse geocode

para_longitude :: Double

longitude value to reverse geocode

para_key :: Text

OpenCage key

para_language :: Maybe Text

language for the result: IETF format language code

para_pretty :: Maybe Text

should the result be pretty printed ?

para_jsonp :: Maybe Text

should the result be included into a JSON function ?

defaultParams :: QueryParameters Source

minimal example of QueryParameters can be used to create your own parameters

reverseGeocode 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

reverseGeocodeWith Source

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

getReverseAPIResponse Source

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

data License Source

Constructors

License 

Fields

name :: Text
 
url :: Text
 

data Rate Source

Constructors

Rate 

Instances

data Status Source

Constructors

Status 

Fields

code :: Integer
 
message :: Text
 

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 

data Location Source

Constructors

Location 

Fields

lat :: Double
 
lng :: Double