Exemplo n.º 1
0
 /**
  * Add role to buffer.
  *
  * @param member Relation member object where the length of the role
  *               will be set.
  * @param role The role.
  * @param length Length of role (without \0 termination).
  * @throws std:length_error If role is longer than osmium::max_osm_string_length
  */
 void add_role(osmium::RelationMember& member, const char* role, const size_t length) {
     if (length > osmium::max_osm_string_length) {
         throw std::length_error("OSM relation member role is too long");
     }
     member.set_role_size(osmium::string_size_type(length) + 1);
     add_size(append(role, osmium::memory::item_size_type(length)) + append_zero());
     add_padding(true);
 }
Exemplo n.º 2
0
 void update(const osmium::RelationMember& member) {
     update_int64(member.ref());
     update_int16(uint16_t(member.type()));
     update_string(member.role());
 }
Exemplo n.º 3
0
 void relation_member(const osmium::RelationMember& member) {
     *m_out += item_type_to_char(member.type());
     output_int(member.ref());
     *m_out += '@';
     append_encoded_string(member.role());
 }
Exemplo n.º 4
0
 /**
  * Overwritten from the base class.
  */
 bool keep_member(const osmium::relations::RelationMeta& /*relation_meta*/, const osmium::RelationMember& member) const {
     // We are only interested in members of type way.
     return member.type() == osmium::item_type::way;
 }
Exemplo n.º 5
0
 /**
  * Add role to buffer.
  *
  * @param member Relation member object where the length of the role
  *               will be set.
  * @param role The role.
  * @param length Length of role string including \0 termination.
  */
 void add_role(osmium::RelationMember& member, const char* role, const string_size_type length) {
     member.set_role_size(length);
     add_size(append(role, length));
     add_padding(true);
 }
Exemplo n.º 6
0
 bool member_is_valid(const osmium::RelationMember& member) {
     return member.type() == osmium::item_type::way;
 }
Exemplo n.º 7
0
 bool keep_member(const osmium::relations::RelationMeta&,
                  const osmium::RelationMember& member) const {
     return member.type() == osmium::item_type::way;
 }
 bool new_member(const osmium::Relation& /*relation*/, const osmium::RelationMember& member, std::size_t /*n*/) noexcept {
     return member.type() == osmium::item_type::node;
 }