/** * Retrieve locations of all nodes in the way from storage and add * them to the way object. */ void way(osmium::Way& way) { if (m_must_sort) { m_storage_pos.sort(); m_storage_neg.sort(); m_must_sort = false; m_last_id = std::numeric_limits<osmium::unsigned_object_id_type>::max(); } bool error = false; for (auto& node_ref : way.nodes()) { node_ref.set_location(get_node_location(node_ref.ref())); if (!node_ref.location()) { error = true; } } if (!m_ignore_errors && error) { throw osmium::not_found{"location for one or more nodes not found in node location index"}; } }
/** * Retrieve locations of all nodes in the way from storage and add * them to the way object. */ void way(osmium::Way& way) { if (m_must_sort) { m_storage_pos.sort(); m_storage_neg.sort(); m_must_sort = false; } bool error = false; for (auto& node_ref : way.nodes()) { try { node_ref.set_location(get_node_location(node_ref.ref())); if (!node_ref.location()) { error = true; } } catch (osmium::not_found&) { error = true; } } if (error && !m_ignore_errors) { throw osmium::not_found("location for one or more nodes not found in node location index"); } }