本文整理汇总了C++中osmium::Way::ends_have_same_location方法的典型用法代码示例。如果您正苦于以下问题:C++ Way::ends_have_same_location方法的具体用法?C++ Way::ends_have_same_location怎么用?C++ Way::ends_have_same_location使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osmium::Way
的用法示例。
在下文中一共展示了Way::ends_have_same_location方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: way_not_in_any_relation
/**
* This is called when a way is not in any multipolygon
* relation.
*
* Overwritten from the base class.
*/
void way_not_in_any_relation(const osmium::Way& way) {
if (way.nodes().size() > 3 && way.ends_have_same_location()) {
// way is closed and has enough nodes, build simple multipolygon
try {
TAssembler assembler(m_assembler_config);
assembler(way, m_output_buffer);
possibly_flush_output_buffer();
} catch (osmium::invalid_location&) {
// XXX ignore
}
}
}
示例2: way_not_in_any_relation
/**
* This is called when a way is not in any multipolygon
* relation.
*/
void way_not_in_any_relation(const osmium::Way& way) {
// you need at least 4 nodes to make up a polygon
if (way.nodes().size() <= 3) {
return;
}
try {
if (!way.nodes().front().location() || !way.nodes().back().location()) {
throw osmium::invalid_location{"invalid location"};
}
if (way.ends_have_same_location()) {
// way is closed and has enough nodes, build simple multipolygon
TAssembler assembler{m_assembler_config};
assembler(way, this->buffer());
m_stats += assembler.stats();
}
} catch (const osmium::invalid_location&) {
// XXX ignore
}
}
示例3: way_not_in_any_relation
/**
* This is called when a way is not in any multipolygon
* relation.
*
* Overwritten from the base class.
*/
void way_not_in_any_relation(const osmium::Way& way) {
// you need at least 4 nodes to make up a polygon
if (way.nodes().size() <= 3) {
return;
}
try {
if (!way.nodes().front().location() || !way.nodes().back().location()) {
throw osmium::invalid_location("invalid location");
}
if (way.ends_have_same_location()) {
// way is closed and has enough nodes, build simple multipolygon
TAssembler assembler(m_assembler_config);
assembler(way, m_output_buffer);
possibly_flush_output_buffer();
}
} catch (osmium::invalid_location&) {
// XXX ignore
}
}