Last change
on this file since 11743 was
11684,
checked in by nienhueser, 11 years ago
|
Less inline definitions. Start to document things (doxygen style)
|
File size:
905 bytes
|
Line | |
---|
1 | #include "FeatureClassification.h" |
---|
2 | |
---|
3 | using namespace OSM; |
---|
4 | |
---|
5 | FeatureClassification::FeatureClassification() |
---|
6 | { |
---|
7 | } |
---|
8 | |
---|
9 | void FeatureClassification::addWayDef(const std::string& k, |
---|
10 | const std::string& v) |
---|
11 | { |
---|
12 | ways.push_back(KeyVal(k, v)); |
---|
13 | } |
---|
14 | |
---|
15 | void FeatureClassification::addAreaDef(const std::string& k, |
---|
16 | const std::string& v) |
---|
17 | { |
---|
18 | areas.push_back(KeyVal(k, v)); |
---|
19 | } |
---|
20 | |
---|
21 | std::string FeatureClassification::getFeatureClass(Object *object) const |
---|
22 | { |
---|
23 | for (std::map<std::string, std::string>::iterator i = object->tags.begin(); i |
---|
24 | != object->tags.end(); i++) |
---|
25 | { |
---|
26 | for (std::vector<KeyVal>::const_iterator j = ways.begin(); j |
---|
27 | != ways.end(); j++) |
---|
28 | { |
---|
29 | if (i->first == j->k && i->second == j->v) |
---|
30 | { |
---|
31 | return "way"; |
---|
32 | } |
---|
33 | } |
---|
34 | for (std::vector<KeyVal>::const_iterator j = areas.begin(); j |
---|
35 | != areas.end(); j++) |
---|
36 | { |
---|
37 | if (i->first == j->k && i->second == j->v) |
---|
38 | { |
---|
39 | return "area"; |
---|
40 | } |
---|
41 | } |
---|
42 | } |
---|
43 | return "unknown"; |
---|
44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.