mirror of
https://onedev.fprog.nl/OsmToDatabase
synced 2025-12-20 22:28:36 +01:00
Skipping more irrelevant nodes.
This commit is contained in:
parent
1743a04af7
commit
2b86cf595c
|
|
@ -5,6 +5,7 @@ using OsmToDatabase.Common;
|
||||||
OsmContext db = new OsmContext();
|
OsmContext db = new OsmContext();
|
||||||
long counter = 0;
|
long counter = 0;
|
||||||
|
|
||||||
|
HashSet<string> naturalPeakFeatures = new HashSet<string> { "peak", "volcano" };
|
||||||
|
|
||||||
using (var fileStream = new FileInfo(args[0]).OpenRead())
|
using (var fileStream = new FileInfo(args[0]).OpenRead())
|
||||||
{
|
{
|
||||||
|
|
@ -13,7 +14,16 @@ using (var fileStream = new FileInfo(args[0]).OpenRead())
|
||||||
{
|
{
|
||||||
if (element is Node node)
|
if (element is Node node)
|
||||||
{
|
{
|
||||||
if (node.TagValueByKey("natural") != "peak")
|
string? naturalValue = node.TagValueByKey("natural");
|
||||||
|
|
||||||
|
// Skip if natural tag is missing.
|
||||||
|
if (naturalValue is null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip if the node is not a desired feature.
|
||||||
|
if (!naturalPeakFeatures.Contains(naturalValue))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue