-
Notifications
You must be signed in to change notification settings - Fork 4
Theme Städtisches Flair
lukmay edited this page Dec 16, 2023
·
2 revisions
If an accommodation has an altitude
value below or equal to 1100 and if the accommodation's DistrictId
exists in a predefined city list, the theme "Städtisches Flair" is added to the ThemeIds
.
-
Altitude Check: The code checks the
altitude
of the accommodation, and if the value is less than or equal to 1100, it proceeds to the next step. -
City List Check: The code loads a predefined XML file, the "citylist," which contains data about city-related districts. It then checks if the accommodation's
DistrictId
matches any entry in the "citylist."
Is implemented here.
var cityaltitude = myacco.Altitude;
if (cityaltitude != null)
{
int cityaltitudeint = Convert.ToInt32(cityaltitude);
if (cityaltitudeint <= 1100)
{
// Uncomment this line to load the city list from an XML file
// XDocument mycitylist = XDocument.Load(xmldir + "City.xml");
// Check if the accommodation's DistrictId is in the city list
var isincitieslist = mycitylist.Root.Elements("Fraction").Where(x => x.Value == myacco.DistrictId).FirstOrDefault();
if (isincitieslist != null)
{
myacco.ThemeIds.Add("Städtisches Flair");
}
}
}
This wiki contains additional information about the Open Data Hub alongside the Open Data Hub - Official Documentation 🔗 .