コード例 #1
0
void TagEqualsSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
	Way* way = geodata->getWay(wayID);
	auto entry = way->getTags().find(tag);
	if (entry != way->getTags().end() && entry->second == value) {
		next->matchWay(wayID, ti, attributes);
	}
}
コード例 #2
0
void HasNotTagSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
	Way* way = geodata->getWay(wayID);
	auto entry = way->getTags().find(tag);
	if (entry == way->getTags().end() || entry->second == precached_no || entry->second == precached_false) {
		next->matchWay(wayID, ti, attributes);
	}
}
コード例 #3
0
void TagMatchesSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
	Way* way = geodata->getWay(wayID);
	auto entry = way->getTags().find(tag);
	if (entry != way->getTags().end()) {
		if (boost::regex_match(entry->second.str(), expression)) {
			next->matchWay(wayID, ti, attributes);
		}
	}
}
コード例 #4
0
ファイル: line_selector.cpp プロジェクト: DennisOSRM/alacarte
void LineSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
	Way* way = geodata->getWay(wayID);
	auto& nodes = way->getNodeIDs();

	// (area is open) or (area is set and area == no)
	if (nodes.front() != nodes.back()) {
		next->matchWay(wayID, ti, attributes);
	} else {
		auto entry = way->getTags().find(precached_area);
		if (entry != way->getTags().end() && entry->second == precached_no) {
			next->matchWay(wayID, ti, attributes);
		}
	}
}
コード例 #5
0
void HasTagSelector::matchWay(WayId wayID, const shared_ptr<TileIdentifier>& ti, RenderAttributes* attributes) const {
	Way* way = geodata->getWay(wayID);
	auto& map = way->getTags();
	if (map.find(tag) != map.end()) {
		next->matchWay(wayID, ti, attributes);
	}
}
コード例 #6
0
ファイル: feature_test.cpp プロジェクト: AMDmi3/alacarte
	void styleWays(const shared_ptr<std::vector<WayId> >& ids, RenderAttributes& attr) const
	{
		for (auto id : *ids)
		{
			Way* w = data->getWay(id);
			auto& tags = w->getTags();

			auto name = tags.find(CachedString("name"));
			if (name != tags.end())
			{
				auto style = styles.find(name->second);
				if (style != styles.end()) {
					Style* s = attr.getNewStyle(id);
					*s = style->second;
				}
			}
		}
	}