Exemple #1
0
        /// <summary>
        /// Iterate over root node and initialize data
        /// </summary>
        /// <param name="osm"></param>
        static void IterateNode(XmlNode osm)
        {
            foreach (XmlNode item in osm.ChildNodes)
            {
                INode node = CreateNode(item);
                if (node != null)
                {
                    IterateInformation(node, item);
                }

                if (node is Node nd)
                {
                    foreach (Information info in node.Informations)
                    {
                        if (!info.Contains("amenity"))
                        {
                            continue;
                        }

                        switch (info["amenity"])
                        {
                        case Atm.Amenity:
                            Atm.Create(nd);
                            break;

                        case Fuel.Amenity:
                            Fuel.Create(nd);
                            break;

                        case Toilet.Amenity:
                            Toilet.Create(nd);
                            break;

                        case Maintenance.Amenity:
                            Maintenance.Create(nd);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
        }