osm-download 0.1 → 0.1.1
raw patch · 2 files changed
+8/−8 lines, 2 files
Files
- Network/OSM.hs +7/−7
- osm-download.cabal +1/−1
Network/OSM.hs view
@@ -1,6 +1,7 @@ module Network.OSM ( -- * Types TileID+ , TileCoords(..) -- * High Level Operations , downloadBestFitTiles , osmTileURL@@ -23,6 +24,7 @@ import Data.Word -- | The official OSM tile server.+osmTileURL :: String osmTileURL = "http://tile.openstreetmap.org" -- |The coordinates associated with any particular GPS location@@ -49,9 +51,7 @@ secant :: Floating a => a -> a secant a = 1 / cos a -initCoords :: TileCoords-initCoords = TileCoords {minX = 100000, maxX = -100000, minY = 100000, maxY = -100000}-+-- |Computes the rectangular map region to download based on GPS points and a zoom level determineTileCoords :: (Lat a, Lon a) => [a] -> Int -> Maybe TileCoords determineTileCoords [] _ = Nothing determineTileCoords wpts z =@@ -77,8 +77,7 @@ | otherwise = i -- | Takes the boundaries of the OSM tiles, and generates--- [(Int,Int)] containing a list of all OSM tiles that--- need downloading+-- a list of the encompassed OSM tiles. selectedTiles :: TileCoords -> [[TileID]] selectedTiles c = map (\j -> [TID (i,j) | i <- [minX c..maxX c]]) [minY c .. maxY c] @@ -113,8 +112,8 @@ long1 = (-180.0) + fromIntegral x * unit' in (lat2,long1,lat1,long1+unit') -- S,W,N,E --- | Takes a WptType, and the OSM tile boundaries--- and generates (x,y) points to be placed on the 'Image'+-- | Takes a WptType, the OSM tile boundaries, and a zoom level then+-- generates (x,y) points to be placed on the Image. pixelPosForCoord :: (Lon a, Lat a, Integral t) => [a] -> TileCoords -> Int -> (t, t) pixelPosForCoord [] _ _ = (0,0) pixelPosForCoord [wpt] tCoord zoom =@@ -130,6 +129,7 @@ -- | The suggested copyright text in accordance with -- http://wiki.openstreetmap.org/wiki/Legal_FAQ+copyrightText :: String copyrightText = "Tile images © OpenStreetMap (and) contributors, CC-BY-SA" -- | Takes the destination directory for the web content,
osm-download.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.1+Version: 0.1.1 -- A short (one-line) description of the package. Synopsis: Download Open Street Map tiles