GPS Traces Using World Wind
I have a lot of GPX files lying around from various biking trips. I don't have much use for them other than loading them in to Google Earth and brag about being there and done that, so I thought I would parse the file myself and paint the route on the World Wind.

GPX files are XML files, containing the coordinates you have been to, if you draw a line through these points you can rebuild the route you have taken.
(defn points [f]
(let [data (zip/xml-zip (xml/parse f))
trkpt (xml-> data :trk :trkseg :trkpt)]
(map #(vector (attr % :lat)
(attr % :lon)
(first (xml-> % :ele text))) trkpt)))
gpx=> (take 2 (points "data.gpx"))
(["41.011934" "29.196977" "154.909546"]
["41.010155" "29.195925" "150.583618"])
This will return a sequence of vectors, each containing three items, latitude, longitude and elevation of the point. To draw a path on to the map World Wind provides two classes SurfacePolyline and Polyline. SurfacePolyline will draw a flat line on to the surface between coordinates where as Polyline draws a GL line between positions, which includes elevation data.
(defn surface-polyline [points]
(let [list (ArrayList.)]
(doseq [p points]
(.add list (LatLon/fromDegrees (Double. (p 0)) (Double. (p 1)))))
(doto (RenderableLayer.)
(.addRenderable (SurfacePolyline. list)))))
To create a SurfacePolyline, we need to create a list of LatLon objects and pass that to the SurfacePolyline constructor at this point you can also set a color for the line then we create a RenderableLayer and add our SurfacePolyline to it, this final layer is what will be added to the World Wind canvas.
(defn polyline [points]
(let [list (ArrayList.)]
(doseq [p points]
(.add list (Position.
(LatLon/fromDegrees (Double. (p 0)) (Double. (p 1)))
(Double. (p 2)))))
(doto (RenderableLayer.)
(.addRenderable (Polyline. list)))))
Process of creating a Polyline is the same, the only difference is instead of building a list of LatLon objects, we build a list of Position objects which includes the elevation data, again we get a layer that is ready to be added to the world. You can grab the code here.