本文整理汇总了C++中ConstWayPtr::getStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstWayPtr::getStatus方法的具体用法?C++ ConstWayPtr::getStatus怎么用?C++ ConstWayPtr::getStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstWayPtr
的用法示例。
在下文中一共展示了ConstWayPtr::getStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: toWay
WayPtr WaySubline::toWay(const OsmMapPtr& map, GeometryConverter::NodeFactory* nf) const
{
ConstWayPtr way = _start.getWay();
auto_ptr<GeometryConverter::NodeFactory> nfPtr;
if (nf == 0)
{
nf = new FindNodesInWayFactory(way);
// delete it automatically.
nfPtr.reset(nf);
}
WayPtr result(new Way(way->getStatus(), map->createNextWayId(), way->getCircularError()));
result->setTags(way->getTags());
int includedStartIndex = _start.getSegmentIndex();
if (_start.getSegmentFraction() > 0.0)
{
includedStartIndex += 1;
}
int includedEndIndex = _end.getSegmentIndex();
if (_end.getSegmentFraction() >= 1.0)
{
includedEndIndex += 1;
}
if (!_start.isNode())
{
Coordinate c = _start.getCoordinate();
shared_ptr<Node> n = nf->createNode(map, c, way->getStatus(),
way->getCircularError());
map->addNode(n);
result->addNode(n->getId());
}
for (int i = includedStartIndex; i <= includedEndIndex; i++)
{
result->addNode(way->getNodeId(i));
}
if (!_end.isNode())
{
Coordinate c = _end.getCoordinate();
shared_ptr<Node> n = nf->createNode(map, c, way->getStatus(), way->getCircularError());
map->addNode(n);
result->addNode(n->getId());
}
return result;
}