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


C++ OsmWriter::setIncludeCompatibilityTags方法代码示例

本文整理汇总了C++中OsmWriter::setIncludeCompatibilityTags方法的典型用法代码示例。如果您正苦于以下问题:C++ OsmWriter::setIncludeCompatibilityTags方法的具体用法?C++ OsmWriter::setIncludeCompatibilityTags怎么用?C++ OsmWriter::setIncludeCompatibilityTags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OsmWriter的用法示例。


在下文中一共展示了OsmWriter::setIncludeCompatibilityTags方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: individualManipulationsTest

  void individualManipulationsTest()
  {
    OsmReader reader;

    shared_ptr<OsmMap> map(new OsmMap());
    OsmMap::resetCounters();
    reader.read("test-files/manipulators/WayMergeManipulation.osm", map);

    MapReprojector::reprojectToOrthographic(map);

    long left = map->findWays("note", "3")[0];
    long right = map->findWays("note", "4")[0];

    map->getWay(left)->setStatus(Status::Unknown1);
    map->getWay(right)->setStatus(Status::Unknown2);

    WayMergeManipulation uut(left, right, map, 10.0);
    set<ElementId> ignored1, ignored2;
    shared_ptr<OsmMap> after(new OsmMap(map));
    uut.applyManipulation(after, ignored1, ignored2);

    MapReprojector::reprojectToWgs84(after);

    QDir().mkpath("test-output/manipulators/");

    OsmWriter writer;
    writer.setIncludeCompatibilityTags(false);
    writer.write(after, "test-output/manipulators/WayMergeManipulation.osm");

    HOOT_FILE_EQUALS("test-output/manipulators/WayMergeManipulation.osm",
                     "test-files/manipulators/WayMergeManipulationOutput.osm");
  }
开发者ID:drew-bower,项目名称:hootenanny,代码行数:32,代码来源:WayMergeManipulationTest.cpp

示例2: funnyCurveTest

    void funnyCurveTest()
    {
        OsmReader reader;

        OsmMap::resetCounters();

        shared_ptr<OsmMap> map(new OsmMap());
        reader.setDefaultStatus(Status::Unknown1);
        reader.read("test-files/MaximalNearestSubline2.osm", map);

        MapReprojector::reprojectToPlanar(map);

        long n1 = map->findWays("note", "1")[0];
        long n2 = map->findWays("note", "2")[0];
        shared_ptr<Way> left = MaximalNearestSubline::getMaximalNearestSubline(map,
                               map->getWay(n1),
                               map->getWay(n2),
                               10.0, 10.0);
        left->setStatus(Status::Conflated);
        left->setTag("name", "left");
        map->addWay(left);
        //cout << ElementConverter(map).convertToLineString(left)->toString() << endl;

        shared_ptr<Way> right = MaximalNearestSubline::getMaximalNearestSubline(map,
                                map->getWay(n2),
                                map->getWay(n1),
                                10.0, 10.0);
        right->setStatus(Status::Conflated);
        left->setTag("name", "right");
        map->addWay(right);
        //cout << ElementConverter(map).convertToLineString(right)->toString() << endl;

        shared_ptr<Way> w = WayAverager::average(map, right, left);
        w->setStatus(Status::Conflated);
        w->setTag("name", "average");
        map->addWay(w);
        //map->removeWay(n1);
        //map->removeWay(n2);
        QDir().mkpath("test-output/algorithms/");

        {
            shared_ptr<OsmMap> wgs84(new OsmMap(map));
            MapReprojector::reprojectToWgs84(wgs84);
            OsmWriter writer;
            writer.setIncludeCompatibilityTags(false);
            writer.setIncludeHootInfo(false);
            writer.setIncludeIds(false);
            QString fn = QString("test-output/algorithms/MaximalNearestSubline2TestOutput.osm");
            writer.write(wgs84, fn);
        }

        HOOT_FILE_EQUALS("test-files/algorithms/MaximalNearestSubline2TestOutput.osm",
                         "test-output/algorithms/MaximalNearestSubline2TestOutput.osm");
    }
开发者ID:mitulvpatel,项目名称:hootenanny,代码行数:54,代码来源:MaximalNearestSublineTest.cpp

示例3: runTest

  void runTest()
  {
    OsmReader reader;

    OsmMap::resetCounters();
    shared_ptr<OsmMap> map(new OsmMap());
    reader.setDefaultStatus(Status::Unknown1);
    reader.read("test-files/algorithms/LongestCommonNodeStringTest.osm", map);

    MapProjector::projectToOrthographic(map);
    DuplicateWayRemover::removeDuplicates(map);
    MapProjector::projectToWgs84(map);

    OsmWriter writer;
    writer.setIncludeCompatibilityTags(false);
    writer.write(map, "test-output/conflate/LongestCommonNodeStringTest.osm");

    HOOT_FILE_EQUALS("test-files/conflate/LongestCommonNodeStringTest.osm",
                     "test-output/conflate/LongestCommonNodeStringTest.osm");
  }
开发者ID:Nanonid,项目名称:hootenanny,代码行数:20,代码来源:DuplicateWayRemoverTest.cpp

示例4: runStrictTagMatchingOffTest

  /*
   * In this test we add in some non-matching, non-name text tags for two ways, and since strict
   * matching is *off*, we *should* see those two ways get merged.
   */
  void runStrictTagMatchingOffTest()
  {
    QDir().mkdir("test-output/conflate");
    OsmMap::resetCounters();
    shared_ptr<OsmMap> map(new OsmMap());
    OsmMapReaderFactory::read(map, "test-files/DcTigerRoads.osm", true, Status::Unknown1);

    //create a non matching text tag between two of the ways that will be examined
    map->getWay(map->findWays("name", "Constitution Ave NW")[0])->getTags().set("email", "blah");

    DuplicateWayRemover dupeWayRemover;
    dupeWayRemover.setStrictTagMatching(false);

    MapProjector::projectToOrthographic(map);
    dupeWayRemover.apply(map);
    MapProjector::projectToWgs84(map);

    OsmWriter writer;
    writer.setIncludeCompatibilityTags(false);
    writer.write(map, "test-output/conflate/DuplicateWayRemoverStrictTagMatchingOffTest.osm");

    HOOT_FILE_EQUALS("test-files/conflate/DuplicateWayRemoverStrictTagMatchingOffTest.osm",
                     "test-output/conflate/DuplicateWayRemoverStrictTagMatchingOffTest.osm");
  }
开发者ID:Nanonid,项目名称:hootenanny,代码行数:28,代码来源:DuplicateWayRemoverTest.cpp


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