GPX 0.3 → 0.4.1
raw patch · 69 files changed
+172/−18 lines, 69 filesdep +xsdPVP ok
version bump matches the API change (PVP)
Dependencies added: xsd
API changes (from Hackage documentation)
- Data.Geo.GPX.Accessor.Latlon: instance (Real a, Real b) => Latlon (a, b)
+ Data.Geo.GPX.Accessor.Ageofdgpsdata: setAgeofdgpsdata :: (Ageofdgpsdata a) => Maybe Double -> a -> a
+ Data.Geo.GPX.Accessor.Author: setAuthor :: (Author a b) => b -> a -> a
+ Data.Geo.GPX.Accessor.Bounds: setBounds :: (Bounds a) => Maybe BoundsType -> a -> a
+ Data.Geo.GPX.Accessor.Cmt: setCmt :: (Cmt a) => Maybe String -> a -> a
+ Data.Geo.GPX.Accessor.Copyright: setCopyright :: (Copyright a) => Maybe CopyrightType -> a -> a
+ Data.Geo.GPX.Accessor.Creator: setCreator :: (Creator a) => String -> a -> a
+ Data.Geo.GPX.Accessor.Desc: setDesc :: (Desc a) => Maybe String -> a -> a
+ Data.Geo.GPX.Accessor.Dgpsid: setDgpsid :: (Dgpsid a) => Maybe DgpsStationType -> a -> a
+ Data.Geo.GPX.Accessor.Domain: setDomain :: (Domain a) => String -> a -> a
+ Data.Geo.GPX.Accessor.Ele: setEle :: (Ele a) => Maybe Double -> a -> a
+ Data.Geo.GPX.Accessor.Email: setEmail :: (Email a) => Maybe EmailType -> a -> a
+ Data.Geo.GPX.Accessor.Extensions: setExtensions :: (Extensions a) => Maybe ExtensionsType -> a -> a
+ Data.Geo.GPX.Accessor.Fix: setFix :: (Fix a) => Maybe FixType -> a -> a
+ Data.Geo.GPX.Accessor.Geoidheight: setGeoidheight :: (Geoidheight a) => Maybe Double -> a -> a
+ Data.Geo.GPX.Accessor.Hdop: setHdop :: (Hdop a) => Maybe Double -> a -> a
+ Data.Geo.GPX.Accessor.Href: setHref :: (Href a) => String -> a -> a
+ Data.Geo.GPX.Accessor.Id: setId :: (Id a) => String -> a -> a
+ Data.Geo.GPX.Accessor.Keywords: setKeywords :: (Keywords a) => Maybe String -> a -> a
+ Data.Geo.GPX.Accessor.Lat: setLat :: (Lat a) => LatitudeType -> a -> a
+ Data.Geo.GPX.Accessor.Latlon: setLatlon :: (Latlon a) => (Double, Double) -> a -> a
+ Data.Geo.GPX.Accessor.License: setLicense :: (License a) => Maybe String -> a -> a
+ Data.Geo.GPX.Accessor.Link: setLink :: (Link a) => Maybe LinkType -> a -> a
+ Data.Geo.GPX.Accessor.Links: setLinks :: (Links a) => [LinkType] -> a -> a
+ Data.Geo.GPX.Accessor.Lon: setLon :: (Lon a) => LongitudeType -> a -> a
+ Data.Geo.GPX.Accessor.Magvar: setMagvar :: (Magvar a) => Maybe DegreesType -> a -> a
+ Data.Geo.GPX.Accessor.Maxlat: setMaxlat :: (Maxlat a) => LatitudeType -> a -> a
+ Data.Geo.GPX.Accessor.Maxlon: setMaxlon :: (Maxlon a) => LongitudeType -> a -> a
+ Data.Geo.GPX.Accessor.Metadata: setMetadata :: (Metadata a) => Maybe MetadataType -> a -> a
+ Data.Geo.GPX.Accessor.Minlat: setMinlat :: (Minlat a) => LatitudeType -> a -> a
+ Data.Geo.GPX.Accessor.Minlon: setMinlon :: (Minlon a) => LongitudeType -> a -> a
+ Data.Geo.GPX.Accessor.Name: setName :: (Name a) => Maybe String -> a -> a
+ Data.Geo.GPX.Accessor.Number: setNumber :: (Number a) => Maybe Int -> a -> a
+ Data.Geo.GPX.Accessor.Pdop: setPdop :: (Pdop a) => Maybe Double -> a -> a
+ Data.Geo.GPX.Accessor.Pts: setPts :: (Pts a) => [PtType] -> a -> a
+ Data.Geo.GPX.Accessor.Rtepts: setRtepts :: (Rtepts a) => [WptType] -> a -> a
+ Data.Geo.GPX.Accessor.Rtes: setRtes :: (Rtes a) => [RteType] -> a -> a
+ Data.Geo.GPX.Accessor.Sat: setSat :: (Sat a) => Maybe Int -> a -> a
+ Data.Geo.GPX.Accessor.Src: setSrc :: (Src a) => Maybe String -> a -> a
+ Data.Geo.GPX.Accessor.Sym: setSym :: (Sym a) => Maybe String -> a -> a
+ Data.Geo.GPX.Accessor.Text: setText :: (Text a) => Maybe String -> a -> a
+ Data.Geo.GPX.Accessor.Time: setTime :: (Time a) => Maybe DateTime -> a -> a
+ Data.Geo.GPX.Accessor.Trkpts: setTrkpts :: (Trkpts a) => [WptType] -> a -> a
+ Data.Geo.GPX.Accessor.Trks: setTrks :: (Trks a) => [TrkType] -> a -> a
+ Data.Geo.GPX.Accessor.Trksegs: setTrksegs :: (Trksegs a) => [TrksegType] -> a -> a
+ Data.Geo.GPX.Accessor.Type: setType :: (Type a) => Maybe String -> a -> a
+ Data.Geo.GPX.Accessor.Value: setValue :: (Value a b) => b -> a -> a
+ Data.Geo.GPX.Accessor.Vdop: setVdop :: (Vdop a) => Maybe Double -> a -> a
+ Data.Geo.GPX.Accessor.Version: setVersion :: (Version a) => String -> a -> a
+ Data.Geo.GPX.Accessor.Wpts: setWpts :: (Wpts a) => [WptType] -> a -> a
+ Data.Geo.GPX.Accessor.Year: setYear :: (Year a) => Maybe String -> a -> a
+ Data.Geo.GPX.Gpx: readGpxFiles :: [FilePath] -> IO [Gpx]
- Data.Geo.GPX.Accessor.Time: time :: (Time a) => a -> Maybe String
+ Data.Geo.GPX.Accessor.Time: time :: (Time a) => a -> Maybe DateTime
- Data.Geo.GPX.MetadataType: metadataType :: Maybe String -> Maybe String -> Maybe PersonType -> Maybe CopyrightType -> [LinkType] -> Maybe String -> Maybe String -> Maybe BoundsType -> Maybe ExtensionsType -> MetadataType
+ Data.Geo.GPX.MetadataType: metadataType :: Maybe String -> Maybe String -> Maybe PersonType -> Maybe CopyrightType -> [LinkType] -> Maybe DateTime -> Maybe String -> Maybe BoundsType -> Maybe ExtensionsType -> MetadataType
- Data.Geo.GPX.PtType: ptType :: LatitudeType -> LongitudeType -> Maybe Double -> Maybe String -> PtType
+ Data.Geo.GPX.PtType: ptType :: LatitudeType -> LongitudeType -> Maybe Double -> Maybe DateTime -> PtType
- Data.Geo.GPX.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 -> WptType
+ Data.Geo.GPX.WptType: wptType :: LatitudeType -> LongitudeType -> Maybe Double -> Maybe DateTime -> 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 -> WptType
Files
- Data/Geo/GPX/Accessor/Ageofdgpsdata.hs +1/−0
- Data/Geo/GPX/Accessor/Author.hs +1/−0
- Data/Geo/GPX/Accessor/Bounds.hs +1/−0
- Data/Geo/GPX/Accessor/Cmt.hs +1/−0
- Data/Geo/GPX/Accessor/Copyright.hs +1/−0
- Data/Geo/GPX/Accessor/Creator.hs +1/−0
- Data/Geo/GPX/Accessor/Desc.hs +1/−0
- Data/Geo/GPX/Accessor/Dgpsid.hs +1/−0
- Data/Geo/GPX/Accessor/Domain.hs +1/−0
- Data/Geo/GPX/Accessor/Ele.hs +1/−0
- Data/Geo/GPX/Accessor/Email.hs +1/−0
- Data/Geo/GPX/Accessor/Extensions.hs +1/−0
- Data/Geo/GPX/Accessor/Fix.hs +1/−0
- Data/Geo/GPX/Accessor/Geoidheight.hs +1/−0
- Data/Geo/GPX/Accessor/Hdop.hs +1/−0
- Data/Geo/GPX/Accessor/Href.hs +1/−0
- Data/Geo/GPX/Accessor/Id.hs +1/−0
- Data/Geo/GPX/Accessor/Keywords.hs +1/−0
- Data/Geo/GPX/Accessor/Lat.hs +1/−0
- Data/Geo/GPX/Accessor/Latlon.hs +1/−3
- Data/Geo/GPX/Accessor/License.hs +1/−0
- Data/Geo/GPX/Accessor/Link.hs +1/−0
- Data/Geo/GPX/Accessor/Links.hs +1/−0
- Data/Geo/GPX/Accessor/Lon.hs +1/−0
- Data/Geo/GPX/Accessor/Magvar.hs +1/−0
- Data/Geo/GPX/Accessor/Maxlat.hs +1/−0
- Data/Geo/GPX/Accessor/Maxlon.hs +2/−0
- Data/Geo/GPX/Accessor/Metadata.hs +1/−0
- Data/Geo/GPX/Accessor/Minlat.hs +1/−0
- Data/Geo/GPX/Accessor/Minlon.hs +1/−0
- Data/Geo/GPX/Accessor/Name.hs +1/−0
- Data/Geo/GPX/Accessor/Number.hs +1/−0
- Data/Geo/GPX/Accessor/Pdop.hs +1/−0
- Data/Geo/GPX/Accessor/Pts.hs +1/−0
- Data/Geo/GPX/Accessor/Rtepts.hs +1/−0
- Data/Geo/GPX/Accessor/Rtes.hs +1/−0
- Data/Geo/GPX/Accessor/Sat.hs +1/−0
- Data/Geo/GPX/Accessor/Src.hs +1/−0
- Data/Geo/GPX/Accessor/Sym.hs +1/−0
- Data/Geo/GPX/Accessor/Text.hs +1/−0
- Data/Geo/GPX/Accessor/Time.hs +4/−1
- Data/Geo/GPX/Accessor/Trkpts.hs +1/−0
- Data/Geo/GPX/Accessor/Trks.hs +1/−0
- Data/Geo/GPX/Accessor/Trksegs.hs +1/−0
- Data/Geo/GPX/Accessor/Type.hs +1/−0
- Data/Geo/GPX/Accessor/Value.hs +1/−0
- Data/Geo/GPX/Accessor/Vdop.hs +1/−0
- Data/Geo/GPX/Accessor/Version.hs +1/−0
- Data/Geo/GPX/Accessor/Wpts.hs +1/−0
- Data/Geo/GPX/Accessor/Year.hs +1/−0
- Data/Geo/GPX/BoundsType.hs +4/−0
- Data/Geo/GPX/CopyrightType.hs +3/−0
- Data/Geo/GPX/DegreesType.hs +1/−0
- Data/Geo/GPX/DgpsStationType.hs +2/−0
- Data/Geo/GPX/EmailType.hs +2/−0
- Data/Geo/GPX/ExtensionsType.hs +1/−0
- Data/Geo/GPX/Gpx.hs +9/−1
- Data/Geo/GPX/GpxType.hs +17/−0
- Data/Geo/GPX/LatitudeType.hs +1/−0
- Data/Geo/GPX/LongitudeType.hs +1/−0
- Data/Geo/GPX/MetadataType.hs +13/−3
- Data/Geo/GPX/PersonType.hs +3/−0
- Data/Geo/GPX/PtType.hs +8/−3
- Data/Geo/GPX/PtsegType.hs +1/−0
- Data/Geo/GPX/RteType.hs +9/−0
- Data/Geo/GPX/TrkType.hs +11/−0
- Data/Geo/GPX/TrksegType.hs +2/−0
- Data/Geo/GPX/WptType.hs +27/−4
- GPX.cabal +3/−3
Data/Geo/GPX/Accessor/Ageofdgpsdata.hs view
@@ -2,3 +2,4 @@ class Ageofdgpsdata a where ageofdgpsdata :: a -> Maybe Double+ setAgeofdgpsdata :: Maybe Double -> a -> a
Data/Geo/GPX/Accessor/Author.hs view
@@ -4,3 +4,4 @@ class Author a b | a -> b where author :: a -> b+ setAuthor :: b -> a -> a
Data/Geo/GPX/Accessor/Bounds.hs view
@@ -4,3 +4,4 @@ class Bounds a where bounds :: a -> Maybe BoundsType+ setBounds :: Maybe BoundsType -> a -> a
Data/Geo/GPX/Accessor/Cmt.hs view
@@ -2,3 +2,4 @@ class Cmt a where cmt :: a -> Maybe String+ setCmt :: Maybe String -> a -> a
Data/Geo/GPX/Accessor/Copyright.hs view
@@ -4,3 +4,4 @@ class Copyright a where copyright :: a -> Maybe CopyrightType+ setCopyright :: Maybe CopyrightType -> a -> a
Data/Geo/GPX/Accessor/Creator.hs view
@@ -2,3 +2,4 @@ class Creator a where creator :: a -> String+ setCreator :: String -> a -> a
Data/Geo/GPX/Accessor/Desc.hs view
@@ -2,3 +2,4 @@ class Desc a where desc :: a -> Maybe String+ setDesc :: Maybe String -> a -> a
Data/Geo/GPX/Accessor/Dgpsid.hs view
@@ -4,3 +4,4 @@ class Dgpsid a where dgpsid :: a -> Maybe DgpsStationType+ setDgpsid :: Maybe DgpsStationType -> a -> a
Data/Geo/GPX/Accessor/Domain.hs view
@@ -2,3 +2,4 @@ class Domain a where domain :: a -> String+ setDomain :: String -> a -> a
Data/Geo/GPX/Accessor/Ele.hs view
@@ -2,3 +2,4 @@ class Ele a where ele :: a -> Maybe Double+ setEle :: Maybe Double -> a -> a
Data/Geo/GPX/Accessor/Email.hs view
@@ -4,3 +4,4 @@ class Email a where email :: a -> Maybe EmailType+ setEmail :: Maybe EmailType -> a -> a
Data/Geo/GPX/Accessor/Extensions.hs view
@@ -4,3 +4,4 @@ class Extensions a where extensions :: a -> Maybe ExtensionsType+ setExtensions :: Maybe ExtensionsType -> a -> a
Data/Geo/GPX/Accessor/Fix.hs view
@@ -4,3 +4,4 @@ class Fix a where fix :: a -> Maybe FixType+ setFix :: Maybe FixType -> a -> a
Data/Geo/GPX/Accessor/Geoidheight.hs view
@@ -2,3 +2,4 @@ class Geoidheight a where geoidheight :: a -> Maybe Double+ setGeoidheight :: Maybe Double -> a -> a
Data/Geo/GPX/Accessor/Hdop.hs view
@@ -2,3 +2,4 @@ class Hdop a where hdop :: a -> Maybe Double+ setHdop :: Maybe Double -> a -> a
Data/Geo/GPX/Accessor/Href.hs view
@@ -2,3 +2,4 @@ class Href a where href :: a -> String+ setHref :: String -> a -> a
Data/Geo/GPX/Accessor/Id.hs view
@@ -2,3 +2,4 @@ class Id a where id :: a -> String+ setId :: String -> a -> a
Data/Geo/GPX/Accessor/Keywords.hs view
@@ -2,3 +2,4 @@ class Keywords a where keywords :: a -> Maybe String+ setKeywords :: Maybe String -> a -> a
Data/Geo/GPX/Accessor/Lat.hs view
@@ -4,3 +4,4 @@ class Lat a where lat :: a -> LatitudeType+ setLat :: LatitudeType -> a -> a
Data/Geo/GPX/Accessor/Latlon.hs view
@@ -4,6 +4,4 @@ class Latlon a where latlon :: a -> (Double, Double)--instance (Real a, Real b) => Latlon (a, b) where- latlon (a, b) = (realToFrac a, realToFrac b)+ setLatlon :: (Double, Double) -> a -> a
Data/Geo/GPX/Accessor/License.hs view
@@ -2,3 +2,4 @@ class License a where license :: a -> Maybe String+ setLicense :: Maybe String -> a -> a
Data/Geo/GPX/Accessor/Link.hs view
@@ -4,3 +4,4 @@ class Link a where link :: a -> Maybe LinkType+ setLink :: Maybe LinkType -> a -> a
Data/Geo/GPX/Accessor/Links.hs view
@@ -4,3 +4,4 @@ class Links a where links :: a -> [LinkType]+ setLinks :: [LinkType] -> a -> a
Data/Geo/GPX/Accessor/Lon.hs view
@@ -4,3 +4,4 @@ class Lon a where lon :: a -> LongitudeType+ setLon :: LongitudeType -> a -> a
Data/Geo/GPX/Accessor/Magvar.hs view
@@ -4,3 +4,4 @@ class Magvar a where magvar :: a -> Maybe DegreesType+ setMagvar :: Maybe DegreesType -> a -> a
Data/Geo/GPX/Accessor/Maxlat.hs view
@@ -4,3 +4,4 @@ class Maxlat a where maxlat :: a -> LatitudeType+ setMaxlat :: LatitudeType -> a -> a
Data/Geo/GPX/Accessor/Maxlon.hs view
@@ -4,3 +4,5 @@ class Maxlon a where maxlon :: a -> LongitudeType+ setMaxlon :: LongitudeType -> a -> a+--
Data/Geo/GPX/Accessor/Metadata.hs view
@@ -4,3 +4,4 @@ class Metadata a where metadata :: a -> Maybe MetadataType+ setMetadata :: Maybe MetadataType -> a -> a
Data/Geo/GPX/Accessor/Minlat.hs view
@@ -4,3 +4,4 @@ class Minlat a where minlat :: a -> LatitudeType+ setMinlat :: LatitudeType -> a -> a
Data/Geo/GPX/Accessor/Minlon.hs view
@@ -4,3 +4,4 @@ class Minlon a where minlon :: a -> LongitudeType+ setMinlon :: LongitudeType -> a -> a
Data/Geo/GPX/Accessor/Name.hs view
@@ -2,3 +2,4 @@ class Name a where name :: a -> Maybe String+ setName :: Maybe String -> a -> a
Data/Geo/GPX/Accessor/Number.hs view
@@ -2,3 +2,4 @@ class Number a where number :: a -> Maybe Int+ setNumber :: Maybe Int -> a -> a
Data/Geo/GPX/Accessor/Pdop.hs view
@@ -2,3 +2,4 @@ class Pdop a where pdop :: a -> Maybe Double+ setPdop :: Maybe Double -> a -> a
Data/Geo/GPX/Accessor/Pts.hs view
@@ -4,3 +4,4 @@ class Pts a where pts :: a -> [PtType]+ setPts :: [PtType] -> a -> a
Data/Geo/GPX/Accessor/Rtepts.hs view
@@ -4,3 +4,4 @@ class Rtepts a where rtepts :: a -> [WptType]+ setRtepts :: [WptType] -> a -> a
Data/Geo/GPX/Accessor/Rtes.hs view
@@ -4,3 +4,4 @@ class Rtes a where rtes :: a -> [RteType]+ setRtes :: [RteType] -> a -> a
Data/Geo/GPX/Accessor/Sat.hs view
@@ -2,3 +2,4 @@ class Sat a where sat :: a -> Maybe Int+ setSat :: Maybe Int -> a -> a
Data/Geo/GPX/Accessor/Src.hs view
@@ -2,3 +2,4 @@ class Src a where src :: a -> Maybe String+ setSrc :: Maybe String -> a -> a
Data/Geo/GPX/Accessor/Sym.hs view
@@ -2,3 +2,4 @@ class Sym a where sym :: a -> Maybe String+ setSym :: Maybe String -> a -> a
Data/Geo/GPX/Accessor/Text.hs view
@@ -2,3 +2,4 @@ class Text a where text :: a -> Maybe String+ setText :: Maybe String -> a -> a
Data/Geo/GPX/Accessor/Time.hs view
@@ -1,4 +1,7 @@ module Data.Geo.GPX.Accessor.Time where +import Text.XML.XSD.DateTime+ class Time a where- time :: a -> Maybe String+ time :: a -> Maybe DateTime+ setTime :: Maybe DateTime -> a -> a
Data/Geo/GPX/Accessor/Trkpts.hs view
@@ -4,3 +4,4 @@ class Trkpts a where trkpts :: a -> [WptType]+ setTrkpts :: [WptType] -> a -> a
Data/Geo/GPX/Accessor/Trks.hs view
@@ -4,3 +4,4 @@ class Trks a where trks :: a -> [TrkType]+ setTrks :: [TrkType] -> a -> a
Data/Geo/GPX/Accessor/Trksegs.hs view
@@ -4,3 +4,4 @@ class Trksegs a where trksegs :: a -> [TrksegType]+ setTrksegs :: [TrksegType] -> a -> a
Data/Geo/GPX/Accessor/Type.hs view
@@ -2,3 +2,4 @@ class Type a where type' :: a -> Maybe String+ setType :: Maybe String -> a -> a
Data/Geo/GPX/Accessor/Value.hs view
@@ -4,3 +4,4 @@ class Value a b | a -> b where value :: a -> b+ setValue :: b -> a -> a
Data/Geo/GPX/Accessor/Vdop.hs view
@@ -2,3 +2,4 @@ class Vdop a where vdop :: a -> Maybe Double+ setVdop :: Maybe Double -> a -> a
Data/Geo/GPX/Accessor/Version.hs view
@@ -2,3 +2,4 @@ class Version a where version :: a -> String+ setVersion :: String -> a -> a
Data/Geo/GPX/Accessor/Wpts.hs view
@@ -4,3 +4,4 @@ class Wpts a where wpts :: a -> [WptType]+ setWpts :: [WptType] -> a -> a
Data/Geo/GPX/Accessor/Year.hs view
@@ -2,3 +2,4 @@ class Year a where year :: a -> Maybe String+ setYear :: Maybe String -> a -> a
Data/Geo/GPX/BoundsType.hs view
@@ -30,12 +30,16 @@ instance Minlat BoundsType where minlat (BoundsType (x, _) (_, _)) = x+ setMinlat a (BoundsType (_, b) (c, d)) = boundsType (a, b) (c, d) instance Maxlat BoundsType where maxlat (BoundsType (_, _) (x, _)) = x+ setMaxlat c (BoundsType (a, b) (_, d)) = boundsType (a, b) (c, d) instance Minlon BoundsType where minlon (BoundsType (_, x) (_, _)) = x+ setMinlon b (BoundsType (a, _) (c, d)) = boundsType (a, b) (c, d) instance Maxlon BoundsType where maxlon (BoundsType (_, _) (_, x)) = x+ setMaxlon d (BoundsType (a, b) (c, _)) = boundsType (a, b) (c, d)
Data/Geo/GPX/CopyrightType.hs view
@@ -28,9 +28,12 @@ instance Author CopyrightType String where author (CopyrightType x _ _) = x+ setAuthor x (CopyrightType _ y z) = copyrightType x y z instance Year CopyrightType where year (CopyrightType _ x _) = x+ setYear y (CopyrightType x _ z) = copyrightType x y z instance License CopyrightType where license (CopyrightType _ _ x) = x+ setLicense z (CopyrightType x y _) = copyrightType x y z
Data/Geo/GPX/DegreesType.hs view
@@ -22,3 +22,4 @@ instance Value DegreesType Double where value (DegreesType x) = x+ setValue x (DegreesType _) = degreesType x
Data/Geo/GPX/DgpsStationType.hs view
@@ -8,6 +8,7 @@ import Data.Geo.GPX.Accessor.Value import Data.Ix+import Data.Maybe import Text.XML.HXT.Arrow newtype DgpsStationType = DgpsStationType Int@@ -25,3 +26,4 @@ instance Value DgpsStationType Int where value (DgpsStationType x) = x+ setValue x (DgpsStationType _) = fromMaybe (error ("DgpsStationType " ++ show x ++ " out of range (0,1023)")) (dgpsStationType x)
Data/Geo/GPX/EmailType.hs view
@@ -22,6 +22,8 @@ instance Id EmailType where id (EmailType x _) = x+ setId a (EmailType _ b) = emailType a b instance Domain EmailType where domain (EmailType _ x) = x+ setDomain b (EmailType a _) = emailType a b
Data/Geo/GPX/ExtensionsType.hs view
@@ -21,3 +21,4 @@ instance Value ExtensionsType XmlTree where value (ExtensionsType x) = x+ setValue x (ExtensionsType _) = extensionsType x
Data/Geo/GPX/Gpx.hs view
@@ -4,10 +4,12 @@ module Data.Geo.GPX.Gpx( Gpx, gpx,- readGpxFile+ readGpxFile,+ readGpxFiles ) where import Text.XML.HXT.Arrow+import Control.Monad import Data.Geo.GPX.GpxType import Data.Geo.GPX.PersonType import Data.Geo.GPX.Accessor.Value@@ -34,6 +36,7 @@ instance Author Gpx (Maybe PersonType) where author = author . value+ setAuthor = (gpx .) . (. value) . setAuthor gpx :: GpxType -- ^ The gpx element contents. -> Gpx@@ -47,7 +50,12 @@ instance Value Gpx GpxType where value (Gpx x) = x+ setValue x (Gpx _) = gpx x -- | Reads a GPX file into a list of @Gpx@ values removing whitespace. readGpxFile :: FilePath -> IO [Gpx] readGpxFile = runX . xunpickleDocument (xpickle :: PU Gpx) [(a_remove_whitespace, v_1)]++-- | Reads 0 or more GPX files into a list of @Gpx@ values removing whitespace.+readGpxFiles :: [FilePath] -> IO [Gpx]+readGpxFiles = fmap join . (mapM readGpxFile)
Data/Geo/GPX/GpxType.hs view
@@ -59,51 +59,68 @@ instance Version GpxType where version (GpxType x _ _ _ _ _ _) = x+ setVersion a (GpxType _ b c d e f g) = gpxType a b c d e f g instance Creator GpxType where creator (GpxType _ x _ _ _ _ _) = x+ setCreator b (GpxType a _ c d e f g) = gpxType a b c d e f g instance Metadata GpxType where metadata (GpxType _ _ x _ _ _ _) = x+ setMetadata c (GpxType a b _ d e f g) = gpxType a b c d e f g instance Wpts GpxType where wpts (GpxType _ _ _ x _ _ _) = x+ setWpts d (GpxType a b c _ e f g) = gpxType a b c d e f g instance Rtes GpxType where rtes (GpxType _ _ _ _ x _ _) = x+ setRtes e (GpxType a b c d _ f g) = gpxType a b c d e f g instance Trks GpxType where trks (GpxType _ _ _ _ _ x _) = x+ setTrks f (GpxType a b c d e _ g) = gpxType a b c d e f g instance Extensions GpxType where extensions (GpxType _ _ _ _ _ _ x) = x+ setExtensions g (GpxType a b c d e f _) = gpxType a b c d e f g instance Name GpxType where name = (name =<<) . metadata+ setName x (GpxType a b c d e f g) = gpxType a b (fmap (setName x) c) d e f g instance Desc GpxType where desc = (desc =<<) . metadata+ setDesc x (GpxType a b c d e f g) = gpxType a b (fmap (setDesc x) c) d e f g instance Author GpxType (Maybe PersonType) where author = (author =<<) . metadata+ setAuthor x (GpxType a b c d e f g) = gpxType a b (fmap (setAuthor x) c) d e f g instance Copyright GpxType where copyright = (copyright =<<) . metadata+ setCopyright x (GpxType a b c d e f g) = gpxType a b (fmap (setCopyright x) c) d e f g instance Links GpxType where links = (links =<<) . maybeToList . metadata+ setLinks x (GpxType a b c d e f g) = gpxType a b (fmap (setLinks x) c) d e f g instance Time GpxType where time = (time =<<) . metadata+ setTime x (GpxType a b c d e f g) = gpxType a b (fmap (setTime x) c) d e f g instance Keywords GpxType where keywords = (keywords =<<) . metadata+ setKeywords x (GpxType a b c d e f g) = gpxType a b (fmap (setKeywords x) c) d e f g instance Bounds GpxType where bounds = (bounds =<<) . metadata+ setBounds x (GpxType a b c d e f g) = gpxType a b (fmap (setBounds x) c) d e f g instance Rtepts GpxType where rtepts = (rtepts =<<) . rtes+ setRtepts x (GpxType a b c d e f g) = gpxType a b c d (fmap (setRtepts x) e) f g instance Trkpts GpxType where trkpts = (trkpts =<<) . trks+ setTrkpts x (GpxType a b c d e f g) = gpxType a b c d e (fmap (setTrkpts x) f) g
Data/Geo/GPX/LatitudeType.hs view
@@ -25,3 +25,4 @@ instance Value LatitudeType Double where value (LatitudeType x) = x+ setValue x (LatitudeType _) = latitudeType x
Data/Geo/GPX/LongitudeType.hs view
@@ -25,3 +25,4 @@ instance Value LongitudeType Double where value (LongitudeType x) = x+ setValue x (LongitudeType _) = longitudeType x
Data/Geo/GPX/MetadataType.hs view
@@ -22,8 +22,9 @@ import Data.Geo.GPX.Accessor.Extensions import Text.XML.HXT.Arrow import Text.XML.HXT.Extras+import Text.XML.XSD.DateTime -data MetadataType = MetadataType (Maybe String) (Maybe String) (Maybe PersonType) (Maybe CopyrightType) [LinkType] (Maybe String) (Maybe String) (Maybe BoundsType) (Maybe ExtensionsType)+data MetadataType = MetadataType (Maybe String) (Maybe String) (Maybe PersonType) (Maybe CopyrightType) [LinkType] (Maybe DateTime) (Maybe String) (Maybe BoundsType) (Maybe ExtensionsType) deriving (Eq, Show) metadataType :: Maybe String -- ^ The name.@@ -31,7 +32,7 @@ -> Maybe PersonType -- ^ The author. -> Maybe CopyrightType -- ^ The copyright. -> [LinkType] -- ^ The links (link).- -> Maybe String -- ^ The time.+ -> Maybe DateTime -- ^ The time. -> Maybe String -- ^ The keywords. -> Maybe BoundsType -- ^ The bounds. -> Maybe ExtensionsType -- ^ The extensions@@ -45,34 +46,43 @@ (xpOption (xpElem "author" xpickle)) (xpOption (xpElem "copyright" xpickle)) (xpList (xpElem "link" xpickle))- (xpOption (xpElem "time" xpText))+ (xpOption (xpElem "time" (xpWrapMaybe (dateTime, show) xpText))) (xpOption (xpElem "keywords" xpText)) (xpOption (xpElem "bounds" xpickle)) (xpOption (xpElem "extensions" xpickle))) instance Name MetadataType where name (MetadataType x _ _ _ _ _ _ _ _) = x+ setName a (MetadataType _ b c d e f g h i) = metadataType a b c d e f g h i instance Desc MetadataType where desc (MetadataType _ x _ _ _ _ _ _ _) = x+ setDesc b (MetadataType a _ c d e f g h i) = metadataType a b c d e f g h i instance Author MetadataType (Maybe PersonType) where author (MetadataType _ _ x _ _ _ _ _ _) = x+ setAuthor c (MetadataType a b _ d e f g h i) = metadataType a b c d e f g h i instance Copyright MetadataType where copyright (MetadataType _ _ _ x _ _ _ _ _) = x+ setCopyright d (MetadataType a b c _ e f g h i) = metadataType a b c d e f g h i instance Links MetadataType where links (MetadataType _ _ _ _ x _ _ _ _) = x+ setLinks e (MetadataType a b c d _ f g h i) = metadataType a b c d e f g h i instance Time MetadataType where time (MetadataType _ _ _ _ _ x _ _ _) = x+ setTime f (MetadataType a b c d e _ g h i) = metadataType a b c d e f g h i instance Keywords MetadataType where keywords (MetadataType _ _ _ _ _ _ x _ _) = x+ setKeywords g (MetadataType a b c d e f _ h i) = metadataType a b c d e f g h i instance Bounds MetadataType where bounds (MetadataType _ _ _ _ _ _ _ x _) = x+ setBounds h (MetadataType a b c d e f g _ i) = metadataType a b c d e f g h i instance Extensions MetadataType where extensions (MetadataType _ _ _ _ _ _ _ _ x) = x+ setExtensions i (MetadataType a b c d e f g h _) = metadataType a b c d e f g h i
Data/Geo/GPX/PersonType.hs view
@@ -28,9 +28,12 @@ instance Name PersonType where name (PersonType x _ _) = x+ setName a (PersonType _ b c) = personType a b c instance Email PersonType where email (PersonType _ x _) = x+ setEmail b (PersonType a _ c) = personType a b c instance Link PersonType where link (PersonType _ _ x) = x+ setLink c (PersonType a b _) = personType a b c
Data/Geo/GPX/PtType.hs view
@@ -11,14 +11,15 @@ import Data.Geo.GPX.Accessor.Ele import Data.Geo.GPX.Accessor.Time import Text.XML.HXT.Arrow+import Text.XML.XSD.DateTime -data PtType = PtType LatitudeType LongitudeType (Maybe Double) (Maybe String)+data PtType = PtType LatitudeType LongitudeType (Maybe Double) (Maybe DateTime) deriving (Eq, Show) ptType :: LatitudeType -- ^ The lat. -> LongitudeType -- ^ The lon. -> Maybe Double -- ^ The ele.- -> Maybe String -- ^ The time.+ -> Maybe DateTime -- ^ The time. -> PtType ptType = PtType @@ -28,16 +29,20 @@ (xpAttr "lat" xpickle) (xpAttr "lon" xpickle) (xpOption (xpElem "ele" xpPrim))- (xpOption (xpElem "time" xpText)))+ (xpOption (xpElem "time" (xpWrapMaybe (dateTime, show) xpText)))) instance Lat PtType where lat (PtType x _ _ _) = x+ setLat a (PtType _ b c d) = ptType a b c d instance Lon PtType where lon (PtType _ x _ _) = x+ setLon b (PtType a _ c d) = ptType a b c d instance Ele PtType where ele (PtType _ _ x _) = x+ setEle c (PtType a b _ d) = ptType a b c d instance Time PtType where time (PtType _ _ _ x) = x+ setTime d (PtType a b c _) = ptType a b c d
Data/Geo/GPX/PtsegType.hs view
@@ -20,3 +20,4 @@ instance Pts PtsegType where pts (PtsegType x) = x+ setPts x (PtsegType _) = ptsegType x
Data/Geo/GPX/RteType.hs view
@@ -48,27 +48,36 @@ instance Name RteType where name (RteType x _ _ _ _ _ _ _ _) = x+ setName a (RteType _ b c d e f g h i) = rteType a b c d e f g h i instance Cmt RteType where cmt (RteType _ x _ _ _ _ _ _ _) = x+ setCmt b (RteType a _ c d e f g h i) = rteType a b c d e f g h i instance Desc RteType where desc (RteType _ _ x _ _ _ _ _ _) = x+ setDesc c (RteType a b _ d e f g h i) = rteType a b c d e f g h i instance Src RteType where src (RteType _ _ _ x _ _ _ _ _) = x+ setSrc d (RteType a b c _ e f g h i) = rteType a b c d e f g h i instance Links RteType where links (RteType _ _ _ _ x _ _ _ _) = x+ setLinks e (RteType a b c d _ f g h i) = rteType a b c d e f g h i instance Number RteType where number (RteType _ _ _ _ _ x _ _ _) = x+ setNumber f (RteType a b c d e _ g h i) = rteType a b c d e f g h i instance Type RteType where type' (RteType _ _ _ _ _ _ x _ _) = x+ setType g (RteType a b c d e f _ h i) = rteType a b c d e f g h i instance Extensions RteType where extensions (RteType _ _ _ _ _ _ _ x _) = x+ setExtensions h (RteType a b c d e f g _ i) = rteType a b c d e f g h i instance Rtepts RteType where rtepts (RteType _ _ _ _ _ _ _ _ x) = x+ setRtepts i (RteType a b c d e f g h _) = rteType a b c d e f g h i
Data/Geo/GPX/TrkType.hs view
@@ -49,30 +49,41 @@ instance Name TrkType where name (TrkType x _ _ _ _ _ _ _ _) = x+ setName a (TrkType _ b c d e f g h i) = trkType a b c d e f g h i instance Cmt TrkType where cmt (TrkType _ x _ _ _ _ _ _ _) = x+ setCmt b (TrkType a _ c d e f g h i) = trkType a b c d e f g h i instance Desc TrkType where desc (TrkType _ _ x _ _ _ _ _ _) = x+ setDesc c (TrkType a b _ d e f g h i) = trkType a b c d e f g h i instance Src TrkType where src (TrkType _ _ _ x _ _ _ _ _) = x+ setSrc d (TrkType a b c _ e f g h i) = trkType a b c d e f g h i instance Links TrkType where links (TrkType _ _ _ _ x _ _ _ _) = x+ setLinks e (TrkType a b c d _ f g h i) = trkType a b c d e f g h i instance Number TrkType where number (TrkType _ _ _ _ _ x _ _ _) = x+ setNumber f (TrkType a b c d e _ g h i) = trkType a b c d e f g h i instance Type TrkType where type' (TrkType _ _ _ _ _ _ x _ _) = x+ setType g (TrkType a b c d e f _ h i) = trkType a b c d e f g h i instance Extensions TrkType where extensions (TrkType _ _ _ _ _ _ _ x _) = x+ setExtensions h (TrkType a b c d e f g _ i) = trkType a b c d e f g h i instance Trksegs TrkType where trksegs (TrkType _ _ _ _ _ _ _ _ x) = x+ setTrksegs i (TrkType a b c d e f g h _) = trkType a b c d e f g h i instance Trkpts TrkType where trkpts = (trkpts =<<) . trksegs+ setTrkpts x (TrkType a b c d e f g h i) = trkType a b c d e f g h (fmap (setTrkpts x) i)+
Data/Geo/GPX/TrksegType.hs view
@@ -25,6 +25,8 @@ instance Trkpts TrksegType where trkpts (TrksegType x _) = x+ setTrkpts a (TrksegType _ b) = trksegType a b instance Extensions TrksegType where extensions (TrksegType _ x) = x+ setExtensions b (TrksegType a _) = trksegType a b
Data/Geo/GPX/WptType.hs view
@@ -36,11 +36,12 @@ import Data.Geo.GPX.Accessor.Value import Text.XML.HXT.Arrow import Text.XML.HXT.Extras+import Text.XML.XSD.DateTime data WptType = WptType LatitudeType LongitudeType (Maybe Double)- (Maybe String)+ (Maybe DateTime) (Maybe DegreesType) (Maybe Double) (Maybe String)@@ -63,7 +64,7 @@ wptType :: LatitudeType -- ^ The lat. -> LongitudeType -- ^ The lon. -> Maybe Double -- ^ The ele.- -> Maybe String -- ^ The time.+ -> Maybe DateTime -- ^ The time. -> Maybe DegreesType -- ^ The magvar. -> Maybe Double -- ^ The geoidheight. -> Maybe String -- ^ The name.@@ -90,7 +91,7 @@ (xpAttr "lat" xpickle) (xpAttr "lon" xpickle) (xpOption (xpElem "ele" xpPrim))- (xpOption (xpElem "time" xpText))+ (xpOption (xpElem "time" (xpWrapMaybe (dateTime, show) xpText))) (xpOption (xpElem "magvar" xpickle)) (xpOption (xpElem "geoidheight" xpPrim)) (xpOption (xpElem "name" xpText))@@ -111,66 +112,88 @@ instance Lat WptType where lat (WptType x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x+ setLat a (WptType _ 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 instance Lon WptType where lon (WptType _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x+ setLon b (WptType a _ 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 instance Ele WptType where ele (WptType _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x+ setEle c (WptType a b _ 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 instance Time WptType where time (WptType _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x+ setTime d (WptType a b c _ 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 instance Magvar WptType where magvar (WptType _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x+ setMagvar e (WptType a b c d _ 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 instance Geoidheight WptType where geoidheight (WptType _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x+ setGeoidheight f (WptType a b c d e _ 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 instance Name WptType where name (WptType _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x+ setName g (WptType a b c d e f _ 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 instance Cmt WptType where cmt (WptType _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _) = x+ setCmt h (WptType a b c d e f g _ 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 instance Desc WptType where desc (WptType _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _) = x+ setDesc i (WptType a b c d e f g h _ 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 instance Src WptType where src (WptType _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _) = x+ setSrc j (WptType a b c d e f g h i _ 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 instance Links WptType where links (WptType _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _) = x+ setLinks k (WptType a b c d e f g h i j _ 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 instance Sym WptType where sym (WptType _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _) = x+ setSym l (WptType a b c d e f g h i j k _ 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 instance Type WptType where type' (WptType _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _) = x+ setType m (WptType a b c d e f g h i j k l _ 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 instance Fix WptType where fix (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _) = x+ setFix n (WptType a b c d e f g h i j k l m _ 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 instance Sat WptType where sat (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _) = x+ setSat o (WptType a b c d e f g h i j k l m n _ 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 instance Hdop WptType where hdop (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _) = x+ setHdop p (WptType a b c d e f g h i j k l m n o _ 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 instance Vdop WptType where vdop (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _) = x+ setVdop q (WptType a b c d e f g h i j k l m n o p _ 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 instance Pdop WptType where pdop (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _) = x+ setPdop r (WptType a b c d e f g h i j k l m n o p q _ 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 instance Ageofdgpsdata WptType where ageofdgpsdata (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _) = x-+ setAgeofdgpsdata s (WptType a b c d e f g h i j k l m n o p q r _ t u) = wptType a b c d e f g h i j k l m n o p q r s t u+-- instance Dgpsid WptType where dgpsid (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _) = x+ setDgpsid t (WptType a b c d e f g h i j k l m n o p q r s _ u) = wptType a b c d e f g h i j k l m n o p q r s t u instance Extensions WptType where extensions (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x) = x+ setExtensions u (WptType a b c d e f g h i j k l m n o p q r s t _) = wptType a b c d e f g h i j k l m n o p q r s t u instance Latlon WptType where latlon e = (value (lat e), value (lon e))+ setLatlon (a, b) (WptType _ _ c d e f g h i j k l m n o p q r s t u) = wptType (latitudeType a) (longitudeType b) c d e f g h i j k l m n o p q r s t u
GPX.cabal view
@@ -1,5 +1,5 @@ Name: GPX-Version: 0.3+Version: 0.4.1 License: BSD3 License-File: LICENSE Synopsis: Parse GPX files@@ -17,9 +17,9 @@ Library if flag(small_base)- Build-Depends: base < 4 && >= 3, hxt, hxt-extras, containers+ Build-Depends: base < 4 && >= 3, hxt, hxt-extras, containers, xsd else- Build-Depends: base < 3, hxt, hxt-extras, containers+ Build-Depends: base < 3, hxt, hxt-extras, containers, xsd GHC-Options: -Wall Exposed-Modules: Data.Geo.GPX