osm-download-0.1.1: Download Open Street Map tiles

Network.OSM

Contents

Synopsis

Types

data TileCoords Source

The coordinates associated with any particular GPS location can be computed using determineTileCoords and converted into tile ids using selectedTiles before final download with downloadTiles.

Constructors

TileCoords 

Fields

minX :: Int
 
maxX :: Int
 
minY :: Int
 
maxY :: Int
 

High Level Operations

downloadBestFitTiles :: String -> (Lat a, Lon a) => [a] -> IO [[ByteString]]Source

Takes the destination directory for the web content, the (Trail PtType), and uses the DrawOsm functions to generate an `osm.png' file showing the trail.

osmTileURL :: StringSource

The official OSM tile server.

pixelPosForCoord :: (Lon a, Lat a, Integral t) => [a] -> TileCoords -> Int -> (t, t)Source

Takes a WptType, the OSM tile boundaries, and a zoom level then generates (x,y) points to be placed on the Image.

Low level and helper functions

determineTileCoords :: (Lat a, Lon a) => [a] -> Int -> Maybe TileCoordsSource

Computes the rectangular map region to download based on GPS points and a zoom level

selectedTiles :: TileCoords -> [[TileID]]Source

Takes the boundaries of the OSM tiles, and generates a list of the encompassed OSM tiles.

downloadTiles :: String -> [[TileID]] -> Int -> IO [[ByteString]]Source

Takes the boundaries of the OSM tiles and downloads the tiles, keeping them in proper grid patterns for latter stiching or side-by-side display.

Legal

copyrightText :: StringSource

The suggested copyright text in accordance with http:wiki.openstreetmap.orgwikiLegal_FAQ