本文整理汇总了C++中OsmWriter::setIncludeIds方法的典型用法代码示例。如果您正苦于以下问题:C++ OsmWriter::setIncludeIds方法的具体用法?C++ OsmWriter::setIncludeIds怎么用?C++ OsmWriter::setIncludeIds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OsmWriter
的用法示例。
在下文中一共展示了OsmWriter::setIncludeIds方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runConflateTest
void runConflateTest()
{
OsmReader reader;
shared_ptr<OsmMap> map(new OsmMap());
reader.setDefaultStatus(Status::Unknown1);
reader.read("test-files/ToyBuildingsTestA.osm", map);
reader.setDefaultStatus(Status::Unknown2);
reader.read("test-files/ToyBuildingsTestB.osm", map);
MapProjector::projectToPlanar(map);
WayMap wm = map->getWays();
for (WayMap::const_iterator it = wm.begin(); it != wm.end(); ++it)
{
const ConstWayPtr& w = it->second;
const Tags& t = w->getTags();
if (t["REF1"] != "Target" && t["REF2"] != "Target")
{
map->removeWay(it->first);
}
}
Conflator uut;
shared_ptr<Manipulator> m(new BuildingMergeManipulator());
deque< shared_ptr<Manipulator> > manipulators;
manipulators.push_back(m);
uut.setManipulators(manipulators);
uut.loadSource(map);
uut.conflate();
shared_ptr<OsmMap> out(new OsmMap(uut.getBestMap()));
MapProjector::projectToWgs84(out);
OsmWriter writer;
writer.setIncludeIds(true);
writer.write(out, "test-output/BuildingConflatorTest.osm");
ConstWayPtr cheddars = getWay(out, "REF1", "Cheddar's");
CPPUNIT_ASSERT_EQUAL(string("Cheddar's"), cheddars->getTags()["REF2"].toStdString());
HOOT_STR_EQUALS(Status::Conflated, cheddars->getStatus());
ConstWayPtr biondi = getWay(out, "REF1", "Biondi");
CPPUNIT_ASSERT_EQUAL(string("Biondi"), biondi->getTags()["REF2"].toStdString());
HOOT_STR_EQUALS(Status::Conflated, biondi->getStatus());
ConstWayPtr freddys = getWay(out, "REF1", "Freddy's");
CPPUNIT_ASSERT_EQUAL(false, freddys->getTags().contains("REF2"));
HOOT_STR_EQUALS(Status::Unknown1, freddys->getStatus());
ConstWayPtr target = getWay(out, "REF1", "Target");
CPPUNIT_ASSERT_EQUAL(string("Target"), biondi->getTags()["REF2"].toStdString());
HOOT_STR_EQUALS(Status::Unknown1, target->getStatus());
CPPUNIT_ASSERT_EQUAL((size_t)9, out->getWays().size());
}
示例2: _saveMap
void Conflator::_saveMap(QString path)
{
LOG_INFO("Writing debug .osm file..." << path.toStdString());
shared_ptr<OsmMap> wgs84(new OsmMap(_map));
MapReprojector::reprojectToWgs84(wgs84);
OsmWriter writer;
writer.setIncludeHootInfo(true);
writer.setIncludeIds(true);
writer.write(wgs84, path);
}
示例3: 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");
}
示例4: runPbfTest
void runPbfTest()
{
PbfReader reader(true);
shared_ptr<OsmMap> map(new OsmMap());
reader.setUseFileStatus(true);
reader.read("test-files/ToyTestCombined.pbf", map);
Conflator uut;
uut.loadSource(map);
uut.conflate();
shared_ptr<OsmMap> out(new OsmMap(uut.getBestMap()));
MapProjector::projectToWgs84(out);
CPPUNIT_ASSERT_EQUAL((size_t)15, out->getWays().size());
OsmWriter writer;
writer.setIncludeIds(true);
writer.write(out, "test-output/ConflatorPbfTest.osm");
}
示例5: runTest
void runTest()
{
OsmReader reader;
shared_ptr<OsmMap> map(new OsmMap());
reader.setDefaultStatus(Status::Unknown1);
reader.read("test-files/ToyTestA.osm", map);
reader.setDefaultStatus(Status::Unknown2);
reader.read("test-files/ToyTestB.osm", map);
Conflator uut;
uut.loadSource(map);
uut.conflate();
shared_ptr<OsmMap> out(new OsmMap(uut.getBestMap()));
MapProjector::projectToWgs84(out);
CPPUNIT_ASSERT_EQUAL((size_t)9, out->getWays().size());
OsmWriter writer;
writer.setIncludeIds(true);
writer.write(out, "test-output/ConflatorTest.osm");
}
示例6: preSplitTest
void preSplitTest()
{
OsmReader reader;
OsmMap::resetCounters();
shared_ptr<OsmMap> map(new OsmMap());
OsmMap::resetCounters();
reader.setDefaultStatus(Status::Unknown1);
reader.read("test-files/DividedHighwayPreSplit.osm", map);
reader.setDefaultStatus(Status::Unknown2);
reader.read("test-files/UndividedHighwayPreSplit.osm", map);
Conflator conflator;
conflator.loadSource(map);
conflator.conflate();
shared_ptr<OsmMap> after(new OsmMap(conflator.getBestMap()));
MapReprojector::reprojectToWgs84(after);
OsmWriter writer;
writer.setIncludeIds(true);
writer.write(after, "test-output/DividedHighwayMergerPreSplitTest.osm");
}