KOSMIndoorMap

osmaddress.cpp
1 /*
2  SPDX-FileCopyrightText: 2020 Volker Krause <[email protected]>
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;
12 OSMAddress::OSMAddress(OSM::Element elem)
13  : m_element(elem)
14 {
15 }
16 
17 OSMAddress::~OSMAddress() = default;
18 
19 QString OSMAddress::street() const
20 {
21  return QString::fromUtf8(m_element.tagValue("addr:street", "contact:street", "addr:housename"));
22 }
23 
24 QString OSMAddress::houseNumber() const
25 {
26  return QString::fromUtf8(m_element.tagValue("addr:housenumber", "contact:housenumber"));
27 }
28 
29 QString OSMAddress::postalCode() const
30 {
31  return QString::fromUtf8(m_element.tagValue("addr:postcode", "contact:postcode"));
32 }
33 
34 QString OSMAddress::city() const
35 {
36  return QString::fromUtf8(m_element.tagValue("addr:city", "contact:city"));
37 }
38 
39 QString OSMAddress::state() const
40 {
41  return QString::fromUtf8(m_element.tagValue("addr:state"));
42 }
43 
44 QString OSMAddress::country() const
45 {
46  return QString::fromUtf8(m_element.tagValue("addr:country", "contact:country"));
47 }
OSM-based multi-floor indoor maps for buildings.
A reference to any of OSM::Node/OSMWay/OSMRelation.
Definition: element.h:22
QString fromUtf8(const char *str, int size)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:03:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.