geo-resolver-0.1.0.1: Performs geo location lookups and parses the results

Copyright(c) 2015, Markenwerk, Jan Greve
LicenseMIT
Maintainerjg@markenwerk.net
Safe HaskellNone
LanguageHaskell2010

Network.Google.GeoResolver

Contents

Description

This is supposed to offer an easy to use abstraction of the google geocoding web service.

A minimum example of usage (with OverloadedStrings) is:

import GeoRequester
main = geoRequest "Lornsenstraße 43, Kiel" >>= putStrLn . show

While there are convenience functions for the most common use cases, there are means to send arbitrary requests.

If you do so, please see Geocoder.Parser for ways to access the results. As a hint, GoogleAnswer is instance of Foldable and Functor.

Please note that this Package is also meant to demonstrate basic Haskell features and thus not always takes the most elegant way but the most educational way.

Synopsis

Encoding

geoEncode Source

Arguments

:: Maybe String

Optional API key to use if you intend to go over the courtesy limit Google imposes

-> String

The address to be looked up.

-> IO (Either String (Double, Double))

Either an error message or the result.

Encodes a given address into a coordinate.

geoEncodeLanguage Source

Arguments

:: Maybe String

Optional API key to use if you intend to go over the courtesy limit Google imposes

-> String

The address to be looked up.

-> String

Language to be used. cf. https://developers.google.com/maps/faq#languagesupport

-> IO (Either String (Double, Double))

Either an error message or the result.

Encodes a given address into a coordinate.

Decoding

geoDecode Source

Arguments

:: Maybe String

Optional API key to use if you intend to go over the courtesy limit Google imposes

-> (Double, Double)

coordinate to be decoded

-> IO (Either String String)

Either an error message (Left) or the result (Right).

Reverse geocoding of a given coordinate pair into an address.

geoDecodeLanguage Source

Arguments

:: Maybe String

Optional API key to use if you intend to go over the courtesy limit Google imposes

-> (Double, Double)

coordinate to be decoded

-> String

Language to be used. cf. https://developers.google.com/maps/faq#languagesupport

-> IO (Either String String)

Either an error message (Left) or the result (Right).

Reverse geocoding of a given coordinate pair into an address.

Raw Requesting

geoRaw :: [(String, String)] -> IO (Either String (GoogleAnswer GoogleResult)) Source

Sending a raw request to the api, if you want more control than the above methods offer. Uses a pair of key-value pairs to generate the actual query. See GeoResolver.Parser for a helping hand using the resulting GoogleAnswer.