本文整理汇总了C++中ConstElementPtr::getStatusString方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstElementPtr::getStatusString方法的具体用法?C++ ConstElementPtr::getStatusString怎么用?C++ ConstElementPtr::getStatusString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstElementPtr
的用法示例。
在下文中一共展示了ConstElementPtr::getStatusString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void TranslatedTagCountVisitor::visit(const ConstElementPtr& e)
{
if (e->getTags().getInformationCount() > 0)
{
shared_ptr<Geometry> g = ElementConverter(_map->shared_from_this()).convertToGeometry(e);
Tags t = e->getTags();
t["error:circular"] = QString::number(e->getCircularError());
t["hoot:status"] = e->getStatusString();
// remove all the empty tags.
for (Tags::const_iterator it = e->getTags().begin(); it != e->getTags().end(); ++it)
{
if (t[it.key()] == "")
{
t.remove(it.key());
}
}
QString layerName;
vector<ScriptToOgrTranslator::TranslatedFeature> f = _translator->translateToOgr(t,
e->getElementType(), g->getGeometryTypeId());
// only write the feature if it wasn't filtered by the translation script.
for (size_t i = 0; i < f.size(); i++)
{
_countTags(f[i].feature);
}
}
}
示例2:
Handle<Value> ElementJs::getStatusString(const Arguments& args)
{
HandleScope scope;
ConstElementPtr e = ObjectWrap::Unwrap<ElementJs>(args.This())->getConstElement();
return scope.Close(toV8(e->getStatusString()));
}
示例3: _writePartial
void OgrWriter::_writePartial(ElementProviderPtr& provider, const ConstElementPtr& e)
{
if (_translator.get() == 0)
{
throw HootException("You must call open before attempting to write.");
}
if (e->getTags().getInformationCount() > 0)
{
// There is probably a cleaner way of doing this.
// convertToGeometry calls getGeometryType which will throw an exception if it gets a relation
// that it doesn't know about. E.g. "route", "superroute", " turnlanes:turns" etc
shared_ptr<Geometry> g;
try
{
g = ElementConverter(provider).convertToGeometry(e);
}
catch (IllegalArgumentException& err)
{
LOG_WARN("Error converting geometry: " << err.getWhat() << " (" << e->toString() << ")");
g.reset((GeometryFactory::getDefaultInstance()->createEmptyGeometry()));
}
/*
LOG_DEBUG("After conversion to geometry, element is now a " <<
g->getGeometryType() );
*/
Tags t = e->getTags();
t["error:circular"] = QString::number(e->getCircularError());
t["hoot:status"] = e->getStatusString();
for (Tags::const_iterator it = e->getTags().begin(); it != e->getTags().end(); ++it)
{
if (t[it.key()] == "")
{
t.remove(it.key());
}
}
vector<ScriptToOgrTranslator::TranslatedFeature> tf = _translator->translateToOgr(t,
e->getElementType(), g->getGeometryTypeId());
// only write the feature if it wasn't filtered by the translation script.
for (size_t i = 0; i < tf.size(); i++)
{
OGRLayer* layer = _getLayer(tf[i].tableName);
if (layer != 0)
{
_addFeature(layer, tf[i].feature, g);
}
}
}
}