本文整理汇总了C++中WayPtr::getTimestamp方法的典型用法代码示例。如果您正苦于以下问题:C++ WayPtr::getTimestamp方法的具体用法?C++ WayPtr::getTimestamp怎么用?C++ WayPtr::getTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WayPtr
的用法示例。
在下文中一共展示了WayPtr::getTimestamp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runReadByBoundsTest
void runReadByBoundsTest()
{
insertDataForBoundTest();
OsmApiDb database;
database.open(ServicesDbTestUtils::getOsmApiDbUrl());
OsmApiDbReader reader;
reader.open(ServicesDbTestUtils::getOsmApiDbUrl().toString());
OsmMapPtr map(new OsmMap());
reader.setBoundingBox("-88.1,28.91,-88.0,28.89");
reader.read(map);
//quick check to see if the element counts are off...consult the test output for more detail
//All but two of the seven nodes should be returned. There are five nodes outside of the
//requested bounds, one of them is referenced by a way within the bounds and the other three by a
//relation within the bounds. The nodes not returned is outside of the requested bounds and not
//reference by any other element.
CPPUNIT_ASSERT_EQUAL(5, (int)map->getNodes().size());
//Two of the five ways should be returned. The ways not returned contain nodes
//that are out of bounds.
CPPUNIT_ASSERT_EQUAL(2, (int)map->getWays().size());
//Two of the six relations should be returned. The relations not returned contain all
//members that are out of bounds.
CPPUNIT_ASSERT_EQUAL(2, (int)map->getRelations().size());
// Verify timestamps look OK
WayPtr pWay = map->getWays().begin()->second;
CPPUNIT_ASSERT(0 != pWay->getTimestamp());
//Need to remove timestamps, otherwise they cause issues with the compare
QList<ElementAttributeType> types;
types.append(ElementAttributeType(ElementAttributeType::Timestamp));
RemoveAttributesVisitor attrVis(types);
map->visitRw(attrVis);
TestUtils::mkpath("test-output/io/ServiceOsmApiDbReaderTest");
MapProjector::projectToWgs84(map);
OsmMapWriterFactory::write(map,
"test-output/io/ServiceOsmApiDbReaderTest/runReadByBoundsTest.osm");
HOOT_STR_EQUALS(
TestUtils::readFile("test-files/io/ServiceOsmApiDbReaderTest/runReadByBoundsTest.osm"),
TestUtils::readFile("test-output/io/ServiceOsmApiDbReaderTest/runReadByBoundsTest.osm"));
//just want to make sure I can read against the same data twice in a row w/o crashing and also
//make sure I don't get the same result again for a different bounds
reader.setBoundingBox("-1,-1,1,1");
map.reset(new OsmMap());
reader.read(map);
CPPUNIT_ASSERT_EQUAL(0, (int)map->getNodes().size());
CPPUNIT_ASSERT_EQUAL(0, (int)map->getWays().size());
CPPUNIT_ASSERT_EQUAL(0, (int)map->getRelations().size());
reader.close();
}