From 1743a04af78c39b9f6b63cb9b3cc1b03bcab905d Mon Sep 17 00:00:00 2001 From: Filip Strajnar Date: Mon, 24 Jun 2024 13:05:26 +0200 Subject: [PATCH] Skip nodes with missing elevation data. --- OsmToDatabase.Peaks/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OsmToDatabase.Peaks/Program.cs b/OsmToDatabase.Peaks/Program.cs index c1e338c..d11008a 100644 --- a/OsmToDatabase.Peaks/Program.cs +++ b/OsmToDatabase.Peaks/Program.cs @@ -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,