Skip to content

Commit cd39bbf

Browse files
committed
Initial documentation, minor tweaks.
1 parent 4f0ee02 commit cd39bbf

File tree

6 files changed

+101
-6
lines changed

6 files changed

+101
-6
lines changed

GeoProcessor.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.GeoProcessor", "Test.G
2626
EndProject
2727
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoProcessorApp", "GeoProcessorApp\GeoProcessorApp.csproj", "{9F6D7226-328A-4FA4-9D56-9B68F240E127}"
2828
EndProject
29+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{46B961C5-1883-4706-8633-66984BA48596}"
30+
ProjectSection(SolutionItems) = preProject
31+
LICENSE.md = LICENSE.md
32+
README.md = README.md
33+
EndProjectSection
34+
EndProject
35+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{62EB80C2-C53A-48CB-BC0D-67D4F40A5881}"
36+
ProjectSection(SolutionItems) = preProject
37+
docs\assets\tldr-console.png = docs\assets\tldr-console.png
38+
EndProjectSection
39+
EndProject
2940
Global
3041
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3142
Debug|Any CPU = Debug|Any CPU
@@ -78,6 +89,7 @@ Global
7889
{70E3D3D7-4BFA-414E-806C-D007CD9342DC} = {5AD3F041-D553-492B-948D-E58BDA4373CF}
7990
{64E230F2-1223-4FBE-BD97-A34152FAAF6C} = {5AD3F041-D553-492B-948D-E58BDA4373CF}
8091
{6781EA78-CEEA-4B48-8D1E-E76CECE32A28} = {5AD3F041-D553-492B-948D-E58BDA4373CF}
92+
{62EB80C2-C53A-48CB-BC0D-67D4F40A5881} = {46B961C5-1883-4706-8633-66984BA48596}
8193
EndGlobalSection
8294
GlobalSection(ExtensibilityGlobals) = postSolution
8395
SolutionGuid = {FE44BCE1-11E4-4584-BACC-44570810FB77}

GeoProcessorApp/ConsoleExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static string GetText(string curValue, string prompt, string? defaultValu
5050
{
5151
defaultValue ??= curValue;
5252

53-
Colors.WriteLine( "\nEnter ", prompt.Green(), " (current value is '".White(), curValue.Green(), "'): " );
53+
Colors.WriteLine( "Enter ", prompt.Green(), " (current value is '".White(), curValue.Green(), "'): ");
5454
Console.Write("> ");
5555

5656
var retVal = Console.ReadLine();
@@ -63,7 +63,7 @@ public static string GetText(string curValue, string? defaultValue, params Span[
6363
defaultValue ??= curValue;
6464

6565
var promptList = prompts.ToList();
66-
promptList.Insert( 0, "\nEnter".White() );
66+
promptList.Insert( 0, "Enter ".White() );
6767
promptList.Add(" (current value is '".White() );
6868
promptList.Add(curValue.Green() );
6969
promptList.Add( "') :".White() );

GeoProcessorApp/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace J4JSoftware.GeoProcessor
99
{
1010
internal class Program
1111
{
12-
public const string AppName = "GPS Track Processor";
12+
public const string AppName = "GeoProcessor";
1313
public const string AppConfigFile = "appConfig.json";
1414
public const string UserConfigFile = "userConfig.json";
1515

GeoProcessorApp/app/AppConfigValidator.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ public void Validate( AppConfig config )
1515
ValidateProcessorType( config );
1616
ValidateAPIKey( config );
1717
ValidateInputFile( config );
18-
;
1918
}
2019

2120
private void ValidateProcessorType( AppConfig config )
2221
{
2322
if( !config.RunInteractive && config.ProcessorType != ProcessorType.Undefined )
2423
return;
2524

25+
Console.WriteLine();
2626
Colors.WriteLine( "\nProcessorType".Yellow(), " is undefined\n" );
2727

2828
config.ProcessorType = ConsoleExtensions.GetEnum<ProcessorType>(
@@ -38,14 +38,16 @@ private void ValidateAPIKey( AppConfig config )
3838
if( !config.RunInteractive && !string.IsNullOrEmpty( config.APIKey ) )
3939
return;
4040

41-
config.APIKey = ConsoleExtensions.GetText( config.APIKey, $"\n{config.ProcessorType} APIKey" );
41+
Console.WriteLine();
42+
config.APIKey = ConsoleExtensions.GetText( config.APIKey, $"{config.ProcessorType} APIKey" );
4243
}
4344

4445
private void ValidateInputFile( AppConfig config )
4546
{
4647
if( !config.RunInteractive && !string.IsNullOrEmpty( config.InputFile.GetPath() ) )
4748
return;
4849

50+
Console.WriteLine();
4951
var filePath = ConsoleExtensions.GetText( config.InputFile.GetPath(),
5052
string.Empty,
5153
"full path to input file ".Yellow() );

README.md

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,83 @@
11
# GeoProcessor
2-
a C# Net5 library and app for processing vehicle geolocation files, including snap-to-route.
2+
A C# Net5 library and app for processing vehicle geolocation files,
3+
snapping tracks/routes to roadways using the Bing or Google online
4+
snap-to-route processors (**note:** you'll need an account with Bing or Google to
5+
access those).
6+
7+
### TL;DR
8+
The libarary source code should run anywhere Net5 is supported...but
9+
I've only tested it, and the executable, on Windows 10.
10+
11+
![tl;dr console image](docs/assets/tldr-console.png)
12+
13+
You will need a Bing or Google API key for the library and program to
14+
work.
15+
16+
### Command line options
17+
|Key|Explanation|Default|
18+
|-------|---------------|-----------|
19+
|-i, --inputFile|the input file to process|*none*|
20+
|-n, --defaultName|default name for a route if none is specified in the input file|Unnamed Route|
21+
|-o, --outputFile|the output file to create<br/><br/>file type (e.g., kmz) will be derived from input file extension but can be overriden|*none*|
22+
|-t, --outputType|the type of output file to create. Must be one of *kml* or *kmz*| kml|
23+
|-p, --snapProcessor|the snap-to-route processor to use. Must be one of *Bing* or *Google*| Undefined |
24+
|-r, --runInteractive|force entry of all command line parameters regardless of whether or not they're specified in config file| false (not set)|
25+
|-k, --storeApiKey|prompt user for a snap-to-route processor's API key and store it, encrypted, in the app's user configuration| false (not set)|
26+
27+
### Configuration Files
28+
The app has a general configuration file, in its program directory, for
29+
configuring the logging system, specifying how close raw coordinates should
30+
be to each other to be merged, etc. It's a simple JSON file that looks
31+
like this:
32+
```json
33+
{
34+
"Processors": {
35+
"Distance": {
36+
"MaxDistanceMultiplier": 3,
37+
"MaxPointsPerRequest": -1,
38+
"MaxSeparation": "100 ft"
39+
},
40+
"Bing": {
41+
"MaxPointsPerRequest": 100,
42+
"MaxSeparation": "2 km"
43+
},
44+
"Google": {
45+
"MaxPointsPerRequest": 100,
46+
"MaxSeparation": "2 km"
47+
}
48+
},
49+
"Logging": {
50+
"EventElements": "None",
51+
"SourceRootPath": "C:\\Programming\\KMLProcessor\\",
52+
"Channels": {
53+
"Debug": {
54+
"MinimumLevel": "Information"
55+
},
56+
"Console": {
57+
"MinimumLevel": "Information"
58+
}
59+
}
60+
}
61+
}
62+
```
63+
There's also a user configuration file which stores encrypted snap-to-route
64+
API keys, if those are defined by the user (i.e., not simply entered)
65+
each time the program is run). It looks like this:
66+
```json
67+
{
68+
"APIKeys": {
69+
"Bing": {
70+
"EncryptedValue": "CfDJ8DZjcBUs1sNEu98tAdCI1mAkm...omitted for brevity"
71+
},
72+
"Google": {
73+
"EncryptedValue": "CfDJ8DZjcBUs1sNEu98tAdCI1mCS2...omitted for brevity"
74+
}
75+
}
76+
}
77+
```
78+
On Windows it's located at <br/>
79+
*C:\Users\\[username]\AppData\Local\J4JSoftware\GeoProcessor*.
80+
81+
82+
83+

docs/assets/tldr-console.png

124 KB
Loading

0 commit comments

Comments
 (0)