-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | GPS to HTML Summary Report -- -- Generate a HTML summary report of GPS tracks @package gps2htmlReport @version 0.2.1 -- | This module provides the JourneyCharts and HTMLGenerator modules with -- statistics for the charts, and the journey statistics module Data.GPS.Gps2HtmlReport.JourneyStats -- | Takes all WayPoints, and creates a list of tuples containing -- (TimeStamp,Elevation) ptsElevation :: [WptType] -> [(LocalTime, Double)] -- | Takes all WayPoints, and creates a list of tuples containing -- (TimeStamp,AvrSpeedAtThisPoint) avrSpeedOverTime :: [(LocalTime, Speed)] -> Double -> Double -> [(LocalTime, Speed)] -> [(LocalTime, Speed)] -- | Takes all WayPoints, and creates a list of tuples containing -- (TimeStamp,SpeedAtThisPoint) speedAtPoints :: [WptType] -> [(LocalTime, Speed)] speedAtPoints' :: WptType -> [WptType] -> [(LocalTime, Speed)] -- | Takes all WayPoints, and creates a list of tuples containing -- (TimeStamp,JourneyDistanceAtPoint) accumDistance :: [WptType] -> Double -> [(LocalTime, Distance)] -- | Takes all WayPoints, an element in wptType, and an Eq function, -- returning a single WayPoint findPoint :: [WptType] -> WptType -> (WptType -> Maybe Double) -> (Double -> Double -> Bool) -> Maybe (LocalTime, Double) -- | Calculates the total journey distance journeyDistance :: (Lat a, Lon a) => [a] -> Distance -- | Calculates the average speed of the journey meanJourneySpeed :: (Lat a, Lon a, Time a) => [a] -> Distance -- | Calculates the maximum speed maxSpeed :: [WptType] -> Speed -- | Calculates the average elevation throughout the journey meanElevation :: Ele a => [a] -> Double -- | Calculates the total journey time journeyTime :: Time a => [a] -> NominalDiffTime -- | Extracts the date of the journey (from the first WayPoint) dateOfJourney :: Time a => [a] -> Maybe Day lclTime :: DateTime -> LocalTime dfltTZ :: TimeZone -- | This module uses the JourneyStats module to generate the statistics -- about the journey WayPoints, then uses the Cairo bindings to generate -- the charts module Data.GPS.Gps2HtmlReport.JourneyCharts data OutputType Window :: OutputType PNG :: OutputType PS :: OutputType PDF :: OutputType SVG :: OutputType -- | Generates the Cairo chart showing speed and elevation over time speedAndElevationOverTimeChart :: [WptType] -> OutputType -> Renderable () -- | Generates the Cairo chart showing accumulative distance and elevation -- over time, with spots showing maximum and minimum elevation points accumDistanceAndElevationChart :: [WptType] -> OutputType -> Renderable () renderToPng :: (t, OutputType -> Renderable a) -> FilePath -> IO (PickFn a) chart1 :: [WptType] -> (String, OutputType -> Renderable ()) chart2 :: [WptType] -> (String, OutputType -> Renderable ()) module Data.GPS.Gps2HtmlReport.DrawOsm data TileCoords TileCoords :: Int -> Int -> Int -> Int -> TileCoords minX :: TileCoords -> Int maxX :: TileCoords -> Int minY :: TileCoords -> Int maxY :: TileCoords -> Int tileNumbers :: Double -> Double -> Int -> [(Int, Int)] maxTile :: [(Int, Int)] -> (Int, Int) secant :: Floating a => a -> a initCoords :: TileCoords -- | Determines the minimum and maximum of the X and Y tiles to be -- downloaded from OSM determineTiles :: [WptType] -> TileCoords -> Int -> TileCoords deltaLat :: TileCoords -> Int deltaLong :: TileCoords -> Int zoom :: TileCoords -> Int zoomCalc :: TileCoords -> Int -- | Takes the boundaries of the OSM tiles, and generates [(Int,Int)] -- containing a list of all OSM tiles that need downloading selectedTiles :: TileCoords -> [(Int, Int)] -- | Formats the filename string filenameStr :: (Show a, Show a1) => a -> a1 -> String -- | Formats the URL string rectangle :: Int -> Int -> Rectangle -- | Takes the URL of a given OSM tile and uses curl to download it downloadFile :: String -> IO Image -- | Takes the boundaries of the OSM tiles covering the the Trail, -- uses placeTile to download the tile and to place each tile on -- the background layer makeOSMLayer :: TileCoords -> Int -> IO Image -- | Used to create a mosaic of all downloaded OSM tiles to generate the -- background layer for plotting the Trail onto the Image placeTile :: Int -> Int -> Image -> TileCoords -> Int -> IO () projectMercToLat :: Floating a => a -> a -- | Used by pixelPosForCoord for N,S,E,W coordinates for (x,y) -- values project :: Int -> Int -> Int -> (Double, Double, Double, Double) -- | Takes a WptType, and the OSM tile boundaries and generates (x,y) -- points to be placed on the Image pixelPosForCoord :: (Lon a, Lat a, Integral t, Integral t1) => [a] -> TileCoords -> Int -> (t, t1) -- | Takes the WptType and draws lines between every point to point -- connection in the Trail drawLines :: [WptType] -> TileCoords -> Image -> Int -> IO Image -- | This is a fix on the fact that the drawLine function provided -- by the GD bindings do not provid a width parameter drawLine' :: Point -> Point -> Image -> (Double, Double, Double) -> Int -> IO () -- | Uses a sliding scale for the red value in the RGB Color to show a -- sliding color from green to yellow in accordance with the relative -- elevation of a given WptType in the Trail lineColor :: Int -> Color -- | Adds the copyright text in accordance with -- http:wiki.openstreetmap.orgwikiLegal_FAQ addCopyright :: Image -> IO (Point, Point, Point, Point) -- | If the generated OSM image has a greater width than 800 pixels, it is -- scaled to have a width of 800 pixels. fitToWidth :: Image -> IO Image -- | Uses the GraphicsMagick bindings the resize the image resizeImg :: Image -> (Int, Int) -> IO Image -- | Takes the destination directory for the web content, the (Trail -- WptType), and uses the DrawOsm functions to generate an `osm.png' file -- showing the trail. generateOsmMap :: String -> [WptType] -> IO () -- | The HTMLGenerator module generates the HTML content for the -- index.html generated module Data.GPS.Gps2HtmlReport.HTMLGenerator -- | Takes all the WayPoints and generates the HTML file generateHtmlPage :: [WptType] -> Html -- | The OpenStreetMap image area osmImg :: Html -- | Takes all the WayPoints and calculates the journey statistics statsTable :: [WptType] -> Html