alaCarte Maps
Renderer for OpenStreetMap tiles
line_selector.cpp
Go to the documentation of this file.
1 
24 #include "general/geodata.hpp"
25 #include "general/node.hpp"
26 #include "general/way.hpp"
27 #include "general/relation.hpp"
30 
31 LineSelector::LineSelector(const shared_ptr<Rule>& rule, const shared_ptr<Selector>& next) : Selector(rule, next)
32 {
33 }
34 
35 void LineSelector::matchNode(NodeId nodeID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
36 }
37 
38 
39 void LineSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
40  Way* way = geodata->getWay(wayID);
41  auto& nodes = way->getNodeIDs();
42 
43  // (area is open) or (area is set and area == no)
44  if (nodes.front() != nodes.back()) {
45  next->matchWay(wayID, ti, attributes);
46  } else {
47  auto entry = way->getTags().find(precached_area);
48  if (entry != way->getTags().end() && entry->second == precached_no) {
49  next->matchWay(wayID, ti, attributes);
50  }
51  }
52 }
53 
54 void LineSelector::matchRelation(RelId relID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
55 }
A RenderAttributes object contains mappings from NodeIDs and WayIDs to Style objects which define how...
TESTABLE const DataMap< CachedString, CachedString > & getTags() const
Returns a map with key-to-tag-mapping for osm-tags.
Definition: geo_object.cpp:30
virtual void matchNode(NodeId nodeID, const shared_ptr< TileIdentifier > &ti, RenderAttributes *attributes) const
const shared_ptr< Selector > next
Definition: selector.hpp:54
virtual void matchRelation(RelId relID, const shared_ptr< TileIdentifier > &ti, RenderAttributes *attributes) const
const shared_ptr< Geodata > geodata
Definition: selector.hpp:55
virtual void matchWay(WayId wayID, const shared_ptr< TileIdentifier > &ti, RenderAttributes *attributes) const
CachedString precached_area("area")
CachedString precached_no("no")
This file is part of alaCarte.
LineSelector(const shared_ptr< Rule > &rule, const shared_ptr< Selector > &next)
This file is part of alaCarte.
Definition: way.hpp:31
const std::vector< NodeId > & getNodeIDs() const
Definition: way.hpp:45