GPX (empty) → 0.1
raw patch · 73 files changed
+1452/−0 lines, 73 filesdep +basedep +containersdep +hxtsetup-changed
Dependencies added: base, containers, hxt, hxt-extras
Files
- Data/Geo/GPX.hs +142/−0
- Data/Geo/GPX/Accessor/Ageofdgpsdata.hs +4/−0
- Data/Geo/GPX/Accessor/Author.hs +6/−0
- Data/Geo/GPX/Accessor/Bounds.hs +6/−0
- Data/Geo/GPX/Accessor/Cmt.hs +4/−0
- Data/Geo/GPX/Accessor/Copyright.hs +6/−0
- Data/Geo/GPX/Accessor/Creator.hs +4/−0
- Data/Geo/GPX/Accessor/Desc.hs +4/−0
- Data/Geo/GPX/Accessor/Dgpsid.hs +6/−0
- Data/Geo/GPX/Accessor/Domain.hs +4/−0
- Data/Geo/GPX/Accessor/Ele.hs +4/−0
- Data/Geo/GPX/Accessor/Email.hs +6/−0
- Data/Geo/GPX/Accessor/Extensions.hs +6/−0
- Data/Geo/GPX/Accessor/Fix.hs +6/−0
- Data/Geo/GPX/Accessor/Geoidheight.hs +4/−0
- Data/Geo/GPX/Accessor/Hdop.hs +4/−0
- Data/Geo/GPX/Accessor/Href.hs +4/−0
- Data/Geo/GPX/Accessor/Id.hs +4/−0
- Data/Geo/GPX/Accessor/Keywords.hs +4/−0
- Data/Geo/GPX/Accessor/Lat.hs +6/−0
- Data/Geo/GPX/Accessor/License.hs +4/−0
- Data/Geo/GPX/Accessor/Link.hs +6/−0
- Data/Geo/GPX/Accessor/Links.hs +6/−0
- Data/Geo/GPX/Accessor/Lon.hs +6/−0
- Data/Geo/GPX/Accessor/Magvar.hs +6/−0
- Data/Geo/GPX/Accessor/Maxlat.hs +6/−0
- Data/Geo/GPX/Accessor/Maxlon.hs +6/−0
- Data/Geo/GPX/Accessor/Metadata.hs +6/−0
- Data/Geo/GPX/Accessor/Minlat.hs +6/−0
- Data/Geo/GPX/Accessor/Minlon.hs +6/−0
- Data/Geo/GPX/Accessor/Name.hs +4/−0
- Data/Geo/GPX/Accessor/Number.hs +4/−0
- Data/Geo/GPX/Accessor/Pdop.hs +4/−0
- Data/Geo/GPX/Accessor/Pts.hs +6/−0
- Data/Geo/GPX/Accessor/Rtepts.hs +6/−0
- Data/Geo/GPX/Accessor/Rtes.hs +6/−0
- Data/Geo/GPX/Accessor/Sat.hs +4/−0
- Data/Geo/GPX/Accessor/Src.hs +4/−0
- Data/Geo/GPX/Accessor/Sym.hs +4/−0
- Data/Geo/GPX/Accessor/Text.hs +4/−0
- Data/Geo/GPX/Accessor/Time.hs +4/−0
- Data/Geo/GPX/Accessor/Trkpts.hs +6/−0
- Data/Geo/GPX/Accessor/Trks.hs +6/−0
- Data/Geo/GPX/Accessor/Trksegs.hs +6/−0
- Data/Geo/GPX/Accessor/Type.hs +4/−0
- Data/Geo/GPX/Accessor/Value.hs +6/−0
- Data/Geo/GPX/Accessor/Vdop.hs +4/−0
- Data/Geo/GPX/Accessor/Version.hs +4/−0
- Data/Geo/GPX/Accessor/Wpts.hs +6/−0
- Data/Geo/GPX/Accessor/Year.hs +4/−0
- Data/Geo/GPX/BoundsType.hs +41/−0
- Data/Geo/GPX/CopyrightType.hs +36/−0
- Data/Geo/GPX/DegreesType.hs +24/−0
- Data/Geo/GPX/DgpsStationType.hs +27/−0
- Data/Geo/GPX/EmailType.hs +27/−0
- Data/Geo/GPX/ExtensionsType.hs +23/−0
- Data/Geo/GPX/FixType.hs +66/−0
- Data/Geo/GPX/Gpx.hs +27/−0
- Data/Geo/GPX/GpxType.hs +65/−0
- Data/Geo/GPX/LatitudeType.hs +27/−0
- Data/Geo/GPX/LinkType.hs +22/−0
- Data/Geo/GPX/LongitudeType.hs +27/−0
- Data/Geo/GPX/MetadataType.hs +78/−0
- Data/Geo/GPX/PersonType.hs +36/−0
- Data/Geo/GPX/PtType.hs +43/−0
- Data/Geo/GPX/PtsegType.hs +22/−0
- Data/Geo/GPX/RteType.hs +74/−0
- Data/Geo/GPX/TrkType.hs +74/−0
- Data/Geo/GPX/TrksegType.hs +30/−0
- Data/Geo/GPX/WptType.hs +171/−0
- GPX.cabal +94/−0
- LICENSE +27/−0
- Setup.lhs +3/−0
+ Data/Geo/GPX.hs view
@@ -0,0 +1,142 @@+-- | GPX 1.1 Schema <http://www.topografix.com/GPX/1/1/>+module Data.Geo.GPX(+ module Data.Geo.GPX.DgpsStationType,+ module Data.Geo.GPX.FixType,+ module Data.Geo.GPX.DegreesType,+ module Data.Geo.GPX.LongitudeType,+ module Data.Geo.GPX.LatitudeType,+ module Data.Geo.GPX.BoundsType,+ module Data.Geo.GPX.ExtensionsType,+ module Data.Geo.GPX.PtType,+ module Data.Geo.GPX.PtsegType,+ module Data.Geo.GPX.EmailType,+ module Data.Geo.GPX.LinkType,+ module Data.Geo.GPX.PersonType,+ module Data.Geo.GPX.CopyrightType,+ module Data.Geo.GPX.WptType,+ module Data.Geo.GPX.TrksegType,+ module Data.Geo.GPX.TrkType,+ module Data.Geo.GPX.RteType,+ module Data.Geo.GPX.MetadataType,+ module Data.Geo.GPX.GpxType,+ module Data.Geo.GPX.Gpx,+ module Data.Geo.GPX.Accessor.Minlat,+ module Data.Geo.GPX.Accessor.Maxlat,+ module Data.Geo.GPX.Accessor.Minlon,+ module Data.Geo.GPX.Accessor.Maxlon,+ module Data.Geo.GPX.Accessor.Author,+ module Data.Geo.GPX.Accessor.Year,+ module Data.Geo.GPX.Accessor.License,+ module Data.Geo.GPX.Accessor.Value,+ module Data.Geo.GPX.Accessor.Id,+ module Data.Geo.GPX.Accessor.Domain,+ module Data.Geo.GPX.Accessor.Version,+ module Data.Geo.GPX.Accessor.Creator,+ module Data.Geo.GPX.Accessor.Metadata,+ module Data.Geo.GPX.Accessor.Wpts,+ module Data.Geo.GPX.Accessor.Rtes,+ module Data.Geo.GPX.Accessor.Trks,+ module Data.Geo.GPX.Accessor.Extensions,+ module Data.Geo.GPX.Accessor.Href,+ module Data.Geo.GPX.Accessor.Text,+ module Data.Geo.GPX.Accessor.Type,+ module Data.Geo.GPX.Accessor.Name,+ module Data.Geo.GPX.Accessor.Desc,+ module Data.Geo.GPX.Accessor.Copyright,+ module Data.Geo.GPX.Accessor.Links,+ module Data.Geo.GPX.Accessor.Time,+ module Data.Geo.GPX.Accessor.Keywords,+ module Data.Geo.GPX.Accessor.Bounds,+ module Data.Geo.GPX.Accessor.Lat,+ module Data.Geo.GPX.Accessor.Lon,+ module Data.Geo.GPX.Accessor.Ele,+ module Data.Geo.GPX.Accessor.Magvar,+ module Data.Geo.GPX.Accessor.Geoidheight,+ module Data.Geo.GPX.Accessor.Cmt,+ module Data.Geo.GPX.Accessor.Src,+ module Data.Geo.GPX.Accessor.Sym,+ module Data.Geo.GPX.Accessor.Fix,+ module Data.Geo.GPX.Accessor.Sat,+ module Data.Geo.GPX.Accessor.Hdop,+ module Data.Geo.GPX.Accessor.Vdop,+ module Data.Geo.GPX.Accessor.Pdop,+ module Data.Geo.GPX.Accessor.Ageofdgpsdata,+ module Data.Geo.GPX.Accessor.Dgpsid,+ module Data.Geo.GPX.Accessor.Email,+ module Data.Geo.GPX.Accessor.Link,+ module Data.Geo.GPX.Accessor.Pts,+ module Data.Geo.GPX.Accessor.Number,+ module Data.Geo.GPX.Accessor.Rtepts,+ module Data.Geo.GPX.Accessor.Trkpts,+ module Data.Geo.GPX.Accessor.Trksegs+ ) where++import Data.Geo.GPX.DgpsStationType+import Data.Geo.GPX.FixType+import Data.Geo.GPX.DegreesType+import Data.Geo.GPX.LongitudeType+import Data.Geo.GPX.LatitudeType+import Data.Geo.GPX.BoundsType+import Data.Geo.GPX.ExtensionsType+import Data.Geo.GPX.PtType+import Data.Geo.GPX.PtsegType+import Data.Geo.GPX.EmailType+import Data.Geo.GPX.LinkType+import Data.Geo.GPX.PersonType+import Data.Geo.GPX.CopyrightType+import Data.Geo.GPX.WptType+import Data.Geo.GPX.TrksegType+import Data.Geo.GPX.TrkType+import Data.Geo.GPX.RteType+import Data.Geo.GPX.MetadataType+import Data.Geo.GPX.GpxType+import Data.Geo.GPX.Gpx+import Data.Geo.GPX.Accessor.Minlat+import Data.Geo.GPX.Accessor.Maxlat+import Data.Geo.GPX.Accessor.Minlon+import Data.Geo.GPX.Accessor.Maxlon+import Data.Geo.GPX.Accessor.Author+import Data.Geo.GPX.Accessor.Year+import Data.Geo.GPX.Accessor.License+import Data.Geo.GPX.Accessor.Value+import Data.Geo.GPX.Accessor.Id+import Data.Geo.GPX.Accessor.Domain+import Data.Geo.GPX.Accessor.Version+import Data.Geo.GPX.Accessor.Creator+import Data.Geo.GPX.Accessor.Metadata+import Data.Geo.GPX.Accessor.Wpts+import Data.Geo.GPX.Accessor.Rtes+import Data.Geo.GPX.Accessor.Trks+import Data.Geo.GPX.Accessor.Extensions+import Data.Geo.GPX.Accessor.Href+import Data.Geo.GPX.Accessor.Text+import Data.Geo.GPX.Accessor.Type+import Data.Geo.GPX.Accessor.Name+import Data.Geo.GPX.Accessor.Desc+import Data.Geo.GPX.Accessor.Copyright+import Data.Geo.GPX.Accessor.Links+import Data.Geo.GPX.Accessor.Time+import Data.Geo.GPX.Accessor.Keywords+import Data.Geo.GPX.Accessor.Bounds+import Data.Geo.GPX.Accessor.Lat+import Data.Geo.GPX.Accessor.Lon+import Data.Geo.GPX.Accessor.Ele+import Data.Geo.GPX.Accessor.Magvar+import Data.Geo.GPX.Accessor.Geoidheight+import Data.Geo.GPX.Accessor.Cmt+import Data.Geo.GPX.Accessor.Src+import Data.Geo.GPX.Accessor.Sym+import Data.Geo.GPX.Accessor.Fix+import Data.Geo.GPX.Accessor.Sat+import Data.Geo.GPX.Accessor.Hdop+import Data.Geo.GPX.Accessor.Vdop+import Data.Geo.GPX.Accessor.Pdop+import Data.Geo.GPX.Accessor.Ageofdgpsdata+import Data.Geo.GPX.Accessor.Dgpsid+import Data.Geo.GPX.Accessor.Email+import Data.Geo.GPX.Accessor.Link+import Data.Geo.GPX.Accessor.Pts+import Data.Geo.GPX.Accessor.Number+import Data.Geo.GPX.Accessor.Rtepts+import Data.Geo.GPX.Accessor.Trkpts+import Data.Geo.GPX.Accessor.Trksegs
+ Data/Geo/GPX/Accessor/Ageofdgpsdata.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Ageofdgpsdata where++class Ageofdgpsdata a where+ ageofdgpsdata :: a -> Maybe Double
+ Data/Geo/GPX/Accessor/Author.hs view
@@ -0,0 +1,6 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}++module Data.Geo.GPX.Accessor.Author where++class Author a b | a -> b where+ author :: a -> b
+ Data/Geo/GPX/Accessor/Bounds.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Bounds where++import Data.Geo.GPX.BoundsType++class Bounds a where+ bounds :: a -> Maybe BoundsType
+ Data/Geo/GPX/Accessor/Cmt.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Cmt where++class Cmt a where+ cmt :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Copyright.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Copyright where++import Data.Geo.GPX.CopyrightType++class Copyright a where+ copyright :: a -> Maybe CopyrightType
+ Data/Geo/GPX/Accessor/Creator.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Creator where++class Creator a where+ creator :: a -> String
+ Data/Geo/GPX/Accessor/Desc.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Desc where++class Desc a where+ desc :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Dgpsid.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Dgpsid where++import Data.Geo.GPX.DgpsStationType++class Dgpsid a where+ dgpsid :: a -> Maybe DgpsStationType
+ Data/Geo/GPX/Accessor/Domain.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Domain where++class Domain a where+ domain :: a -> String
+ Data/Geo/GPX/Accessor/Ele.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Ele where++class Ele a where+ ele :: a -> Maybe Double
+ Data/Geo/GPX/Accessor/Email.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Email where++import Data.Geo.GPX.EmailType++class Email a where+ email :: a -> Maybe EmailType
+ Data/Geo/GPX/Accessor/Extensions.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Extensions where++import Data.Geo.GPX.ExtensionsType++class Extensions a where+ extensions :: a -> Maybe ExtensionsType
+ Data/Geo/GPX/Accessor/Fix.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Fix where++import Data.Geo.GPX.FixType++class Fix a where+ fix :: a -> Maybe FixType
+ Data/Geo/GPX/Accessor/Geoidheight.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Geoidheight where++class Geoidheight a where+ geoidheight :: a -> Maybe Double
+ Data/Geo/GPX/Accessor/Hdop.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Hdop where++class Hdop a where+ hdop :: a -> Maybe Double
+ Data/Geo/GPX/Accessor/Href.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Href where++class Href a where+ href :: a -> String
+ Data/Geo/GPX/Accessor/Id.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Id where++class Id a where+ id :: a -> String
+ Data/Geo/GPX/Accessor/Keywords.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Keywords where++class Keywords a where+ keywords :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Lat.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Lat where++import Data.Geo.GPX.LatitudeType++class Lat a where+ lat :: a -> LatitudeType
+ Data/Geo/GPX/Accessor/License.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.License where++class License a where+ license :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Link.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Link where++import Data.Geo.GPX.LinkType++class Link a where+ link :: a -> Maybe LinkType
+ Data/Geo/GPX/Accessor/Links.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Links where++import Data.Geo.GPX.LinkType++class Links a where+ links :: a -> [LinkType]
+ Data/Geo/GPX/Accessor/Lon.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Lon where++import Data.Geo.GPX.LongitudeType++class Lon a where+ lon :: a -> LongitudeType
+ Data/Geo/GPX/Accessor/Magvar.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Magvar where++import Data.Geo.GPX.DegreesType++class Magvar a where+ magvar :: a -> Maybe DegreesType
+ Data/Geo/GPX/Accessor/Maxlat.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Maxlat where++import Data.Geo.GPX.LatitudeType++class Maxlat a where+ maxlat :: a -> LatitudeType
+ Data/Geo/GPX/Accessor/Maxlon.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Maxlon where++import Data.Geo.GPX.LongitudeType++class Maxlon a where+ maxlon :: a -> LongitudeType
+ Data/Geo/GPX/Accessor/Metadata.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Metadata where++import Data.Geo.GPX.MetadataType++class Metadata a where+ metadata :: a -> Maybe MetadataType
+ Data/Geo/GPX/Accessor/Minlat.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Minlat where++import Data.Geo.GPX.LatitudeType++class Minlat a where+ minlat :: a -> LatitudeType
+ Data/Geo/GPX/Accessor/Minlon.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Minlon where++import Data.Geo.GPX.LongitudeType++class Minlon a where+ minlon :: a -> LongitudeType
+ Data/Geo/GPX/Accessor/Name.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Name where++class Name a where+ name :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Number.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Number where++class Number a where+ number :: a -> Maybe Int
+ Data/Geo/GPX/Accessor/Pdop.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Pdop where++class Pdop a where+ pdop :: a -> Maybe Double
+ Data/Geo/GPX/Accessor/Pts.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Pts where++import Data.Geo.GPX.PtType++class Pts a where+ pts :: a -> [PtType]
+ Data/Geo/GPX/Accessor/Rtepts.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Rtepts where++import Data.Geo.GPX.WptType++class Rtepts a where+ rtepts :: a -> [WptType]
+ Data/Geo/GPX/Accessor/Rtes.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Rtes where++import Data.Geo.GPX.RteType++class Rtes a where+ rtes :: a -> [RteType]
+ Data/Geo/GPX/Accessor/Sat.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Sat where++class Sat a where+ sat :: a -> Maybe Int
+ Data/Geo/GPX/Accessor/Src.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Src where++class Src a where+ src :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Sym.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Sym where++class Sym a where+ sym :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Text.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Text where++class Text a where+ text :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Time.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Time where++class Time a where+ time :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Trkpts.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Trkpts where++import Data.Geo.GPX.WptType++class Trkpts a where+ trkpts :: a -> [WptType]
+ Data/Geo/GPX/Accessor/Trks.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Trks where++import Data.Geo.GPX.TrkType++class Trks a where+ trks :: a -> [TrkType]
+ Data/Geo/GPX/Accessor/Trksegs.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Trksegs where++import Data.Geo.GPX.TrksegType++class Trksegs a where+ trksegs :: a -> [TrksegType]
+ Data/Geo/GPX/Accessor/Type.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Type where++class Type a where+ type' :: a -> Maybe String
+ Data/Geo/GPX/Accessor/Value.hs view
@@ -0,0 +1,6 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}++module Data.Geo.GPX.Accessor.Value where++class Value a b | a -> b where+ value :: a -> b
+ Data/Geo/GPX/Accessor/Vdop.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Vdop where++class Vdop a where+ vdop :: a -> Maybe Double
+ Data/Geo/GPX/Accessor/Version.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Version where++class Version a where+ version :: a -> String
+ Data/Geo/GPX/Accessor/Wpts.hs view
@@ -0,0 +1,6 @@+module Data.Geo.GPX.Accessor.Wpts where++import Data.Geo.GPX.WptType++class Wpts a where+ wpts :: a -> [WptType]
+ Data/Geo/GPX/Accessor/Year.hs view
@@ -0,0 +1,4 @@+module Data.Geo.GPX.Accessor.Year where++class Year a where+ year :: a -> Maybe String
+ Data/Geo/GPX/BoundsType.hs view
@@ -0,0 +1,41 @@+-- | Complex Type: @boundsType@ <http://www.topografix.com/GPX/1/1/#type_boundsType>+module Data.Geo.GPX.BoundsType(+ BoundsType,+ boundsType+ ) where++import Data.Geo.GPX.LatitudeType+import Data.Geo.GPX.LongitudeType+import Data.Geo.GPX.Accessor.Minlat+import Data.Geo.GPX.Accessor.Maxlat+import Data.Geo.GPX.Accessor.Minlon+import Data.Geo.GPX.Accessor.Maxlon+import Text.XML.HXT.Arrow++data BoundsType = BoundsType (LatitudeType, LongitudeType) (LatitudeType, LongitudeType)+ deriving (Show, Eq)++boundsType :: (LatitudeType, LongitudeType) -- ^ The minimum latitude and longitude.+ -> (LatitudeType, LongitudeType) -- ^ The maximum latitude and longitude.+ -> BoundsType+boundsType = BoundsType++instance XmlPickler BoundsType where+ xpickle = xpWrap (\(minlat', minlon', maxlat', maxlon') -> boundsType (minlat', minlon') (maxlat', maxlon'),+ \(BoundsType (minlat', minlon') (maxlat', maxlon')) -> (minlat', minlon', maxlat', maxlon')) (xp4Tuple+ (xpAttr "minlat" xpickle)+ (xpAttr "minlon" xpickle)+ (xpAttr "maxlat" xpickle)+ (xpAttr "maxlon" xpickle))++instance Minlat BoundsType where+ minlat (BoundsType (x, _) (_, _)) = x++instance Maxlat BoundsType where+ maxlat (BoundsType (_, _) (x, _)) = x++instance Minlon BoundsType where+ minlon (BoundsType (_, x) (_, _)) = x++instance Maxlon BoundsType where+ maxlon (BoundsType (_, _) (_, x)) = x
+ Data/Geo/GPX/CopyrightType.hs view
@@ -0,0 +1,36 @@+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances #-}++-- | Complex Type: @copyrightType@ <http://www.topografix.com/GPX/1/1/#type_copyrightType>+module Data.Geo.GPX.CopyrightType(+ CopyrightType,+ copyrightType+ ) where++import Data.Geo.GPX.Accessor.Author+import Data.Geo.GPX.Accessor.Year+import Data.Geo.GPX.Accessor.License+import Text.XML.HXT.Arrow++data CopyrightType = CopyrightType String (Maybe String) (Maybe String)+ deriving (Eq, Show)++copyrightType :: String -- ^ The author.+ -> Maybe String -- ^ The year.+ -> Maybe String -- ^ The license.+ -> CopyrightType+copyrightType = CopyrightType++instance XmlPickler CopyrightType where+ xpickle = xpWrap (\(author', year', license') -> copyrightType author' year' license', \(CopyrightType author' year' license') -> (author', year', license')) (xpTriple+ (xpAttr "author" xpText)+ (xpOption (xpElem "year" xpText))+ (xpOption (xpElem "license" xpText)))++instance Author CopyrightType String where+ author (CopyrightType x _ _) = x++instance Year CopyrightType where+ year (CopyrightType _ x _) = x++instance License CopyrightType where+ license (CopyrightType _ _ x) = x
+ Data/Geo/GPX/DegreesType.hs view
@@ -0,0 +1,24 @@+{-# LANGUAGE MultiParamTypeClasses #-}++-- | Simple Type: @degreesType@ <http://www.topografix.com/GPX/1/1/#type_degreesType>+module Data.Geo.GPX.DegreesType(+ DegreesType,+ degreesType+ ) where++import Data.Geo.GPX.Accessor.Value+import Data.Fixed+import Text.XML.HXT.Arrow++newtype DegreesType = DegreesType Double+ deriving (Eq, Show)++degreesType :: Double -- ^ The value which will be between 0 and 360 (values out of the range are truncated using a modulus operation).+ -> DegreesType+degreesType n = DegreesType (n `mod'` 360)++instance XmlPickler DegreesType where+ xpickle = xpWrap (degreesType, \(DegreesType n) -> n) xpPrim++instance Value DegreesType Double where+ value (DegreesType x) = x
+ Data/Geo/GPX/DgpsStationType.hs view
@@ -0,0 +1,27 @@+{-# LANGUAGE MultiParamTypeClasses #-}++-- | Simple Type: @dgpsStationType@ <http://www.topografix.com/GPX/1/1/#type_dgpsStationType>+module Data.Geo.GPX.DgpsStationType(+ DgpsStationType,+ dgpsStationType+ ) where++import Data.Geo.GPX.Accessor.Value+import Data.Ix+import Text.XML.HXT.Arrow++newtype DgpsStationType = DgpsStationType Int+ deriving Eq++dgpsStationType :: Int -- ^ The value between 0 and 1023.+ -> Maybe DgpsStationType+dgpsStationType n = if inRange (0, 1023) n then Just (DgpsStationType n) else Nothing++instance Show DgpsStationType where+ show (DgpsStationType n) = show n++instance XmlPickler DgpsStationType where+ xpickle = xpWrapMaybe (dgpsStationType, \(DgpsStationType n) -> n) xpickle++instance Value DgpsStationType Int where+ value (DgpsStationType x) = x
+ Data/Geo/GPX/EmailType.hs view
@@ -0,0 +1,27 @@+-- | Complex Type: @emailType@ <http://www.topografix.com/GPX/1/1/#type_emailType>+module Data.Geo.GPX.EmailType(+ EmailType,+ emailType+ ) where++import Text.XML.HXT.Arrow+import Data.Geo.GPX.Accessor.Id+import Data.Geo.GPX.Accessor.Domain++data EmailType = EmailType String String+ deriving (Eq, Show)++emailType :: String -- ^ The id.+ -> String -- ^ The domain.+ -> EmailType+emailType = EmailType++instance XmlPickler EmailType where+ xpickle = xpWrap (uncurry emailType, \(EmailType id' domain') -> (id', domain'))+ (xpPair (xpAttr "id" xpText) (xpAttr "domain" xpText))++instance Id EmailType where+ id (EmailType x _) = x++instance Domain EmailType where+ domain (EmailType _ x) = x
+ Data/Geo/GPX/ExtensionsType.hs view
@@ -0,0 +1,23 @@+{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances #-}++-- | Complex Type: @extensionsType@ <http://www.topografix.com/GPX/1/1/#type_extensionsType>+module Data.Geo.GPX.ExtensionsType(+ ExtensionsType,+ extensionsType+ ) where++import Text.XML.HXT.Arrow+import Data.Geo.GPX.Accessor.Value++newtype ExtensionsType = ExtensionsType XmlTree+ deriving (Eq, Show)++instance XmlPickler ExtensionsType where+ xpickle = xpWrap (ExtensionsType, \(ExtensionsType t) -> t) xpTree++extensionsType :: XmlTree -- ^ The extensions sub-tree.+ -> ExtensionsType+extensionsType = ExtensionsType++instance Value ExtensionsType XmlTree where+ value (ExtensionsType x) = x
+ Data/Geo/GPX/FixType.hs view
@@ -0,0 +1,66 @@+-- | Simple Type: @fixType@ <http://www.topografix.com/GPX/1/1/#type_fixType>+module Data.Geo.GPX.FixType(+ FixType,+ foldFixType,+ none,+ twod,+ threed,+ dgps,+ pps,+ fixType+ ) where++import Text.XML.HXT.Arrow hiding (none)++data FixType = None | Twod | Threed | Dgps | Pps+ deriving (Eq, Enum)++-- | The catamorphism for @FixType@.+foldFixType :: a -- ^ The value if @none@.+ -> a -- ^ The value if @twod@.+ -> a -- ^ The value if @threed@.+ -> a -- ^ The value if @dgps@.+ -> a -- ^ The value if @pps@.+ -> FixType -- ^ The value to fold.+ -> a+foldFixType n _ _ _ _ None = n+foldFixType _ t _ _ _ Twod = t+foldFixType _ _ t _ _ Threed = t+foldFixType _ _ _ d _ Dgps = d+foldFixType _ _ _ _ p Pps = p++-- | Construct a @FixType@ with a value of @none@.+none :: FixType+none = None++-- | Construct a @FixType@ with a value of @2d@.+twod :: FixType+twod = Twod++-- | Construct a @FixType@ with a value of @3d@.+threed :: FixType+threed = Threed++-- | Construct a @FixType@ with a value of @dgps@.+dgps :: FixType+dgps = Dgps++-- | Construct a @FixType@ with a value of @pps@.+pps :: FixType+pps = Pps++-- | Construct a @FixType@ using a string with a value of @["none", "2d", "3d", "dgps", "pps"]@.+fixType :: String -- ^ The string value to construct a @FixType@ with.+ -> Maybe FixType+fixType "none" = Just none+fixType "2d"= Just twod+fixType "3d" = Just threed+fixType "dgps" = Just dgps+fixType "pps" = Just pps+fixType _ = Nothing++instance XmlPickler FixType where+ xpickle = xpWrapMaybe (fixType, show) xpText++instance Show FixType where+ show = foldFixType "none" "2d" "3d" "dgps" "pps"
+ Data/Geo/GPX/Gpx.hs view
@@ -0,0 +1,27 @@+{-# LANGUAGE MultiParamTypeClasses #-}++-- | Element: @gpx@ <http://www.topografix.com/GPX/1/1/#element_gpx>+module Data.Geo.GPX.Gpx(+ Gpx,+ gpx+ ) where++import Text.XML.HXT.Arrow+import Data.Geo.GPX.GpxType+import Data.Geo.GPX.Accessor.Value++newtype Gpx = Gpx GpxType+ deriving Eq++gpx :: GpxType -- ^ The gpx element contents.+ -> Gpx+gpx = Gpx++instance Show Gpx where+ show (Gpx n) = show n++instance XmlPickler Gpx where+ xpickle = xpWrap (gpx, \(Gpx n) -> n) (xpElem "gpx" xpickle)++instance Value Gpx GpxType where+ value (Gpx x) = x
+ Data/Geo/GPX/GpxType.hs view
@@ -0,0 +1,65 @@+-- | Complex Type: @gpxType@ <http://www.topografix.com/GPX/1/1/#type_gpxType>+module Data.Geo.GPX.GpxType(+ GpxType,+ gpxType+ ) where++import Data.Geo.GPX.MetadataType+import Data.Geo.GPX.WptType+import Data.Geo.GPX.RteType+import Data.Geo.GPX.TrkType+import Data.Geo.GPX.ExtensionsType+import Data.Geo.GPX.Accessor.Version+import Data.Geo.GPX.Accessor.Creator+import Data.Geo.GPX.Accessor.Metadata+import Data.Geo.GPX.Accessor.Wpts+import Data.Geo.GPX.Accessor.Rtes+import Data.Geo.GPX.Accessor.Trks+import Data.Geo.GPX.Accessor.Extensions+import Text.XML.HXT.Arrow+import Text.XML.HXT.Extras++data GpxType = GpxType String String (Maybe MetadataType) [WptType] [RteType] [TrkType] (Maybe ExtensionsType)+ deriving (Eq, Show)++gpxType :: String -- ^ The version.+ -> String -- ^ The creator.+ -> Maybe MetadataType -- ^ The metadata.+ -> [WptType] -- ^ The waypoints (wpt).+ -> [RteType] -- ^ The routes (rte).+ -> [TrkType] -- ^ The tracks (trk).+ -> Maybe ExtensionsType -- ^ The extensions.+ -> GpxType+gpxType = GpxType++instance XmlPickler GpxType where+ xpickle = xpWrap (\(version', creator', metadata', wpt', rte', trk', extensions') -> gpxType version' creator' metadata' wpt' rte' trk' extensions',+ \(GpxType version' creator' metadata' wpt' rte' trk' extensions') -> (version', creator', metadata', wpt', rte', trk', extensions')) (xp7Tuple+ (xpAttr "version" xpText)+ (xpAttr "creator" xpText)+ (xpOption (xpElem "metadata" xpickle))+ (xpList (xpElem "wpt" xpickle))+ (xpList (xpElem "rte" xpickle))+ (xpList (xpElem "trk" xpickle))+ (xpOption (xpElem "extensions" xpickle)))++instance Version GpxType where+ version (GpxType x _ _ _ _ _ _) = x++instance Creator GpxType where+ creator (GpxType _ x _ _ _ _ _) = x++instance Metadata GpxType where+ metadata (GpxType _ _ x _ _ _ _) = x++instance Wpts GpxType where+ wpts (GpxType _ _ _ x _ _ _) = x++instance Rtes GpxType where+ rtes (GpxType _ _ _ _ x _ _) = x++instance Trks GpxType where+ trks (GpxType _ _ _ _ _ x _) = x++instance Extensions GpxType where+ extensions (GpxType _ _ _ _ _ _ x) = x
+ Data/Geo/GPX/LatitudeType.hs view
@@ -0,0 +1,27 @@+{-# LANGUAGE MultiParamTypeClasses #-}++-- | Simple Type: @latitudeType@ <http://www.topografix.com/GPX/1/1/#type_latitudeType>+module Data.Geo.GPX.LatitudeType(+ LatitudeType,+ latitudeType+ ) where++import Data.Geo.GPX.Accessor.Value+import Data.Fixed+import Text.XML.HXT.Arrow++newtype LatitudeType = LatitudeType Double+ deriving Eq++latitudeType :: Double -- ^ The value which will be between -90 and 90 (values out of the range are truncated using a modulus operation).+ -> LatitudeType+latitudeType n = LatitudeType ((n + 90) `mod'` 180 - 90)++instance XmlPickler LatitudeType where+ xpickle = xpWrap (latitudeType, \(LatitudeType n) -> n) xpPrim++instance Show LatitudeType where+ show (LatitudeType n) = show n++instance Value LatitudeType Double where+ value (LatitudeType x) = x
+ Data/Geo/GPX/LinkType.hs view
@@ -0,0 +1,22 @@+-- | Complex Type: @linkType@ <http://www.topografix.com/GPX/1/1/#type_linkType>+module Data.Geo.GPX.LinkType(+ LinkType,+ linkType+ ) where++import Text.XML.HXT.Arrow++data LinkType = LinkType String (Maybe String) (Maybe String)+ deriving (Eq, Show)++linkType :: String -- ^ The href.+ -> Maybe String -- ^ The text.+ -> Maybe String -- ^ The type.+ -> LinkType+linkType = LinkType++instance XmlPickler LinkType where+ xpickle = xpWrap (\(href, text, type') -> linkType href text type', \(LinkType href text type') -> (href, text, type')) (xpTriple+ (xpAttr "href" xpText)+ (xpOption (xpElem "text" xpText))+ (xpOption (xpElem "type" xpText)))
+ Data/Geo/GPX/LongitudeType.hs view
@@ -0,0 +1,27 @@+{-# LANGUAGE MultiParamTypeClasses #-}++-- | Simple Type: @latitudeType@ <http://www.topografix.com/GPX/1/1/#type_latitudeType>+module Data.Geo.GPX.LongitudeType(+ LongitudeType,+ longitudeType+ ) where++import Data.Geo.GPX.Accessor.Value+import Data.Fixed+import Text.XML.HXT.Arrow++newtype LongitudeType = LongitudeType Double+ deriving Eq++longitudeType :: Double -- ^ The value which will be between -180 and 180 (values out of the range are truncated using a modulus operation).+ -> LongitudeType+longitudeType n = LongitudeType ((n + 180) `mod'` 360 - 180)++instance XmlPickler LongitudeType where+ xpickle = xpWrap (longitudeType, \(LongitudeType n) -> n) xpPrim++instance Show LongitudeType where+ show (LongitudeType n) = show n++instance Value LongitudeType Double where+ value (LongitudeType x) = x
+ Data/Geo/GPX/MetadataType.hs view
@@ -0,0 +1,78 @@+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}++-- | Complex Type: @metadataType@ <http://www.topografix.com/GPX/1/1/#type_metadataType>+module Data.Geo.GPX.MetadataType(+ MetadataType,+ metadataType+ ) where++import Data.Geo.GPX.PersonType+import Data.Geo.GPX.CopyrightType+import Data.Geo.GPX.LinkType+import Data.Geo.GPX.BoundsType+import Data.Geo.GPX.ExtensionsType+import Data.Geo.GPX.Accessor.Name+import Data.Geo.GPX.Accessor.Desc+import Data.Geo.GPX.Accessor.Author+import Data.Geo.GPX.Accessor.Copyright+import Data.Geo.GPX.Accessor.Links+import Data.Geo.GPX.Accessor.Time+import Data.Geo.GPX.Accessor.Keywords+import Data.Geo.GPX.Accessor.Bounds+import Data.Geo.GPX.Accessor.Extensions+import Text.XML.HXT.Arrow+import Text.XML.HXT.Extras++data MetadataType = MetadataType (Maybe String) (Maybe String) (Maybe PersonType) (Maybe CopyrightType) [LinkType] (Maybe String) (Maybe String) (Maybe BoundsType) (Maybe ExtensionsType)+ deriving (Eq, Show)++metadataType :: Maybe String -- ^ The name.+ -> Maybe String -- ^ The desc.+ -> Maybe PersonType -- ^ The author.+ -> Maybe CopyrightType -- ^ The copyright.+ -> [LinkType] -- ^ The links (link).+ -> Maybe String -- ^ The time.+ -> Maybe String -- ^ The keywords.+ -> Maybe BoundsType -- ^ The bounds.+ -> Maybe ExtensionsType -- ^ The extensions+ -> MetadataType+metadataType = MetadataType++instance XmlPickler MetadataType where+ xpickle = xpWrap (\(a, b, c, d, e, f, g, h, i) -> metadataType a b c d e f g h i, \(MetadataType a b c d e f g h i) -> (a, b, c, d, e, f, g, h, i)) (xp9Tuple+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "desc" xpText))+ (xpOption (xpElem "author" xpickle))+ (xpOption (xpElem "copyright" xpickle))+ (xpList (xpElem "link" xpickle))+ (xpOption (xpElem "time" xpText))+ (xpOption (xpElem "keywords" xpText))+ (xpOption (xpElem "bounds" xpickle))+ (xpOption (xpElem "extensions" xpickle)))++instance Name MetadataType where+ name (MetadataType x _ _ _ _ _ _ _ _) = x++instance Desc MetadataType where+ desc (MetadataType _ x _ _ _ _ _ _ _) = x++instance Author MetadataType (Maybe PersonType) where+ author (MetadataType _ _ x _ _ _ _ _ _) = x++instance Copyright MetadataType where+ copyright (MetadataType _ _ _ x _ _ _ _ _) = x++instance Links MetadataType where+ links (MetadataType _ _ _ _ x _ _ _ _) = x++instance Time MetadataType where+ time (MetadataType _ _ _ _ _ x _ _ _) = x++instance Keywords MetadataType where+ keywords (MetadataType _ _ _ _ _ _ x _ _) = x++instance Bounds MetadataType where+ bounds (MetadataType _ _ _ _ _ _ _ x _) = x++instance Extensions MetadataType where+ extensions (MetadataType _ _ _ _ _ _ _ _ x) = x
+ Data/Geo/GPX/PersonType.hs view
@@ -0,0 +1,36 @@+-- | Complex Type: @personType@ <http://www.topografix.com/GPX/1/1/#type_personType>+module Data.Geo.GPX.PersonType(+ PersonType,+ personType+ ) where++import Data.Geo.GPX.EmailType+import Data.Geo.GPX.LinkType+import Data.Geo.GPX.Accessor.Name+import Data.Geo.GPX.Accessor.Email+import Data.Geo.GPX.Accessor.Link+import Text.XML.HXT.Arrow++data PersonType = PersonType (Maybe String) (Maybe EmailType) (Maybe LinkType)+ deriving (Eq, Show)++personType :: Maybe String -- ^ The name.+ -> Maybe EmailType -- ^ The email.+ -> Maybe LinkType -- ^ The link.+ -> PersonType+personType = PersonType++instance XmlPickler PersonType where+ xpickle = xpWrap (\(name', email', link') -> personType name' email' link', \(PersonType name' email' link') -> (name', email', link')) (xpTriple+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "email" xpickle))+ (xpOption (xpElem "link" xpickle)))++instance Name PersonType where+ name (PersonType x _ _) = x++instance Email PersonType where+ email (PersonType _ x _) = x++instance Link PersonType where+ link (PersonType _ _ x) = x
+ Data/Geo/GPX/PtType.hs view
@@ -0,0 +1,43 @@+-- | Complex Type: @ptType@ <http://www.topografix.com/GPX/1/1/#type_ptType>+module Data.Geo.GPX.PtType(+ PtType,+ ptType+ ) where++import Data.Geo.GPX.LatitudeType+import Data.Geo.GPX.LongitudeType+import Data.Geo.GPX.Accessor.Lat+import Data.Geo.GPX.Accessor.Lon+import Data.Geo.GPX.Accessor.Ele+import Data.Geo.GPX.Accessor.Time+import Text.XML.HXT.Arrow++data PtType = PtType LatitudeType LongitudeType (Maybe Double) (Maybe String)+ deriving (Eq, Show)++ptType :: LatitudeType -- ^ The lat.+ -> LongitudeType -- ^ The lon.+ -> Maybe Double -- ^ The ele.+ -> Maybe String -- ^ The time.+ -> PtType+ptType = PtType++instance XmlPickler PtType where+ xpickle = xpWrap (\(lat', lon', ele', time') -> ptType lat' lon' ele' time',+ \(PtType lat' lon' ele' time') -> (lat', lon', ele', time')) (xp4Tuple+ (xpAttr "lat" xpickle)+ (xpAttr "lon" xpickle)+ (xpOption (xpElem "ele" xpPrim))+ (xpOption (xpElem "time" xpText)))++instance Lat PtType where+ lat (PtType x _ _ _) = x++instance Lon PtType where+ lon (PtType _ x _ _) = x++instance Ele PtType where+ ele (PtType _ _ x _) = x++instance Time PtType where+ time (PtType _ _ _ x) = x
+ Data/Geo/GPX/PtsegType.hs view
@@ -0,0 +1,22 @@+-- | Complex Type: @ptsegType@ <http://www.topografix.com/GPX/1/1/#type_ptsegType>+module Data.Geo.GPX.PtsegType(+ PtsegType,+ ptsegType+ ) where++import Data.Geo.GPX.PtType+import Data.Geo.GPX.Accessor.Pts+import Text.XML.HXT.Arrow++newtype PtsegType = PtsegType [PtType]+ deriving (Eq, Show)++ptsegType :: [PtType] -- ^ The points (pt).+ -> PtsegType+ptsegType = PtsegType++instance XmlPickler PtsegType where+ xpickle = xpWrap (ptsegType, \(PtsegType k) -> k) (xpList (xpElem "pt" xpickle))++instance Pts PtsegType where+ pts (PtsegType x) = x
+ Data/Geo/GPX/RteType.hs view
@@ -0,0 +1,74 @@+-- | Complex Type: @rteType@ <http://www.topografix.com/GPX/1/1/#type_rteType>+module Data.Geo.GPX.RteType(+ RteType,+ rteType+ ) where++import Data.Geo.GPX.WptType+import Data.Geo.GPX.ExtensionsType+import Data.Geo.GPX.LinkType+import Data.Geo.GPX.Accessor.Name+import Data.Geo.GPX.Accessor.Cmt+import Data.Geo.GPX.Accessor.Desc+import Data.Geo.GPX.Accessor.Src+import Data.Geo.GPX.Accessor.Links+import Data.Geo.GPX.Accessor.Number+import Data.Geo.GPX.Accessor.Type+import Data.Geo.GPX.Accessor.Extensions+import Data.Geo.GPX.Accessor.Rtepts+import Text.XML.HXT.Arrow+import Text.XML.HXT.Extras++data RteType = RteType (Maybe String) (Maybe String) (Maybe String) (Maybe String) [LinkType] (Maybe Int) (Maybe String) (Maybe ExtensionsType) [WptType]+ deriving (Eq, Show)++rteType :: Maybe String -- ^ The name.+ -> Maybe String -- ^ The cmt.+ -> Maybe String -- ^ The desc.+ -> Maybe String -- ^ The src.+ -> [LinkType] -- ^ The links (link).+ -> Maybe Int -- ^ The number.+ -> Maybe String -- ^ The type.+ -> Maybe ExtensionsType -- ^ The extensions.+ -> [WptType] -- ^ The route points (rtept).+ -> RteType+rteType a b c d e f = RteType a b c d e (fmap abs f)++instance XmlPickler RteType where+ xpickle = xpWrap (\(a, b, c, d, e, f, g, h, i) -> rteType a b c d e f g h i, \(RteType a b c d e f g h i) -> (a, b, c, d, e, f, g, h, i)) (xp9Tuple+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "cmt" xpText))+ (xpOption (xpElem "desc" xpText))+ (xpOption (xpElem "src" xpText))+ (xpList (xpElem "link" xpickle))+ (xpOption (xpElem "number" xpPrim))+ (xpOption (xpElem "type" xpText))+ (xpOption (xpElem "extensions" xpickle))+ (xpList (xpElem "rtept" xpickle)))++instance Name RteType where+ name (RteType x _ _ _ _ _ _ _ _) = x++instance Cmt RteType where+ cmt (RteType _ x _ _ _ _ _ _ _) = x++instance Desc RteType where+ desc (RteType _ _ x _ _ _ _ _ _) = x++instance Src RteType where+ src (RteType _ _ _ x _ _ _ _ _) = x++instance Links RteType where+ links (RteType _ _ _ _ x _ _ _ _) = x++instance Number RteType where+ number (RteType _ _ _ _ _ x _ _ _) = x++instance Type RteType where+ type' (RteType _ _ _ _ _ _ x _ _) = x++instance Extensions RteType where+ extensions (RteType _ _ _ _ _ _ _ x _) = x++instance Rtepts RteType where+ rtepts (RteType _ _ _ _ _ _ _ _ x) = x
+ Data/Geo/GPX/TrkType.hs view
@@ -0,0 +1,74 @@+-- | Complex Type: @trkType@ <http://www.topografix.com/GPX/1/1/#type_trkType>+module Data.Geo.GPX.TrkType(+ TrkType,+ trkType+ ) where++import Data.Geo.GPX.TrksegType+import Data.Geo.GPX.ExtensionsType+import Data.Geo.GPX.LinkType+import Data.Geo.GPX.Accessor.Name+import Data.Geo.GPX.Accessor.Cmt+import Data.Geo.GPX.Accessor.Desc+import Data.Geo.GPX.Accessor.Src+import Data.Geo.GPX.Accessor.Links+import Data.Geo.GPX.Accessor.Number+import Data.Geo.GPX.Accessor.Type+import Data.Geo.GPX.Accessor.Extensions+import Data.Geo.GPX.Accessor.Trksegs+import Text.XML.HXT.Arrow+import Text.XML.HXT.Extras++data TrkType = TrkType (Maybe String) (Maybe String) (Maybe String) (Maybe String) [LinkType] (Maybe Int) (Maybe String) (Maybe ExtensionsType) [TrksegType]+ deriving (Eq, Show)++trkType :: Maybe String -- ^ The name.+ -> Maybe String -- ^ The cmt.+ -> Maybe String -- ^ The desc.+ -> Maybe String -- ^ The src.+ -> [LinkType] -- ^ The links (link).+ -> Maybe Int -- ^ The number.+ -> Maybe String -- ^ The type.+ -> Maybe ExtensionsType -- ^ The extensions.+ -> [TrksegType] -- ^ The track segments (trkseg).+ -> TrkType+trkType a b c d e f = TrkType a b c d e (fmap abs f)++instance XmlPickler TrkType where+ xpickle = xpWrap (\(a, b, c, d, e, f, g, h, i) -> trkType a b c d e f g h i, \(TrkType a b c d e f g h i) -> (a, b, c, d, e, f, g, h, i)) (xp9Tuple+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "cmt" xpText))+ (xpOption (xpElem "desc" xpText))+ (xpOption (xpElem "src" xpText))+ (xpList (xpElem "link" xpickle))+ (xpOption (xpElem "number" xpPrim))+ (xpOption (xpElem "type" xpText))+ (xpOption (xpElem "extensions" xpickle))+ (xpList (xpElem "trkseg" xpickle)))++instance Name TrkType where+ name (TrkType x _ _ _ _ _ _ _ _) = x++instance Cmt TrkType where+ cmt (TrkType _ x _ _ _ _ _ _ _) = x++instance Desc TrkType where+ desc (TrkType _ _ x _ _ _ _ _ _) = x++instance Src TrkType where+ src (TrkType _ _ _ x _ _ _ _ _) = x++instance Links TrkType where+ links (TrkType _ _ _ _ x _ _ _ _) = x++instance Number TrkType where+ number (TrkType _ _ _ _ _ x _ _ _) = x++instance Type TrkType where+ type' (TrkType _ _ _ _ _ _ x _ _) = x++instance Extensions TrkType where+ extensions (TrkType _ _ _ _ _ _ _ x _) = x++instance Trksegs TrkType where+ trksegs (TrkType _ _ _ _ _ _ _ _ x) = x
+ Data/Geo/GPX/TrksegType.hs view
@@ -0,0 +1,30 @@+-- | Complex Type: @trksegType@ <http://www.topografix.com/GPX/1/1/#type_trksegType>+module Data.Geo.GPX.TrksegType(+ TrksegType,+ trksegType+ ) where++import Data.Geo.GPX.WptType+import Data.Geo.GPX.ExtensionsType+import Data.Geo.GPX.Accessor.Trkpts+import Data.Geo.GPX.Accessor.Extensions+import Text.XML.HXT.Arrow++data TrksegType = TrksegType [WptType] (Maybe ExtensionsType)+ deriving (Eq, Show)++trksegType :: [WptType] -- ^ The track points (trkpt).+ -> Maybe ExtensionsType -- ^ The extensions.+ -> TrksegType+trksegType = TrksegType++instance XmlPickler TrksegType where+ xpickle = xpWrap (\(trkpt', extensions') -> trksegType trkpt' extensions', \(TrksegType trkpt' extensions') -> (trkpt', extensions')) (xpPair+ (xpList (xpElem "trkpt" xpickle))+ (xpOption (xpElem "extensions" xpickle)))++instance Trkpts TrksegType where+ trkpts (TrksegType x _) = x++instance Extensions TrksegType where+ extensions (TrksegType _ x) = x
+ Data/Geo/GPX/WptType.hs view
@@ -0,0 +1,171 @@+-- | Complex Type: @wptType@ <http://www.topografix.com/GPX/1/1/#type_wptType>+module Data.Geo.GPX.WptType(+ WptType,+ wptType+ ) where++import Data.Geo.GPX.LatitudeType+import Data.Geo.GPX.LongitudeType+import Data.Geo.GPX.DegreesType+import Data.Geo.GPX.LinkType+import Data.Geo.GPX.FixType+import Data.Geo.GPX.DgpsStationType+import Data.Geo.GPX.ExtensionsType+import Data.Geo.GPX.Accessor.Lat+import Data.Geo.GPX.Accessor.Lon+import Data.Geo.GPX.Accessor.Ele+import Data.Geo.GPX.Accessor.Time+import Data.Geo.GPX.Accessor.Magvar+import Data.Geo.GPX.Accessor.Geoidheight+import Data.Geo.GPX.Accessor.Name+import Data.Geo.GPX.Accessor.Cmt+import Data.Geo.GPX.Accessor.Desc+import Data.Geo.GPX.Accessor.Src+import Data.Geo.GPX.Accessor.Links+import Data.Geo.GPX.Accessor.Sym+import Data.Geo.GPX.Accessor.Type+import Data.Geo.GPX.Accessor.Fix+import Data.Geo.GPX.Accessor.Sat+import Data.Geo.GPX.Accessor.Hdop+import Data.Geo.GPX.Accessor.Vdop+import Data.Geo.GPX.Accessor.Pdop+import Data.Geo.GPX.Accessor.Ageofdgpsdata+import Data.Geo.GPX.Accessor.Dgpsid+import Data.Geo.GPX.Accessor.Extensions+import Text.XML.HXT.Arrow+import Text.XML.HXT.Extras++data WptType = WptType LatitudeType+ LongitudeType+ (Maybe Double)+ (Maybe String)+ (Maybe DegreesType)+ (Maybe Double)+ (Maybe String)+ (Maybe String)+ (Maybe String)+ (Maybe String)+ [LinkType]+ (Maybe String)+ (Maybe String)+ (Maybe FixType)+ (Maybe Int)+ (Maybe Double)+ (Maybe Double)+ (Maybe Double)+ (Maybe Double)+ (Maybe DgpsStationType)+ (Maybe ExtensionsType)+ deriving (Eq, Show)++wptType :: LatitudeType -- ^ The lat.+ -> LongitudeType -- ^ The lon.+ -> Maybe Double -- ^ The ele.+ -> Maybe String -- ^ The time.+ -> Maybe DegreesType -- ^ The magvar.+ -> Maybe Double -- ^ The geoidheight.+ -> Maybe String -- ^ The name.+ -> Maybe String -- ^ The cmt.+ -> Maybe String -- ^ The desc.+ -> Maybe String -- ^ The src.+ -> [LinkType] -- ^ The links (link).+ -> Maybe String -- ^ The sym.+ -> Maybe String -- ^ The type.+ -> Maybe FixType -- ^ The fix.+ -> Maybe Int -- ^ The sat.+ -> Maybe Double -- ^ The hdop.+ -> Maybe Double -- ^ The vdop.+ -> Maybe Double -- ^ The pdop.+ -> Maybe Double -- ^ The ageofdgpsdata.+ -> Maybe DgpsStationType -- ^ The dgpsid.+ -> Maybe ExtensionsType -- ^ The extensions.+ -> WptType+wptType a b c d e f g h i j k l m n o p = WptType a b c d e f g h i j k l m n o (fmap abs p)++instance XmlPickler WptType where+ xpickle = xpWrap (\(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) -> wptType a b c d e f g h i j k l m n o p q r s t u,+ \(WptType a b c d e f g h i j k l m n o p q r s t u) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)) (xp21Tuple+ (xpAttr "lat" xpickle)+ (xpAttr "lon" xpickle)+ (xpOption (xpElem "ele" xpPrim))+ (xpOption (xpElem "time" xpText))+ (xpOption (xpElem "magvar" xpickle))+ (xpOption (xpElem "geoidheight" xpPrim))+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "cmt" xpText))+ (xpOption (xpElem "desc" xpText))+ (xpOption (xpElem "src" xpText))+ (xpList (xpElem "link" xpickle))+ (xpOption (xpElem "sym" xpText))+ (xpOption (xpElem "type" xpText))+ (xpOption (xpElem "fix" xpickle))+ (xpOption (xpElem "sat" xpPrim))+ (xpOption (xpElem "hdop" xpPrim))+ (xpOption (xpElem "vdop" xpPrim))+ (xpOption (xpElem "pdop" xpPrim))+ (xpOption (xpElem "ageofdgpsdata" xpPrim))+ (xpOption (xpElem "dgpsid" xpickle))+ (xpOption (xpElem "extensions" xpickle)))++instance Lat WptType where+ lat (WptType x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x++instance Lon WptType where+ lon (WptType _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x++instance Ele WptType where+ ele (WptType _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x++instance Time WptType where+ time (WptType _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x++instance Magvar WptType where+ magvar (WptType _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x++instance Geoidheight WptType where+ geoidheight (WptType _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x++instance Name WptType where+ name (WptType _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x++instance Cmt WptType where+ cmt (WptType _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _) = x++instance Desc WptType where+ desc (WptType _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _) = x++instance Src WptType where+ src (WptType _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _) = x++instance Links WptType where+ links (WptType _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _) = x++instance Sym WptType where+ sym (WptType _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _) = x++instance Type WptType where+ type' (WptType _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _) = x++instance Fix WptType where+ fix (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _) = x++instance Sat WptType where+ sat (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _) = x++instance Hdop WptType where+ hdop (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _) = x++instance Vdop WptType where+ vdop (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _) = x++instance Pdop WptType where+ pdop (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _) = x++instance Ageofdgpsdata WptType where+ ageofdgpsdata (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _) = x++instance Dgpsid WptType where+ dgpsid (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _) = x++instance Extensions WptType where+ extensions (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x) = x
+ GPX.cabal view
@@ -0,0 +1,94 @@+Name: GPX+Version: 0.1+License: BSD3+License-File: LICENSE+Synopsis: Parse GPX files+Description: Parse GPS Exchange (GPX) files using HXT into data structures.+Homepage: http://code.google.com/p/geo-gpx/+Category: Utils+Author: Tony Morris+Maintainer: code@tmorris.net+Copyright: 2009 Tony Morris+build-type: Simple+cabal-version: >= 1.2++Flag small_base+ Description: Choose the new, split-up base package.++Library+ if flag(small_base)+ Build-Depends: base < 4 && >= 3, hxt, hxt-extras, containers+ else+ Build-Depends: base < 3, hxt, hxt-extras, containers++ GHC-Options: -Wall+ Exposed-Modules: Data.Geo.GPX+ Data.Geo.GPX.DgpsStationType+ Data.Geo.GPX.FixType+ Data.Geo.GPX.DegreesType+ Data.Geo.GPX.LongitudeType+ Data.Geo.GPX.LatitudeType+ Data.Geo.GPX.BoundsType+ Data.Geo.GPX.ExtensionsType+ Data.Geo.GPX.PtType+ Data.Geo.GPX.PtsegType+ Data.Geo.GPX.EmailType+ Data.Geo.GPX.LinkType+ Data.Geo.GPX.PersonType+ Data.Geo.GPX.CopyrightType+ Data.Geo.GPX.WptType+ Data.Geo.GPX.TrksegType+ Data.Geo.GPX.TrkType+ Data.Geo.GPX.RteType+ Data.Geo.GPX.MetadataType+ Data.Geo.GPX.GpxType+ Data.Geo.GPX.Gpx+ Data.Geo.GPX.Accessor.Minlat+ Data.Geo.GPX.Accessor.Maxlat+ Data.Geo.GPX.Accessor.Minlon+ Data.Geo.GPX.Accessor.Maxlon+ Data.Geo.GPX.Accessor.Author+ Data.Geo.GPX.Accessor.Year+ Data.Geo.GPX.Accessor.License+ Data.Geo.GPX.Accessor.Value+ Data.Geo.GPX.Accessor.Id+ Data.Geo.GPX.Accessor.Domain+ Data.Geo.GPX.Accessor.Version+ Data.Geo.GPX.Accessor.Creator+ Data.Geo.GPX.Accessor.Metadata+ Data.Geo.GPX.Accessor.Wpts+ Data.Geo.GPX.Accessor.Rtes+ Data.Geo.GPX.Accessor.Trks+ Data.Geo.GPX.Accessor.Extensions+ Data.Geo.GPX.Accessor.Href+ Data.Geo.GPX.Accessor.Text+ Data.Geo.GPX.Accessor.Type+ Data.Geo.GPX.Accessor.Name+ Data.Geo.GPX.Accessor.Desc+ Data.Geo.GPX.Accessor.Copyright+ Data.Geo.GPX.Accessor.Links+ Data.Geo.GPX.Accessor.Time+ Data.Geo.GPX.Accessor.Keywords+ Data.Geo.GPX.Accessor.Bounds+ Data.Geo.GPX.Accessor.Lat+ Data.Geo.GPX.Accessor.Lon+ Data.Geo.GPX.Accessor.Ele+ Data.Geo.GPX.Accessor.Magvar+ Data.Geo.GPX.Accessor.Geoidheight+ Data.Geo.GPX.Accessor.Cmt+ Data.Geo.GPX.Accessor.Src+ Data.Geo.GPX.Accessor.Sym+ Data.Geo.GPX.Accessor.Fix+ Data.Geo.GPX.Accessor.Sat+ Data.Geo.GPX.Accessor.Hdop+ Data.Geo.GPX.Accessor.Vdop+ Data.Geo.GPX.Accessor.Pdop+ Data.Geo.GPX.Accessor.Ageofdgpsdata+ Data.Geo.GPX.Accessor.Dgpsid+ Data.Geo.GPX.Accessor.Email+ Data.Geo.GPX.Accessor.Link+ Data.Geo.GPX.Accessor.Pts+ Data.Geo.GPX.Accessor.Number+ Data.Geo.GPX.Accessor.Rtepts+ Data.Geo.GPX.Accessor.Trkpts+ Data.Geo.GPX.Accessor.Trksegs
+ LICENSE view
@@ -0,0 +1,27 @@+Copyright 2009 Tony Morris++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions+are met:+1. Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.+2. Redistributions in binary form must reproduce the above copyright+ notice, this list of conditions and the following disclaimer in the+ documentation and/or other materials provided with the distribution.+3. Neither the name of the author nor the names of his contributors+ may be used to endorse or promote products derived from this software+ without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF+SUCH DAMAGE.
+ Setup.lhs view
@@ -0,0 +1,3 @@+#!/usr/bin/env runhaskell+> import Distribution.Simple+> main = defaultMain