Skip to content
Browse files

Moved examples into source

  • Loading branch information...
1 parent d91c29f commit 392d84298e849aefcc4b1d12a4845a0981031da7 @tonymorris committed Jan 2, 2010
Showing with 9 additions and 18 deletions.
  1. +8 −0 Data/Geo/OSM/Example/CampSites.hs
  2. +1 −1 OSM.cabal
  3. +0 −17 etc/Example.hs
View
8 Data/Geo/OSM/Example/CampSites.hs
@@ -0,0 +1,8 @@
+module Data.Geo.OSM.Example.CampSites where
+
+import Data.Geo.OSM
+
+-- Return all nodes tagged as camp-sites (tourism=camp_site) in the given OSM file.
+campSites :: FilePath -> IO [Node]
+campSites f = let p = filter ("tourism" `hasTagValue` "camp_site") . (nodes =<<)
+ in fmap p (runX (xunpickleDocument (xpickle :: PU OSM) [(a_remove_whitespace, v_1)] f))
View
2 OSM.cabal
@@ -12,7 +12,6 @@ Maintainer: code@tmorris.net
Copyright: 2009 Tony Morris
build-type: Simple
cabal-version: >= 1.2
-extra-source-files: etc/Example.hs, etc/MountBarney.osm
Flag small_base
Description: Choose the new, split-up base package.
@@ -64,3 +63,4 @@ Library
Data.Geo.OSM.Accessor.V
Data.Geo.OSM.Accessor.Version
Data.Geo.OSM.Accessor.Visible
+ Data.Geo.OSM.Example.CampSites
View
17 etc/Example.hs
@@ -1,17 +0,0 @@
-import Geo.OSM
-
--- Return all nodes tagged as camp-sites (tourism=camp_site) in the given OSM file.
-campSites :: FilePath -> IO [Node]
-campSites f = let p = filter ("tourism" `hasTagValue` "camp_site") . (nodes =<<)
- in fmap p (runX (xunpickleDocument (xpickle :: PU OSM) [(a_remove_whitespace, v_1)] f))
-
-
-
-{-
-
-
-*Main> campSites "MountBarney.osm"
-[<node lat="-28.309999" lon="152.460006" id="316587114" changeset="108027" user="Spindoc Bob" uid="11037" timestamp="2008-12-04T11:00:06Z"><tag k="name" v="Koreelah Creek Campground - Koreelah NP"/><tag k="tourism" v="camp_site"/></node>,<node lat="-28.2131914" lon="152.4264518" id="596132847" changeset="3406101" user="Tony Morris" uid="66376" timestamp="2009-12-19T11:19:14Z"><tag k="name" v="Emu Creek"/><tag k="tourism" v="camp_site"/></node>,<node lat="-28.389999" lon="152.61" id="316587113" changeset="108027" user="Spindoc Bob" uid="11037" timestamp="2008-12-04T11:00:05Z"><tag k="name" v="Woodenbong Campground"/><tag k="tourism" v="camp_site"/></node>,<node lat="-28.2819309" lon="152.690921" id="440615858" changeset="3405819" user="Tony Morris" uid="66376" timestamp="2009-12-19T10:37:58Z"><tag k="name" v="Rum Jungle"/><tag k="tourism" v="camp_site"/></node>,<node lat="-28.2812388" lon="152.6916212" id="596096271" changeset="3405991" user="Tony Morris" uid="66376" timestamp="2009-12-19T11:02:19Z"><tag k="name" v="Old Hut Site"/><tag k="tourism" v="camp_site"/></node>,<node lat="-28.2961173" lon="152.7150912" id="596098699" changeset="3405772" user="Tony Morris" uid="66376" timestamp="2009-12-19T10:31:22Z"><tag k="name" v="Site 10"/><tag k="tourism" v="camp_site"/></node>,<node lat="-28.299066" lon="152.7198659" id="596098700" changeset="3405772" user="Tony Morris" uid="66376" timestamp="2009-12-19T10:31:22Z"><tag k="name" v="Site 9"/><tag k="tourism" v="camp_site"/></node>,<node lat="-28.2056648" lon="152.6679486" id="442564691" changeset="1844269" user="Tony Morris" uid="66376" timestamp="2009-07-16T12:44:51Z"><tag k="tourism" v="camp_site"/></node>,<node lat="-28.219999" lon="152.86" id="316607159" changeset="108027" user="Spindoc Bob" uid="11037" timestamp="2008-12-04T11:57:12Z"><tag k="name" v="EM Tilley Park"/><tag k="tourism" v="camp_site"/></node>,<node lat="-28.209999" lon="152.770004" id="316607169" changeset="1824310" user="Tony Morris" uid="66376" timestamp="2009-07-14T08:21:51Z"><tag k="name" v="Flanagan Reserve"/><tag k="tourism" v="camp_site"/></node>,<node lat="-28.2" lon="152.779998" id="316607407" changeset="108027" user="Spindoc Bob" uid="11037" timestamp="2008-12-04T11:57:28Z"><tag k="name" v="Bigriggen Park Reserve"/><tag k="tourism" v="camp_site"/></node>]
-
-
--}

0 comments on commit 392d842

Please sign in to comment.
Something went wrong with that request. Please try again.