本文整理汇总了C++中Tags::appendValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Tags::appendValue方法的具体用法?C++ Tags::appendValue怎么用?C++ Tags::appendValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tags
的用法示例。
在下文中一共展示了Tags::appendValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeElement
void OgrWriter::writeElement(ElementPtr &element, bool debug)
{
//Unfortunately, this check also has to happen in addition to checking hasMoreElements. See
//explanation in ServicesDbReader::readNextElement.
if (element.get())
{
Tags sourceTags = element->getTags();
Tags destTags;
for (Tags::const_iterator it = element->getTags().begin();
it != element->getTags().end(); ++it)
{
if (sourceTags[it.key()] != "")
{
destTags.appendValue(it.key(), it.value());
}
}
// Now that all the empties are gone, update our element
element->setTags(destTags);
if ( debug == true )
{
LOG_DEBUG(element->toString());
}
PartialOsmMapWriter::writePartial(element);
}
}
示例2: runIsCandidateTest
void runIsCandidateTest()
{
CustomPoiMatchCreator uut;
OsmMapPtr map(new OsmMap());
OGREnvelope env;
env.MinX = 0.0;
env.MinY = 0.0;
env.MaxX = 1.0;
env.MaxY = 1.0;
MapProjector::projectToPlanar(map, env);
//to be a match candidate: needs to be a node and a poi; being a poi means its tagged as a
//poi OR has a name tag
Tags tags;
tags.appendValue("name", "node1");
tags.appendValue("poi", "yes");
NodePtr node1 = TestUtils::createNode(map, Status::Unknown1, 10.0, 10.0, 250.0, tags);
CPPUNIT_ASSERT(uut.isMatchCandidate(node1, map));
tags.clear();
tags.appendValue("name", "node2");
NodePtr node2 = TestUtils::createNode(map, Status::Unknown1, 10.0, 10.0, 250.0, tags);
CPPUNIT_ASSERT(uut.isMatchCandidate(node2, map));
tags.clear();
tags.appendValue("poi", "yes");
NodePtr node3 = TestUtils::createNode(map, Status::Unknown1, 10.0, 10.0, 250.0, tags);
CPPUNIT_ASSERT(uut.isMatchCandidate(node3, map));
NodePtr node4 = TestUtils::createNode(map, Status::Unknown1, 10.0, 10.0, 250.0);
CPPUNIT_ASSERT(!uut.isMatchCandidate(node4, map));
QList<NodePtr> wayNodes;
wayNodes.append(node1);
wayNodes.append(node2);
WayPtr way1 = TestUtils::createWay(map, wayNodes, Status::Unknown1);
CPPUNIT_ASSERT(!uut.isMatchCandidate(way1, map));
}
示例3: writeElement
void OgrWriter::writeElement(ElementInputStream& inputStream, bool debug)
{
// Make sure incoming element is in WGS84
assert( inputStream.getProjection()->IsSame(&_wgs84) == true );
ElementPtr nextElement = inputStream.readNextElement();
// TERRY TESTING COULD BE CATASTROPHIC
Tags sourceTags = nextElement->getTags();
Tags destTags;
for (Tags::const_iterator it = nextElement->getTags().begin();
it != nextElement->getTags().end(); ++it)
{
if (sourceTags[it.key()] != "")
{
destTags.appendValue(it.key(), it.value());
}
}
// Now that all the empties are gone, update our element
nextElement->setTags(destTags);
if ( debug == true )
{
LOG_DEBUG(nextElement->toString());
}
PartialOsmMapWriter::writePartial(nextElement);
/*
if ( nextElement->getElementType().getEnum() == ElementType::Node )
{
//LOG_DEBUG("\n" << nextElement->toString());
const long nodeID = nextElement->getId();
if ( (nodeID >= -265198) && (nodeID <= -265167) )
{
LOG_DEBUG("\n" << nextElement->toString());
PartialOsmMapWriter::writePartial(nextElement);
}
}
else if ((nextElement->getElementType().getEnum() == ElementType::Way) &&
(nextElement->getId() == -23189) )
{
LOG_DEBUG("Writing Little Mill Creek -23189");
LOG_DEBUG("\n" << nextElement->toString());
PartialOsmMapWriter::writePartial(nextElement);
}
*/
}