forked from GraphDefined/OverpassAPI
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ExtentionMethods.cs
43 lines (33 loc) · 1.28 KB
/
ExtentionMethods.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Org.BouncyCastle.Bcpg.OpenPgp;
namespace org.GraphDefined.OpenDataAPI.OverpassAPI
{
public static class Extentions
{
#region RunAll(this OverpassQuery, Filename)
/// <summary>
/// Standard workflow...
/// </summary>
/// <param name="OverpassQuery">An Overpass query.</param>
/// <param name="FilenamePrefix">A file name prefix.</param>
public static void RunAll(this OverpassQuery OverpassQuery,
String FilenamePrefix,
PgpSecretKey SecretKey,
String Passphrase)
{
OverpassQuery.
ToFile (FilenamePrefix + ".json").
ToGeoJSONFile(FilenamePrefix + ".geojson").
SignGeoJSON (FilenamePrefix + ".geojson.sig", SecretKey, Passphrase).
SignGeoJSON (FilenamePrefix + ".geojson.bsig", SecretKey, Passphrase, ArmoredOutput: false).
ContinueWith(task => Console.WriteLine(FilenamePrefix + ".* files are ready!")).
Wait();
}
#endregion
}
}