1 /* 2 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org> 3 4 SPDX-License-Identifier: LGPL-2.0-or-later 5 */ 6 7 #include "osmaddress.h" 8 9 using namespace KOSMIndoorMap; 10 11 OSMAddress::OSMAddress() = default; OSMAddress(OSM::Element elem)12OSMAddress::OSMAddress(OSM::Element elem) 13 : m_element(elem) 14 { 15 } 16 17 OSMAddress::~OSMAddress() = default; 18 street() const19QString OSMAddress::street() const 20 { 21 return QString::fromUtf8(m_element.tagValue("addr:street", "contact:street", "addr:housename")); 22 } 23 houseNumber() const24QString OSMAddress::houseNumber() const 25 { 26 return QString::fromUtf8(m_element.tagValue("addr:housenumber", "contact:housenumber")); 27 } 28 postalCode() const29QString OSMAddress::postalCode() const 30 { 31 return QString::fromUtf8(m_element.tagValue("addr:postcode", "contact:postcode")); 32 } 33 city() const34QString OSMAddress::city() const 35 { 36 return QString::fromUtf8(m_element.tagValue("addr:city", "contact:city")); 37 } 38 state() const39QString OSMAddress::state() const 40 { 41 return QString::fromUtf8(m_element.tagValue("addr:state")); 42 } 43 country() const44QString OSMAddress::country() const 45 { 46 return QString::fromUtf8(m_element.tagValue("addr:country", "contact:country")); 47 } 48