本文整理汇总了C++中ConstOsmMapPtr::visitRo方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstOsmMapPtr::visitRo方法的具体用法?C++ ConstOsmMapPtr::visitRo怎么用?C++ ConstOsmMapPtr::visitRo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstOsmMapPtr
的用法示例。
在下文中一共展示了ConstOsmMapPtr::visitRo方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: allTagsAreValid
bool MapScoringStatusAndRefTagValidator::allTagsAreValid(const ConstOsmMapPtr& map)
{
//if first map has any element with a hoot::status = Unknown1 tag and a tag with key = REF2,
//then fail
FilteredVisitor unknown1Visitor(
new ChainCriterion(
new StatusCriterion(Status::Unknown1),
new HasTagCriterion("REF2")),
new CountVisitor());
FilteredVisitor& filteredRefVisitor = const_cast<FilteredVisitor&>(unknown1Visitor);
SingleStatistic* singleStat = dynamic_cast<SingleStatistic*>(&unknown1Visitor.getChildVisitor());
assert(singleStat != 0);
map->visitRo(filteredRefVisitor);
const long numFirstInputBadTags = singleStat->getStat();
//if second map has any element with a hoot::status = Unknown2 tag and a tag with key = REF1,
//then fail
FilteredVisitor unknown2Visitor(
new ChainCriterion(
new StatusCriterion(Status::Unknown2),
new HasTagCriterion("REF1")),
new CountVisitor());
filteredRefVisitor = const_cast<FilteredVisitor&>(unknown2Visitor);
singleStat = dynamic_cast<SingleStatistic*>(&unknown2Visitor.getChildVisitor());
assert(singleStat != 0);
map->visitRo(filteredRefVisitor);
const long numSecondInputBadTags = singleStat->getStat();
return (numFirstInputBadTags + numSecondInputBadTags) == 0;
}
示例2: addToMatrix
void AttributeCoOccurence::addToMatrix(const ConstOsmMapPtr& in)
{
RefToEidVisitor ref2("REF2");
in->visitRo(ref2);
CoOccurenceVisitor coOccurenceResult(ref2.getRefToEid(), _resultMatrix);
in->visitRo(coOccurenceResult);
}
示例3: createMatches
void PlacesPoiMatchCreator::createMatches(const ConstOsmMapPtr& map, vector<const Match *> &matches,
ConstMatchThresholdPtr threshold)
{
LOG_DEBUG(SystemInfo::getMemoryUsageString());
{
WorstCircularErrorVisitor wav;
map->visitRo(wav);
LOG_DEBUG("Worst circular error: " << wav.getWorstCircularError());
PlacesPoiMatchVisitor v(map, matches, wav.getWorstCircularError(), _bounds, threshold);
map->visitRo(v);
LOG_DEBUG(SystemInfo::getMemoryUsageString());
}
LOG_DEBUG(SystemInfo::getMemoryUsageString());
}
示例4: createMatches
void ScriptMatchCreator::createMatches(const ConstOsmMapPtr& map, vector<const Match *> &matches,
ConstMatchThresholdPtr threshold)
{
if (!_script)
{
throw IllegalArgumentException("The script must be set on the ScriptMatchCreator.");
}
ScriptMatchVisitor v(map, matches, threshold, _script, _filter);
v.setScriptPath(_scriptPath);
v.calculateSearchRadius();
_cachedCustomSearchRadii[_scriptPath] = v.getCustomSearchRadius();
LOG_VART(_scriptPath);
LOG_VART(_cachedCustomSearchRadii[_scriptPath]);
QFileInfo scriptFileInfo(_scriptPath);
LOG_DEBUG(
"Creating matches with: " << className() << ";" << scriptFileInfo.fileName() << "...");
LOG_VARD(*threshold);
map->visitRo(v);
LOG_INFO(
"Found " << v.getNumMatchCandidatesFound() << " " <<
CreatorDescription::baseFeatureTypeToString(
_getScriptDescription(_scriptPath).baseFeatureType) << " match candidates.");
}
示例5: createMatches
void BuildingMatchCreator::createMatches(const ConstOsmMapPtr& map, vector<const Match*>& matches,
ConstMatchThresholdPtr threshold)
{
LOG_VAR(*threshold);
BuildingMatchVisitor v(map, matches, _getRf(), threshold, Status::Unknown1);
map->visitRo(v);
}
示例6: createMatches
void ScriptMatchCreator::createMatches(const ConstOsmMapPtr& map, vector<const Match *> &matches,
ConstMatchThresholdPtr threshold)
{
if (!_script)
{
throw IllegalArgumentException("The script must be set on the ScriptMatchCreator.");
}
ScriptMatchVisitor v(map, matches, threshold, _script);
v.customScriptInit();
map->visitRo(v);
}
示例7: context_scope
ScriptMatchVisitor(const ConstOsmMapPtr& map, vector<const Match*>& result,
ConstMatchThresholdPtr mt, shared_ptr<PluginContext> script) :
_map(map),
_result(result),
_mt(mt),
_script(script),
_searchRadius(-1.0)
{
_neighborCountMax = -1;
_neighborCountSum = 0;
_elementsEvaluated = 0;
_maxGroupSize = 0;
HandleScope handleScope;
Context::Scope context_scope(_script->getContext());
Handle<Object> plugin = getPlugin();
_candidateDistanceSigma = getNumber(plugin, "candidateDistanceSigma", 0.0, 1.0);
//this is meant to have been set externally in a js rules file
_searchRadius = getNumber(plugin, "searchRadius", -1.0, 15.0);
Handle<v8::Value> value = plugin->Get(toV8("getSearchRadius"));
if (value->IsUndefined())
{
// pass
}
else if (value->IsFunction() == false)
{
throw HootException("getSearchRadius is not a function.");
}
else
{
_getSearchRadius = Persistent<Function>::New(Handle<Function>::Cast(value));
}
SmWorstCircularErrorVisitor v(*this);
map->visitRo(v);
_worstCircularError = v.getWorstCircularError();
}
示例8: getColumns
QStringList ShapefileWriter::getColumns(ConstOsmMapPtr map, ElementType type) const
{
if (_columns.size() != 0)
{
return _columns;
}
else
{
QStringList result;
ColumnVisitor v(type);
map->visitRo(v);
QMultiMap<int, QString> backwardKeys = v.getBackwardKeys();
QMapIterator<int, QString> i(backwardKeys);
i.toBack();
while (i.hasPrevious() && result.size() < 20)
{
i.previous();
result << i.value();
}
return result;
}
}
示例9: createMatches
void PoiPolygonMatchCreator::createMatches(const ConstOsmMapPtr& map, vector<const Match*>& matches,
ConstMatchThresholdPtr threshold)
{
PoiPolygonMatchVisitor v(map, matches, threshold);
map->visitRo(v);
}
示例10: createMatches
void HighwayMatchCreator::createMatches(const ConstOsmMapPtr& map, vector<const Match *> &matches,
ConstMatchThresholdPtr threshold)
{
HighwayMatchVisitor v(map, matches, _classifier, _sublineMatcher, Status::Unknown1, threshold);
map->visitRo(v);
}