Last active
March 31, 2016 13:48
-
-
Save lbargaoanu/c604105beecded22c519f483e746ef5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Query Kind="Statements"> | |
<Reference Relative="..\TestConsole\TestConsole\bin\Debug\Newtonsoft.Json.dll">C:\Projects\TestConsole\TestConsole\bin\Debug\Newtonsoft.Json.dll</Reference> | |
<Reference Relative="..\TestConsole\TestConsole\bin\Debug\TestConsole.exe">C:\Projects\TestConsole\TestConsole\bin\Debug\TestConsole.exe</Reference> | |
<Namespace>Newtonsoft.Json</Namespace> | |
<Namespace>OGL_Library</Namespace> | |
</Query> | |
var dir = Path.GetDirectoryName(LINQPad.Util.CurrentQueryPath); | |
var jsonText = File.ReadAllText(dir+"\\Saved Places.json"); | |
dynamic json = JsonConvert.DeserializeObject(jsonText); | |
var wayPoints = | |
from feature in json.features as IEnumerable<dynamic> | |
let item = feature.properties | |
let coordinates = item.Location["Geo Coordinates"] ?? item.Location | |
where ((DateTime)item.Published).Year == 2016 | |
select new ConvertGPX.CWaypoint | |
{ | |
lat = coordinates.Latitude, lon = coordinates.Longitude, name = item.Title, desc = item.Location.Address ?? item.Title, url = item["Google Maps URL"] | |
}; | |
ConvertGPX.GPSConvertToGPX(dir+"\\PisaFlorenza.gpx", wayPoints.ToArray(), null); | |
wayPoints.Dump(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment