public static GeoJsonFeatureCollection FromCombinedRecords(IDeltaActions <CombinedRecord> actions) { return(new GeoJsonFeatureCollection { Featrues = actions.RecordsToCreate.Select( r => GeoJsonFeature.FromCombinedRecord(r, "#3cc62a", "New") ).Union(actions.RecordsToRemove.Select( r => GeoJsonFeature.FromCombinedRecord(r, "#c62a2a", "Retired")) ).Union(actions.RecordsToReplace.Select( r => GeoJsonFeature.FromCombinedRecord(r, "#2a75c6", "Updated")) ).ToList() }); }
public static string GenerateGeoJson(IDeltaActions <CombinedRecord> deltaActions) { return(JsonConvert.SerializeObject(GeoJsonFeatureCollection.FromCombinedRecords(deltaActions))); }
public static string GenerateHtmlReport <T>(IDeltaActions <T> deltaActions) where T : IDeltaRecord <T> { const string css = "<style>table { font-family: arial, sans-serif; border-collapse: collapse; width: 100%;}td, th { border: 1px solid #dddddd; text-align: left; padding: 8px;}tr:nth-child(even) { background-color: #dddddd;}</style>"; return($"<html>{css}<body><table><tr><th>Action</th><th>Count</th></tr><tr><td>New Addresses</td><th>{deltaActions.RecordsToCreate.Count()}</td></tr><tr><td>Retired Addresses</td><th>{deltaActions.RecordsToRemove.Count()}</td></tr><tr><td>Updated Addresses</td><th>{deltaActions.RecordsToReplace.Count()}</td></tr></table></body></html>"); }