Skip to content

Instantly share code, notes, and snippets.

@lbargaoanu
Last active March 31, 2016 13:48
Show Gist options
  • Save lbargaoanu/c604105beecded22c519f483e746ef5e to your computer and use it in GitHub Desktop.
Save lbargaoanu/c604105beecded22c519f483e746ef5e to your computer and use it in GitHub Desktop.
<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