private const string chunkFile_filter = @"*_*.png";
private const string poiFileName = @"poi_binary";
private const string eoiFileName = @"eoi_binary";
+ private const string pointsTsvFileName = @"points_of_interest.tsv";
private static Regex chunkShardRegex = new Regex(@"(?<X>[\d]+)_(?<Z>[\d]+).png", RegexOptions.Singleline);
private ConcurrentDictionary<Vec2i, uint> columnCounter = new ConcurrentDictionary<Vec2i, uint>(3, 150);
//What about chunk updates themselves; a update bitmap isn't kept...
updatedChunksTotal += updatedChunks;
GenerateJSONMetadata();
- PersistPointsData( );
updatedChunks = 0;
}
finally
{
Logger.VerboseDebug("Thread '{0}' executing finally block.", Thread.CurrentThread.Name);
+ PersistPointsData( );
}
}
/// </summary>
private void PersistPointsData( )
{
- //POI and EOI raw dump files ~ reload em!
+ //POI and EOI raw dump files ~ WRITE em!
//var poiRawFile = File.
string poiPath = Path.Combine(path, poiFileName);
string eoiPath = Path.Combine(path, eoiFileName);
Serializer.Serialize<EntitiesOfInterest>(eoiFile, this.EOIs);
}
}
+
+ //Create Easy to Parse CSV file for tool/human use....
+ string pointsTsvPath = Path.Combine(path, pointsTsvFileName);
+
+ using (var tsvWriter = new StreamWriter(pointsTsvPath, false, Encoding.UTF8))
+ {
+ tsvWriter.WriteLine("Name\tDescription\tLocation\tTime\t");
+ foreach (var point in this.POIs) {
+ tsvWriter.Write(point.Name + "\t");
+ tsvWriter.Write(point.Notes + "\t");
+ tsvWriter.Write(point.Location.PrettyCoords(ClientAPI) + "\t");
+ tsvWriter.Write(point.Timestamp.ToString("u")+"\t");
+ tsvWriter.WriteLine();
+ }
+ foreach (var entity in this.EOIs) {
+ tsvWriter.Write(entity.Name + "\t");
+ tsvWriter.Write(entity.Notes + "\t");
+ tsvWriter.Write(entity.Location.PrettyCoords(ClientAPI) + "\t");
+ tsvWriter.Write(entity.Timestamp.ToString("u") + "\t");
+ tsvWriter.WriteLine( );
+ }
+ tsvWriter.WriteLine();
+ tsvWriter.Flush( );
+ }
+
}
private ColumnMeta CreateColumnMetadata(KeyValuePair<Vec2i, uint> mostActiveCol, IMapChunk mapChunk)