new env
This commit is contained in:
parent
d7469aa190
commit
d2ab990bfe
@ -1,28 +1,18 @@
|
|||||||
using OSMDatastructure;
|
using OSMDatastructure;
|
||||||
|
using OSMDatastructure.Graph;
|
||||||
|
|
||||||
using Pathfinding;
|
using Pathfinding;
|
||||||
|
|
||||||
namespace Server;
|
namespace Server;
|
||||||
|
|
||||||
public class Server
|
public class Server
|
||||||
{
|
{
|
||||||
private static void WriteRegionsToFile(HashSet<Region> regions, string outputFolderPath)
|
|
||||||
{
|
|
||||||
Console.WriteLine(string.Format("[{0}] Writing files...", DateTime.Now.ToLocalTime()));
|
|
||||||
Directory.CreateDirectory(outputFolderPath);
|
|
||||||
foreach (Region region in regions)
|
|
||||||
{
|
|
||||||
FileStream regionFileStream =
|
|
||||||
new FileStream(Path.Combine(outputFolderPath, region.regionHash.ToString()), FileMode.Create);
|
|
||||||
regionFileStream.Write(ByteConverter.GetBytes(region));
|
|
||||||
regionFileStream.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
HashSet<OsmNode> nodes = XmlImporter.ImportXml("/home/glax/Downloads/germany-latest.osm");
|
HashSet<OsmNode> nodes = XmlImporter.ImportXml("D:/stuttgart-regbez-latest.osm/stuttgart-regbez-latest.osm");
|
||||||
HashSet<Region> regions = XmlImporter.SplitIntoRegions(nodes);
|
HashSet<Region> regions = XmlImporter.SplitIntoRegions(nodes);
|
||||||
WriteRegionsToFile(regions, "/home/glax/Downloads/germany-latest");
|
WriteRegionsToFile(regions, "D:/stuttgart-regbez");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Coordinates start = new Coordinates(48.243351f, 11.640417f);
|
Coordinates start = new Coordinates(48.243351f, 11.640417f);
|
||||||
@ -41,4 +31,17 @@ public class Server
|
|||||||
}
|
}
|
||||||
Console.WriteLine();*/
|
Console.WriteLine();*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void WriteRegionsToFile(HashSet<Region> regions, string outputFolderPath)
|
||||||
|
{
|
||||||
|
Console.WriteLine(string.Format("[{0}] Writing files...", DateTime.Now.ToLocalTime()));
|
||||||
|
Directory.CreateDirectory(outputFolderPath);
|
||||||
|
foreach (Region region in regions)
|
||||||
|
{
|
||||||
|
FileStream regionFileStream =
|
||||||
|
new FileStream(Path.Combine(outputFolderPath, region.regionHash.ToString()), FileMode.Create);
|
||||||
|
regionFileStream.Write(ByteConverter.GetBytes(region));
|
||||||
|
regionFileStream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user