Skip nodes with missing elevation data.

This commit is contained in:
Filip Strajnar 2024-06-24 13:05:26 +02:00
parent 921f28d913
commit 1743a04af7

View file

@ -5,6 +5,7 @@ using OsmToDatabase.Common;
OsmContext db = new OsmContext();
long counter = 0;
using (var fileStream = new FileInfo(args[0]).OpenRead())
{
var source = new PBFOsmStreamSource(fileStream);
@ -17,6 +18,12 @@ using (var fileStream = new FileInfo(args[0]).OpenRead())
continue;
}
// Skip if elevation is missing.
if (node.TagDoubleValueByKey("ele") is null)
{
continue;
}
Peak peak = new Peak
{
Id = node.Id.Value,