// ReSharper disable once InconsistentNaming public void TestCSVODC() { try { int[] zones = new[] { 0, 1, 2, 3, 4, 5, 6 }; SparseArray <int> referenceArray = new SparseArray <int>(new SparseIndexing() { Indexes = new[] { new SparseSet() { Start = 0, Stop = 6 } } }); float[][][] allData = new float[1][][]; var data = CreateData(zones.Length); CreateCSVFile(zones, data, "Test.csv"); allData[0] = data; var writer = new OdMatrixWriter <int>(referenceArray, 1, 1); writer.LoadCsvTimes("Test.csv", false, 0, 0); writer.Save("Test.odc", false); var odcFloatData = ConvertData(allData, zones.Length, 1, 1); ValidateData(zones, odcFloatData, "Test.odc"); } finally { File.Delete("Test.csv"); File.Delete("Test.odc"); } }
private void LoadTimes(OdMatrixWriter <IZone> writer, string fileName, int i) { if (Path.GetExtension(fileName) == ".311") { writer.LoadEmme2(FailIfNotExist(fileName), i, (int)AutoDataTypes.TravelTime); } else { writer.LoadCsvTimes(FailIfNotExist(fileName), HeaderBoolean, i, (int)AutoDataTypes.TravelTime); } }