The HSlippyMap package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

Use OpenStreetMap Slippy Map with Haskell : http:wiki.openstreetmap.orgwikiSlippy_map_tilenames#Haskell


[Skip to ReadMe]

Properties

Versions0.1.0.0, 1.0, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.1, 2.2
Change logNone available
Dependenciesbase (==4.6.*) [details]
LicenseBSD3
AuthorJean-Alexandre Peyroux
Maintainerm@j4.pe
CategoryDevelopment
Home pagehttps://github.com/j4/HSlippyMap
UploadedThu Dec 19 22:20:48 UTC 2013 by j4pe

Modules

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for HSlippyMap-1.0

http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Haskell

long2tilex lon z = floor((lon + 180.0) / 360.0 * (2.0 ** z))
 
lat2tiley lat z = floor((1.0 - log( tan(lat * pi/180.0) + 1.0 / cos(lat * pi/180.0)) / pi) / 2.0 * (2.0 ** z))
 
tilex2long x z = x / (2.0 ** z) * 360.0 - 180
 
tiley2lat y z = 180.0 / pi * atan(0.5 * (exp(n) - exp(-n)))
        where
                n = pi - 2.0 * pi * y / (2.0 ** z)
 
-- Exemple
main = do
        --print $ long2tilex 2.2712 17
        --print $ lat2tiley 48.8152 17
        --print $ tilex2long 66362 17
        --print $ tiley2lat 45115 17
        putStrLn "gps: (lat=48.8152,long=2.2712)"
        putStrLn $ "http://tile.openstreetmap.org/17/" ++ show x ++ "/" ++ show y ++ ".png"
        where
                z = 17
                x = long2tilex 2.2712 z
                y = lat2tiley 48.8152 z