当前位置: 首页>>代码示例>>C++>>正文


C++ Tags::appendValue方法代码示例

本文整理汇总了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);
  }
}
开发者ID:digideskio,项目名称:hootenanny,代码行数:27,代码来源:OgrWriter.cpp

示例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));
  }
开发者ID:Nanonid,项目名称:hootenanny,代码行数:40,代码来源:CustomPoiMatchCreatorTest.cpp

示例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);
  }
  */
}
开发者ID:giserh,项目名称:hootenanny,代码行数:47,代码来源:OgrWriter.cpp


注:本文中的Tags::appendValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。