// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: osmformat.proto

#include "osmformat.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ChangeSet_osmformat_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_DenseInfo_osmformat_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DenseNodes_osmformat_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_HeaderBBox_osmformat_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Info_osmformat_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Node_osmformat_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<5> scc_info_PrimitiveGroup_osmformat_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Relation_osmformat_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StringTable_osmformat_2eproto;
extern PROTOBUF_INTERNAL_EXPORT_osmformat_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Way_osmformat_2eproto;
namespace OSMPBF {
class HeaderBlockDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<HeaderBlock> _instance;
} _HeaderBlock_default_instance_;
class HeaderBBoxDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<HeaderBBox> _instance;
} _HeaderBBox_default_instance_;
class PrimitiveBlockDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PrimitiveBlock> _instance;
} _PrimitiveBlock_default_instance_;
class PrimitiveGroupDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<PrimitiveGroup> _instance;
} _PrimitiveGroup_default_instance_;
class StringTableDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<StringTable> _instance;
} _StringTable_default_instance_;
class InfoDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Info> _instance;
} _Info_default_instance_;
class DenseInfoDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<DenseInfo> _instance;
} _DenseInfo_default_instance_;
class ChangeSetDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ChangeSet> _instance;
} _ChangeSet_default_instance_;
class NodeDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Node> _instance;
} _Node_default_instance_;
class DenseNodesDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<DenseNodes> _instance;
} _DenseNodes_default_instance_;
class WayDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Way> _instance;
} _Way_default_instance_;
class RelationDefaultTypeInternal {
 public:
  ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Relation> _instance;
} _Relation_default_instance_;
}  // namespace OSMPBF
static void InitDefaultsscc_info_ChangeSet_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_ChangeSet_default_instance_;
    new (ptr) ::OSMPBF::ChangeSet();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::ChangeSet::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_ChangeSet_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_ChangeSet_osmformat_2eproto}, {}};

static void InitDefaultsscc_info_DenseInfo_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_DenseInfo_default_instance_;
    new (ptr) ::OSMPBF::DenseInfo();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::DenseInfo::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_DenseInfo_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_DenseInfo_osmformat_2eproto}, {}};

static void InitDefaultsscc_info_DenseNodes_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_DenseNodes_default_instance_;
    new (ptr) ::OSMPBF::DenseNodes();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::DenseNodes::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_DenseNodes_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_DenseNodes_osmformat_2eproto}, {
      &scc_info_DenseInfo_osmformat_2eproto.base,}};

static void InitDefaultsscc_info_HeaderBBox_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_HeaderBBox_default_instance_;
    new (ptr) ::OSMPBF::HeaderBBox();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::HeaderBBox::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_HeaderBBox_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_HeaderBBox_osmformat_2eproto}, {}};

static void InitDefaultsscc_info_HeaderBlock_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_HeaderBlock_default_instance_;
    new (ptr) ::OSMPBF::HeaderBlock();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::HeaderBlock::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_HeaderBlock_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_HeaderBlock_osmformat_2eproto}, {
      &scc_info_HeaderBBox_osmformat_2eproto.base,}};

static void InitDefaultsscc_info_Info_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_Info_default_instance_;
    new (ptr) ::OSMPBF::Info();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::Info::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Info_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Info_osmformat_2eproto}, {}};

static void InitDefaultsscc_info_Node_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_Node_default_instance_;
    new (ptr) ::OSMPBF::Node();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::Node::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Node_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_Node_osmformat_2eproto}, {
      &scc_info_Info_osmformat_2eproto.base,}};

static void InitDefaultsscc_info_PrimitiveBlock_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_PrimitiveBlock_default_instance_;
    new (ptr) ::OSMPBF::PrimitiveBlock();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::PrimitiveBlock::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_PrimitiveBlock_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_PrimitiveBlock_osmformat_2eproto}, {
      &scc_info_StringTable_osmformat_2eproto.base,
      &scc_info_PrimitiveGroup_osmformat_2eproto.base,}};

static void InitDefaultsscc_info_PrimitiveGroup_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_PrimitiveGroup_default_instance_;
    new (ptr) ::OSMPBF::PrimitiveGroup();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::PrimitiveGroup::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<5> scc_info_PrimitiveGroup_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 5, 0, InitDefaultsscc_info_PrimitiveGroup_osmformat_2eproto}, {
      &scc_info_Node_osmformat_2eproto.base,
      &scc_info_DenseNodes_osmformat_2eproto.base,
      &scc_info_Way_osmformat_2eproto.base,
      &scc_info_Relation_osmformat_2eproto.base,
      &scc_info_ChangeSet_osmformat_2eproto.base,}};

static void InitDefaultsscc_info_Relation_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_Relation_default_instance_;
    new (ptr) ::OSMPBF::Relation();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::Relation::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Relation_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_Relation_osmformat_2eproto}, {
      &scc_info_Info_osmformat_2eproto.base,}};

static void InitDefaultsscc_info_StringTable_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_StringTable_default_instance_;
    new (ptr) ::OSMPBF::StringTable();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::StringTable::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_StringTable_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_StringTable_osmformat_2eproto}, {}};

static void InitDefaultsscc_info_Way_osmformat_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::OSMPBF::_Way_default_instance_;
    new (ptr) ::OSMPBF::Way();
    ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  }
  ::OSMPBF::Way::InitAsDefaultInstance();
}

::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Way_osmformat_2eproto =
    {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_Way_osmformat_2eproto}, {
      &scc_info_Info_osmformat_2eproto.base,}};

namespace OSMPBF {
bool Relation_MemberType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> Relation_MemberType_strings[3] = {};

static const char Relation_MemberType_names[] =
  "NODE"
  "RELATION"
  "WAY";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry Relation_MemberType_entries[] = {
  { {Relation_MemberType_names + 0, 4}, 0 },
  { {Relation_MemberType_names + 4, 8}, 2 },
  { {Relation_MemberType_names + 12, 3}, 1 },
};

static const int Relation_MemberType_entries_by_number[] = {
  0, // 0 -> NODE
  2, // 1 -> WAY
  1, // 2 -> RELATION
};

const std::string& Relation_MemberType_Name(
    Relation_MemberType value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          Relation_MemberType_entries,
          Relation_MemberType_entries_by_number,
          3, Relation_MemberType_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      Relation_MemberType_entries,
      Relation_MemberType_entries_by_number,
      3, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     Relation_MemberType_strings[idx].get();
}
bool Relation_MemberType_Parse(
    const std::string& name, Relation_MemberType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      Relation_MemberType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<Relation_MemberType>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)
constexpr Relation_MemberType Relation::NODE;
constexpr Relation_MemberType Relation::WAY;
constexpr Relation_MemberType Relation::RELATION;
constexpr Relation_MemberType Relation::MemberType_MIN;
constexpr Relation_MemberType Relation::MemberType_MAX;
constexpr int Relation::MemberType_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || _MSC_VER >= 1900)

// ===================================================================

void HeaderBlock::InitAsDefaultInstance() {
  ::OSMPBF::_HeaderBlock_default_instance_._instance.get_mutable()->bbox_ = const_cast< ::OSMPBF::HeaderBBox*>(
      ::OSMPBF::HeaderBBox::internal_default_instance());
}
class HeaderBlock::_Internal {
 public:
  using HasBits = decltype(std::declval<HeaderBlock>()._has_bits_);
  static const ::OSMPBF::HeaderBBox& bbox(const HeaderBlock* msg);
  static void set_has_bbox(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_writingprogram(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_source(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_osmosis_replication_timestamp(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_osmosis_replication_sequence_number(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_osmosis_replication_base_url(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
};

const ::OSMPBF::HeaderBBox&
HeaderBlock::_Internal::bbox(const HeaderBlock* msg) {
  return *msg->bbox_;
}
HeaderBlock::HeaderBlock(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
  required_features_(arena),
  optional_features_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.HeaderBlock)
}
HeaderBlock::HeaderBlock(const HeaderBlock& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      required_features_(from.required_features_),
      optional_features_(from.optional_features_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  writingprogram_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_writingprogram()) {
    writingprogram_.SetLite(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_writingprogram(),
      GetArena());
  }
  source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_source()) {
    source_.SetLite(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_source(),
      GetArena());
  }
  osmosis_replication_base_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (from._internal_has_osmosis_replication_base_url()) {
    osmosis_replication_base_url_.SetLite(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_osmosis_replication_base_url(),
      GetArena());
  }
  if (from._internal_has_bbox()) {
    bbox_ = new ::OSMPBF::HeaderBBox(*from.bbox_);
  } else {
    bbox_ = nullptr;
  }
  ::memcpy(&osmosis_replication_timestamp_, &from.osmosis_replication_timestamp_,
    static_cast<size_t>(reinterpret_cast<char*>(&osmosis_replication_sequence_number_) -
    reinterpret_cast<char*>(&osmosis_replication_timestamp_)) + sizeof(osmosis_replication_sequence_number_));
  // @@protoc_insertion_point(copy_constructor:OSMPBF.HeaderBlock)
}

void HeaderBlock::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_HeaderBlock_osmformat_2eproto.base);
  writingprogram_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  source_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  osmosis_replication_base_url_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  ::memset(&bbox_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&osmosis_replication_sequence_number_) -
      reinterpret_cast<char*>(&bbox_)) + sizeof(osmosis_replication_sequence_number_));
}

HeaderBlock::~HeaderBlock() {
  // @@protoc_insertion_point(destructor:OSMPBF.HeaderBlock)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void HeaderBlock::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
  writingprogram_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  source_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  osmosis_replication_base_url_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete bbox_;
}

void HeaderBlock::ArenaDtor(void* object) {
  HeaderBlock* _this = reinterpret_cast< HeaderBlock* >(object);
  (void)_this;
}
void HeaderBlock::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void HeaderBlock::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const HeaderBlock& HeaderBlock::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HeaderBlock_osmformat_2eproto.base);
  return *internal_default_instance();
}


void HeaderBlock::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.HeaderBlock)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  required_features_.Clear();
  optional_features_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      writingprogram_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      source_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000004u) {
      osmosis_replication_base_url_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000008u) {
      GOOGLE_DCHECK(bbox_ != nullptr);
      bbox_->Clear();
    }
  }
  if (cached_has_bits & 0x00000030u) {
    ::memset(&osmosis_replication_timestamp_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&osmosis_replication_sequence_number_) -
        reinterpret_cast<char*>(&osmosis_replication_timestamp_)) + sizeof(osmosis_replication_sequence_number_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* HeaderBlock::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional .OSMPBF.HeaderBBox bbox = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_bbox(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated string required_features = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_required_features();
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
        } else goto handle_unusual;
        continue;
      // repeated string optional_features = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_optional_features();
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
        } else goto handle_unusual;
        continue;
      // optional string writingprogram = 16;
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 130)) {
          auto str = _internal_mutable_writingprogram();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional string source = 17;
      case 17:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 138)) {
          auto str = _internal_mutable_source();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 osmosis_replication_timestamp = 32;
      case 32:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 0)) {
          _Internal::set_has_osmosis_replication_timestamp(&has_bits);
          osmosis_replication_timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 osmosis_replication_sequence_number = 33;
      case 33:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_osmosis_replication_sequence_number(&has_bits);
          osmosis_replication_sequence_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional string osmosis_replication_base_url = 34;
      case 34:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          auto str = _internal_mutable_osmosis_replication_base_url();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* HeaderBlock::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.HeaderBlock)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional .OSMPBF.HeaderBBox bbox = 1;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        1, _Internal::bbox(this), target, stream);
  }

  // repeated string required_features = 4;
  for (int i = 0, n = this->_internal_required_features_size(); i < n; i++) {
    const auto& s = this->_internal_required_features(i);
    target = stream->WriteString(4, s, target);
  }

  // repeated string optional_features = 5;
  for (int i = 0, n = this->_internal_optional_features_size(); i < n; i++) {
    const auto& s = this->_internal_optional_features(i);
    target = stream->WriteString(5, s, target);
  }

  // optional string writingprogram = 16;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        16, this->_internal_writingprogram(), target);
  }

  // optional string source = 17;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteStringMaybeAliased(
        17, this->_internal_source(), target);
  }

  // optional int64 osmosis_replication_timestamp = 32;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(32, this->_internal_osmosis_replication_timestamp(), target);
  }

  // optional int64 osmosis_replication_sequence_number = 33;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(33, this->_internal_osmosis_replication_sequence_number(), target);
  }

  // optional string osmosis_replication_base_url = 34;
  if (cached_has_bits & 0x00000004u) {
    target = stream->WriteStringMaybeAliased(
        34, this->_internal_osmosis_replication_base_url(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.HeaderBlock)
  return target;
}

size_t HeaderBlock::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.HeaderBlock)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated string required_features = 4;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(required_features_.size());
  for (int i = 0, n = required_features_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
      required_features_.Get(i));
  }

  // repeated string optional_features = 5;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(optional_features_.size());
  for (int i = 0, n = optional_features_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
      optional_features_.Get(i));
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000003fu) {
    // optional string writingprogram = 16;
    if (cached_has_bits & 0x00000001u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_writingprogram());
    }

    // optional string source = 17;
    if (cached_has_bits & 0x00000002u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_source());
    }

    // optional string osmosis_replication_base_url = 34;
    if (cached_has_bits & 0x00000004u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_osmosis_replication_base_url());
    }

    // optional .OSMPBF.HeaderBBox bbox = 1;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *bbox_);
    }

    // optional int64 osmosis_replication_timestamp = 32;
    if (cached_has_bits & 0x00000010u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->_internal_osmosis_replication_timestamp());
    }

    // optional int64 osmosis_replication_sequence_number = 33;
    if (cached_has_bits & 0x00000020u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->_internal_osmosis_replication_sequence_number());
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void HeaderBlock::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const HeaderBlock*>(
      &from));
}

void HeaderBlock::MergeFrom(const HeaderBlock& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.HeaderBlock)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  required_features_.MergeFrom(from.required_features_);
  optional_features_.MergeFrom(from.optional_features_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000003fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_writingprogram(from._internal_writingprogram());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_source(from._internal_source());
    }
    if (cached_has_bits & 0x00000004u) {
      _internal_set_osmosis_replication_base_url(from._internal_osmosis_replication_base_url());
    }
    if (cached_has_bits & 0x00000008u) {
      _internal_mutable_bbox()->::OSMPBF::HeaderBBox::MergeFrom(from._internal_bbox());
    }
    if (cached_has_bits & 0x00000010u) {
      osmosis_replication_timestamp_ = from.osmosis_replication_timestamp_;
    }
    if (cached_has_bits & 0x00000020u) {
      osmosis_replication_sequence_number_ = from.osmosis_replication_sequence_number_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void HeaderBlock::CopyFrom(const HeaderBlock& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.HeaderBlock)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool HeaderBlock::IsInitialized() const {
  if (_internal_has_bbox()) {
    if (!bbox_->IsInitialized()) return false;
  }
  return true;
}

void HeaderBlock::InternalSwap(HeaderBlock* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  required_features_.InternalSwap(&other->required_features_);
  optional_features_.InternalSwap(&other->optional_features_);
  writingprogram_.Swap(&other->writingprogram_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  source_.Swap(&other->source_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  osmosis_replication_base_url_.Swap(&other->osmosis_replication_base_url_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(HeaderBlock, osmosis_replication_sequence_number_)
      + sizeof(HeaderBlock::osmosis_replication_sequence_number_)
      - PROTOBUF_FIELD_OFFSET(HeaderBlock, bbox_)>(
          reinterpret_cast<char*>(&bbox_),
          reinterpret_cast<char*>(&other->bbox_));
}

std::string HeaderBlock::GetTypeName() const {
  return "OSMPBF.HeaderBlock";
}


// ===================================================================

void HeaderBBox::InitAsDefaultInstance() {
}
class HeaderBBox::_Internal {
 public:
  using HasBits = decltype(std::declval<HeaderBBox>()._has_bits_);
  static void set_has_left(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_right(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_top(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_bottom(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x0000000f) ^ 0x0000000f) != 0;
  }
};

HeaderBBox::HeaderBBox(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.HeaderBBox)
}
HeaderBBox::HeaderBBox(const HeaderBBox& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&left_, &from.left_,
    static_cast<size_t>(reinterpret_cast<char*>(&bottom_) -
    reinterpret_cast<char*>(&left_)) + sizeof(bottom_));
  // @@protoc_insertion_point(copy_constructor:OSMPBF.HeaderBBox)
}

void HeaderBBox::SharedCtor() {
  ::memset(&left_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&bottom_) -
      reinterpret_cast<char*>(&left_)) + sizeof(bottom_));
}

HeaderBBox::~HeaderBBox() {
  // @@protoc_insertion_point(destructor:OSMPBF.HeaderBBox)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void HeaderBBox::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
}

void HeaderBBox::ArenaDtor(void* object) {
  HeaderBBox* _this = reinterpret_cast< HeaderBBox* >(object);
  (void)_this;
}
void HeaderBBox::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void HeaderBBox::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const HeaderBBox& HeaderBBox::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_HeaderBBox_osmformat_2eproto.base);
  return *internal_default_instance();
}


void HeaderBBox::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.HeaderBBox)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    ::memset(&left_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&bottom_) -
        reinterpret_cast<char*>(&left_)) + sizeof(bottom_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* HeaderBBox::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // required sint64 left = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_left(&has_bits);
          left_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // required sint64 right = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          _Internal::set_has_right(&has_bits);
          right_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // required sint64 top = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          _Internal::set_has_top(&has_bits);
          top_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // required sint64 bottom = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
          _Internal::set_has_bottom(&has_bits);
          bottom_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* HeaderBBox::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.HeaderBBox)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required sint64 left = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(1, this->_internal_left(), target);
  }

  // required sint64 right = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(2, this->_internal_right(), target);
  }

  // required sint64 top = 3;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(3, this->_internal_top(), target);
  }

  // required sint64 bottom = 4;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(4, this->_internal_bottom(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.HeaderBBox)
  return target;
}

size_t HeaderBBox::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:OSMPBF.HeaderBBox)
  size_t total_size = 0;

  if (_internal_has_left()) {
    // required sint64 left = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_left());
  }

  if (_internal_has_right()) {
    // required sint64 right = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_right());
  }

  if (_internal_has_top()) {
    // required sint64 top = 3;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_top());
  }

  if (_internal_has_bottom()) {
    // required sint64 bottom = 4;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_bottom());
  }

  return total_size;
}
size_t HeaderBBox::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.HeaderBBox)
  size_t total_size = 0;

  if (((_has_bits_[0] & 0x0000000f) ^ 0x0000000f) == 0) {  // All required fields are present.
    // required sint64 left = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_left());

    // required sint64 right = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_right());

    // required sint64 top = 3;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_top());

    // required sint64 bottom = 4;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_bottom());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void HeaderBBox::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const HeaderBBox*>(
      &from));
}

void HeaderBBox::MergeFrom(const HeaderBBox& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.HeaderBBox)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      left_ = from.left_;
    }
    if (cached_has_bits & 0x00000002u) {
      right_ = from.right_;
    }
    if (cached_has_bits & 0x00000004u) {
      top_ = from.top_;
    }
    if (cached_has_bits & 0x00000008u) {
      bottom_ = from.bottom_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void HeaderBBox::CopyFrom(const HeaderBBox& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.HeaderBBox)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool HeaderBBox::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void HeaderBBox::InternalSwap(HeaderBBox* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(HeaderBBox, bottom_)
      + sizeof(HeaderBBox::bottom_)
      - PROTOBUF_FIELD_OFFSET(HeaderBBox, left_)>(
          reinterpret_cast<char*>(&left_),
          reinterpret_cast<char*>(&other->left_));
}

std::string HeaderBBox::GetTypeName() const {
  return "OSMPBF.HeaderBBox";
}


// ===================================================================

void PrimitiveBlock::InitAsDefaultInstance() {
  ::OSMPBF::_PrimitiveBlock_default_instance_._instance.get_mutable()->stringtable_ = const_cast< ::OSMPBF::StringTable*>(
      ::OSMPBF::StringTable::internal_default_instance());
}
class PrimitiveBlock::_Internal {
 public:
  using HasBits = decltype(std::declval<PrimitiveBlock>()._has_bits_);
  static const ::OSMPBF::StringTable& stringtable(const PrimitiveBlock* msg);
  static void set_has_stringtable(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_granularity(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_lat_offset(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_lon_offset(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_date_granularity(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

const ::OSMPBF::StringTable&
PrimitiveBlock::_Internal::stringtable(const PrimitiveBlock* msg) {
  return *msg->stringtable_;
}
PrimitiveBlock::PrimitiveBlock(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
  primitivegroup_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.PrimitiveBlock)
}
PrimitiveBlock::PrimitiveBlock(const PrimitiveBlock& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      primitivegroup_(from.primitivegroup_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if (from._internal_has_stringtable()) {
    stringtable_ = new ::OSMPBF::StringTable(*from.stringtable_);
  } else {
    stringtable_ = nullptr;
  }
  ::memcpy(&lat_offset_, &from.lat_offset_,
    static_cast<size_t>(reinterpret_cast<char*>(&date_granularity_) -
    reinterpret_cast<char*>(&lat_offset_)) + sizeof(date_granularity_));
  // @@protoc_insertion_point(copy_constructor:OSMPBF.PrimitiveBlock)
}

void PrimitiveBlock::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PrimitiveBlock_osmformat_2eproto.base);
  ::memset(&stringtable_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&lon_offset_) -
      reinterpret_cast<char*>(&stringtable_)) + sizeof(lon_offset_));
  granularity_ = 100;
  date_granularity_ = 1000;
}

PrimitiveBlock::~PrimitiveBlock() {
  // @@protoc_insertion_point(destructor:OSMPBF.PrimitiveBlock)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void PrimitiveBlock::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
  if (this != internal_default_instance()) delete stringtable_;
}

void PrimitiveBlock::ArenaDtor(void* object) {
  PrimitiveBlock* _this = reinterpret_cast< PrimitiveBlock* >(object);
  (void)_this;
}
void PrimitiveBlock::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void PrimitiveBlock::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const PrimitiveBlock& PrimitiveBlock::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PrimitiveBlock_osmformat_2eproto.base);
  return *internal_default_instance();
}


void PrimitiveBlock::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.PrimitiveBlock)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  primitivegroup_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(stringtable_ != nullptr);
    stringtable_->Clear();
  }
  if (cached_has_bits & 0x0000001eu) {
    ::memset(&lat_offset_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&lon_offset_) -
        reinterpret_cast<char*>(&lat_offset_)) + sizeof(lon_offset_));
    granularity_ = 100;
    date_granularity_ = 1000;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* PrimitiveBlock::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // required .OSMPBF.StringTable stringtable = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_stringtable(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_primitivegroup(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
        } else goto handle_unusual;
        continue;
      // optional int32 granularity = 17 [default = 100];
      case 17:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) {
          _Internal::set_has_granularity(&has_bits);
          granularity_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int32 date_granularity = 18 [default = 1000];
      case 18:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 144)) {
          _Internal::set_has_date_granularity(&has_bits);
          date_granularity_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 lat_offset = 19 [default = 0];
      case 19:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 152)) {
          _Internal::set_has_lat_offset(&has_bits);
          lat_offset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 lon_offset = 20 [default = 0];
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 160)) {
          _Internal::set_has_lon_offset(&has_bits);
          lon_offset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* PrimitiveBlock::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.PrimitiveBlock)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required .OSMPBF.StringTable stringtable = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        1, _Internal::stringtable(this), target, stream);
  }

  // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_primitivegroup_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, this->_internal_primitivegroup(i), target, stream);
  }

  // optional int32 granularity = 17 [default = 100];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(17, this->_internal_granularity(), target);
  }

  // optional int32 date_granularity = 18 [default = 1000];
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(18, this->_internal_date_granularity(), target);
  }

  // optional int64 lat_offset = 19 [default = 0];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(19, this->_internal_lat_offset(), target);
  }

  // optional int64 lon_offset = 20 [default = 0];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(20, this->_internal_lon_offset(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.PrimitiveBlock)
  return target;
}

size_t PrimitiveBlock::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.PrimitiveBlock)
  size_t total_size = 0;

  // required .OSMPBF.StringTable stringtable = 1;
  if (_internal_has_stringtable()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *stringtable_);
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;
  total_size += 1UL * this->_internal_primitivegroup_size();
  for (const auto& msg : this->primitivegroup_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000001eu) {
    // optional int64 lat_offset = 19 [default = 0];
    if (cached_has_bits & 0x00000002u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->_internal_lat_offset());
    }

    // optional int64 lon_offset = 20 [default = 0];
    if (cached_has_bits & 0x00000004u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->_internal_lon_offset());
    }

    // optional int32 granularity = 17 [default = 100];
    if (cached_has_bits & 0x00000008u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->_internal_granularity());
    }

    // optional int32 date_granularity = 18 [default = 1000];
    if (cached_has_bits & 0x00000010u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->_internal_date_granularity());
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PrimitiveBlock::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const PrimitiveBlock*>(
      &from));
}

void PrimitiveBlock::MergeFrom(const PrimitiveBlock& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.PrimitiveBlock)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  primitivegroup_.MergeFrom(from.primitivegroup_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_stringtable()->::OSMPBF::StringTable::MergeFrom(from._internal_stringtable());
    }
    if (cached_has_bits & 0x00000002u) {
      lat_offset_ = from.lat_offset_;
    }
    if (cached_has_bits & 0x00000004u) {
      lon_offset_ = from.lon_offset_;
    }
    if (cached_has_bits & 0x00000008u) {
      granularity_ = from.granularity_;
    }
    if (cached_has_bits & 0x00000010u) {
      date_granularity_ = from.date_granularity_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void PrimitiveBlock::CopyFrom(const PrimitiveBlock& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.PrimitiveBlock)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PrimitiveBlock::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(primitivegroup_)) return false;
  return true;
}

void PrimitiveBlock::InternalSwap(PrimitiveBlock* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  primitivegroup_.InternalSwap(&other->primitivegroup_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(PrimitiveBlock, lon_offset_)
      + sizeof(PrimitiveBlock::lon_offset_)
      - PROTOBUF_FIELD_OFFSET(PrimitiveBlock, stringtable_)>(
          reinterpret_cast<char*>(&stringtable_),
          reinterpret_cast<char*>(&other->stringtable_));
  swap(granularity_, other->granularity_);
  swap(date_granularity_, other->date_granularity_);
}

std::string PrimitiveBlock::GetTypeName() const {
  return "OSMPBF.PrimitiveBlock";
}


// ===================================================================

void PrimitiveGroup::InitAsDefaultInstance() {
  ::OSMPBF::_PrimitiveGroup_default_instance_._instance.get_mutable()->dense_ = const_cast< ::OSMPBF::DenseNodes*>(
      ::OSMPBF::DenseNodes::internal_default_instance());
}
class PrimitiveGroup::_Internal {
 public:
  using HasBits = decltype(std::declval<PrimitiveGroup>()._has_bits_);
  static const ::OSMPBF::DenseNodes& dense(const PrimitiveGroup* msg);
  static void set_has_dense(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::OSMPBF::DenseNodes&
PrimitiveGroup::_Internal::dense(const PrimitiveGroup* msg) {
  return *msg->dense_;
}
PrimitiveGroup::PrimitiveGroup(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
  nodes_(arena),
  ways_(arena),
  relations_(arena),
  changesets_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.PrimitiveGroup)
}
PrimitiveGroup::PrimitiveGroup(const PrimitiveGroup& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      nodes_(from.nodes_),
      ways_(from.ways_),
      relations_(from.relations_),
      changesets_(from.changesets_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if (from._internal_has_dense()) {
    dense_ = new ::OSMPBF::DenseNodes(*from.dense_);
  } else {
    dense_ = nullptr;
  }
  // @@protoc_insertion_point(copy_constructor:OSMPBF.PrimitiveGroup)
}

void PrimitiveGroup::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PrimitiveGroup_osmformat_2eproto.base);
  dense_ = nullptr;
}

PrimitiveGroup::~PrimitiveGroup() {
  // @@protoc_insertion_point(destructor:OSMPBF.PrimitiveGroup)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void PrimitiveGroup::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
  if (this != internal_default_instance()) delete dense_;
}

void PrimitiveGroup::ArenaDtor(void* object) {
  PrimitiveGroup* _this = reinterpret_cast< PrimitiveGroup* >(object);
  (void)_this;
}
void PrimitiveGroup::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void PrimitiveGroup::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const PrimitiveGroup& PrimitiveGroup::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PrimitiveGroup_osmformat_2eproto.base);
  return *internal_default_instance();
}


void PrimitiveGroup::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.PrimitiveGroup)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  nodes_.Clear();
  ways_.Clear();
  relations_.Clear();
  changesets_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(dense_ != nullptr);
    dense_->Clear();
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* PrimitiveGroup::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // repeated .OSMPBF.Node nodes = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_nodes(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else goto handle_unusual;
        continue;
      // optional .OSMPBF.DenseNodes dense = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_dense(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .OSMPBF.Way ways = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_ways(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr));
        } else goto handle_unusual;
        continue;
      // repeated .OSMPBF.Relation relations = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_relations(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
        } else goto handle_unusual;
        continue;
      // repeated .OSMPBF.ChangeSet changesets = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_changesets(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* PrimitiveGroup::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.PrimitiveGroup)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .OSMPBF.Node nodes = 1;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_nodes_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, this->_internal_nodes(i), target, stream);
  }

  cached_has_bits = _has_bits_[0];
  // optional .OSMPBF.DenseNodes dense = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::dense(this), target, stream);
  }

  // repeated .OSMPBF.Way ways = 3;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_ways_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, this->_internal_ways(i), target, stream);
  }

  // repeated .OSMPBF.Relation relations = 4;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_relations_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, this->_internal_relations(i), target, stream);
  }

  // repeated .OSMPBF.ChangeSet changesets = 5;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_changesets_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(5, this->_internal_changesets(i), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.PrimitiveGroup)
  return target;
}

size_t PrimitiveGroup::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.PrimitiveGroup)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated .OSMPBF.Node nodes = 1;
  total_size += 1UL * this->_internal_nodes_size();
  for (const auto& msg : this->nodes_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .OSMPBF.Way ways = 3;
  total_size += 1UL * this->_internal_ways_size();
  for (const auto& msg : this->ways_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .OSMPBF.Relation relations = 4;
  total_size += 1UL * this->_internal_relations_size();
  for (const auto& msg : this->relations_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // repeated .OSMPBF.ChangeSet changesets = 5;
  total_size += 1UL * this->_internal_changesets_size();
  for (const auto& msg : this->changesets_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  // optional .OSMPBF.DenseNodes dense = 2;
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *dense_);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PrimitiveGroup::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const PrimitiveGroup*>(
      &from));
}

void PrimitiveGroup::MergeFrom(const PrimitiveGroup& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.PrimitiveGroup)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  nodes_.MergeFrom(from.nodes_);
  ways_.MergeFrom(from.ways_);
  relations_.MergeFrom(from.relations_);
  changesets_.MergeFrom(from.changesets_);
  if (from._internal_has_dense()) {
    _internal_mutable_dense()->::OSMPBF::DenseNodes::MergeFrom(from._internal_dense());
  }
}

void PrimitiveGroup::CopyFrom(const PrimitiveGroup& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.PrimitiveGroup)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PrimitiveGroup::IsInitialized() const {
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(nodes_)) return false;
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(ways_)) return false;
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(relations_)) return false;
  if (!::PROTOBUF_NAMESPACE_ID::internal::AllAreInitialized(changesets_)) return false;
  return true;
}

void PrimitiveGroup::InternalSwap(PrimitiveGroup* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  nodes_.InternalSwap(&other->nodes_);
  ways_.InternalSwap(&other->ways_);
  relations_.InternalSwap(&other->relations_);
  changesets_.InternalSwap(&other->changesets_);
  swap(dense_, other->dense_);
}

std::string PrimitiveGroup::GetTypeName() const {
  return "OSMPBF.PrimitiveGroup";
}


// ===================================================================

void StringTable::InitAsDefaultInstance() {
}
class StringTable::_Internal {
 public:
};

StringTable::StringTable(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
  s_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.StringTable)
}
StringTable::StringTable(const StringTable& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      s_(from.s_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:OSMPBF.StringTable)
}

void StringTable::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StringTable_osmformat_2eproto.base);
}

StringTable::~StringTable() {
  // @@protoc_insertion_point(destructor:OSMPBF.StringTable)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void StringTable::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
}

void StringTable::ArenaDtor(void* object) {
  StringTable* _this = reinterpret_cast< StringTable* >(object);
  (void)_this;
}
void StringTable::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void StringTable::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const StringTable& StringTable::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StringTable_osmformat_2eproto.base);
  return *internal_default_instance();
}


void StringTable::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.StringTable)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  s_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* StringTable::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // repeated bytes s = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            auto str = _internal_add_s();
            ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* StringTable::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.StringTable)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated bytes s = 1;
  for (int i = 0, n = this->_internal_s_size(); i < n; i++) {
    const auto& s = this->_internal_s(i);
    target = stream->WriteBytes(1, s, target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.StringTable)
  return target;
}

size_t StringTable::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.StringTable)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated bytes s = 1;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(s_.size());
  for (int i = 0, n = s_.size(); i < n; i++) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
      s_.Get(i));
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void StringTable::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const StringTable*>(
      &from));
}

void StringTable::MergeFrom(const StringTable& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.StringTable)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  s_.MergeFrom(from.s_);
}

void StringTable::CopyFrom(const StringTable& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.StringTable)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool StringTable::IsInitialized() const {
  return true;
}

void StringTable::InternalSwap(StringTable* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  s_.InternalSwap(&other->s_);
}

std::string StringTable::GetTypeName() const {
  return "OSMPBF.StringTable";
}


// ===================================================================

void Info::InitAsDefaultInstance() {
}
class Info::_Internal {
 public:
  using HasBits = decltype(std::declval<Info>()._has_bits_);
  static void set_has_version(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_timestamp(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_changeset(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_uid(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_user_sid(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_visible(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
};

Info::Info(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.Info)
}
Info::Info(const Info& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::memcpy(&timestamp_, &from.timestamp_,
    static_cast<size_t>(reinterpret_cast<char*>(&version_) -
    reinterpret_cast<char*>(&timestamp_)) + sizeof(version_));
  // @@protoc_insertion_point(copy_constructor:OSMPBF.Info)
}

void Info::SharedCtor() {
  ::memset(&timestamp_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&visible_) -
      reinterpret_cast<char*>(&timestamp_)) + sizeof(visible_));
  version_ = -1;
}

Info::~Info() {
  // @@protoc_insertion_point(destructor:OSMPBF.Info)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void Info::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
}

void Info::ArenaDtor(void* object) {
  Info* _this = reinterpret_cast< Info* >(object);
  (void)_this;
}
void Info::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void Info::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const Info& Info::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Info_osmformat_2eproto.base);
  return *internal_default_instance();
}


void Info::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.Info)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000003fu) {
    ::memset(&timestamp_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&visible_) -
        reinterpret_cast<char*>(&timestamp_)) + sizeof(visible_));
    version_ = -1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Info::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // optional int32 version = 1 [default = -1];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_version(&has_bits);
          version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 timestamp = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
          _Internal::set_has_timestamp(&has_bits);
          timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int64 changeset = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) {
          _Internal::set_has_changeset(&has_bits);
          changeset_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional int32 uid = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
          _Internal::set_has_uid(&has_bits);
          uid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional uint32 user_sid = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) {
          _Internal::set_has_user_sid(&has_bits);
          user_sid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional bool visible = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) {
          _Internal::set_has_visible(&has_bits);
          visible_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* Info::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.Info)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int32 version = 1 [default = -1];
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_version(), target);
  }

  // optional int64 timestamp = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_timestamp(), target);
  }

  // optional int64 changeset = 3;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->_internal_changeset(), target);
  }

  // optional int32 uid = 4;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_uid(), target);
  }

  // optional uint32 user_sid = 5;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(5, this->_internal_user_sid(), target);
  }

  // optional bool visible = 6;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_visible(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.Info)
  return target;
}

size_t Info::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.Info)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000003fu) {
    // optional int64 timestamp = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->_internal_timestamp());
    }

    // optional int64 changeset = 3;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
          this->_internal_changeset());
    }

    // optional int32 uid = 4;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->_internal_uid());
    }

    // optional uint32 user_sid = 5;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size(
          this->_internal_user_sid());
    }

    // optional bool visible = 6;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 + 1;
    }

    // optional int32 version = 1 [default = -1];
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
          this->_internal_version());
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Info::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const Info*>(
      &from));
}

void Info::MergeFrom(const Info& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.Info)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000003fu) {
    if (cached_has_bits & 0x00000001u) {
      timestamp_ = from.timestamp_;
    }
    if (cached_has_bits & 0x00000002u) {
      changeset_ = from.changeset_;
    }
    if (cached_has_bits & 0x00000004u) {
      uid_ = from.uid_;
    }
    if (cached_has_bits & 0x00000008u) {
      user_sid_ = from.user_sid_;
    }
    if (cached_has_bits & 0x00000010u) {
      visible_ = from.visible_;
    }
    if (cached_has_bits & 0x00000020u) {
      version_ = from.version_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void Info::CopyFrom(const Info& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.Info)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Info::IsInitialized() const {
  return true;
}

void Info::InternalSwap(Info* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Info, visible_)
      + sizeof(Info::visible_)
      - PROTOBUF_FIELD_OFFSET(Info, timestamp_)>(
          reinterpret_cast<char*>(&timestamp_),
          reinterpret_cast<char*>(&other->timestamp_));
  swap(version_, other->version_);
}

std::string Info::GetTypeName() const {
  return "OSMPBF.Info";
}


// ===================================================================

void DenseInfo::InitAsDefaultInstance() {
}
class DenseInfo::_Internal {
 public:
};

DenseInfo::DenseInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
  version_(arena),
  timestamp_(arena),
  changeset_(arena),
  uid_(arena),
  user_sid_(arena),
  visible_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.DenseInfo)
}
DenseInfo::DenseInfo(const DenseInfo& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      version_(from.version_),
      timestamp_(from.timestamp_),
      changeset_(from.changeset_),
      uid_(from.uid_),
      user_sid_(from.user_sid_),
      visible_(from.visible_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:OSMPBF.DenseInfo)
}

void DenseInfo::SharedCtor() {
}

DenseInfo::~DenseInfo() {
  // @@protoc_insertion_point(destructor:OSMPBF.DenseInfo)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void DenseInfo::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
}

void DenseInfo::ArenaDtor(void* object) {
  DenseInfo* _this = reinterpret_cast< DenseInfo* >(object);
  (void)_this;
}
void DenseInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void DenseInfo::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const DenseInfo& DenseInfo::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_DenseInfo_osmformat_2eproto.base);
  return *internal_default_instance();
}


void DenseInfo::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.DenseInfo)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  version_.Clear();
  timestamp_.Clear();
  changeset_.Clear();
  uid_.Clear();
  user_sid_.Clear();
  visible_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* DenseInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // repeated int32 version = 1 [packed = true];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_version(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8) {
          _internal_add_version(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated sint64 timestamp = 2 [packed = true];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt64Parser(_internal_mutable_timestamp(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) {
          _internal_add_timestamp(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated sint64 changeset = 3 [packed = true];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt64Parser(_internal_mutable_changeset(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) {
          _internal_add_changeset(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated sint32 uid = 4 [packed = true];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt32Parser(_internal_mutable_uid(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32) {
          _internal_add_uid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag32(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated sint32 user_sid = 5 [packed = true];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt32Parser(_internal_mutable_user_sid(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40) {
          _internal_add_user_sid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag32(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated bool visible = 6 [packed = true];
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedBoolParser(_internal_mutable_visible(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48) {
          _internal_add_visible(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* DenseInfo::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.DenseInfo)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated int32 version = 1 [packed = true];
  {
    int byte_size = _version_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          1, _internal_version(), byte_size, target);
    }
  }

  // repeated sint64 timestamp = 2 [packed = true];
  {
    int byte_size = _timestamp_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteSInt64Packed(
          2, _internal_timestamp(), byte_size, target);
    }
  }

  // repeated sint64 changeset = 3 [packed = true];
  {
    int byte_size = _changeset_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteSInt64Packed(
          3, _internal_changeset(), byte_size, target);
    }
  }

  // repeated sint32 uid = 4 [packed = true];
  {
    int byte_size = _uid_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteSInt32Packed(
          4, _internal_uid(), byte_size, target);
    }
  }

  // repeated sint32 user_sid = 5 [packed = true];
  {
    int byte_size = _user_sid_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteSInt32Packed(
          5, _internal_user_sid(), byte_size, target);
    }
  }

  // repeated bool visible = 6 [packed = true];
  if (this->_internal_visible_size() > 0) {
    target = stream->WriteFixedPacked(6, _internal_visible(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.DenseInfo)
  return target;
}

size_t DenseInfo::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.DenseInfo)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated int32 version = 1 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int32Size(this->version_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _version_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated sint64 timestamp = 2 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      SInt64Size(this->timestamp_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _timestamp_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated sint64 changeset = 3 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      SInt64Size(this->changeset_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _changeset_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated sint32 uid = 4 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      SInt32Size(this->uid_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _uid_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated sint32 user_sid = 5 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      SInt32Size(this->user_sid_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _user_sid_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated bool visible = 6 [packed = true];
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_visible_size());
    size_t data_size = 1UL * count;
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _visible_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DenseInfo::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const DenseInfo*>(
      &from));
}

void DenseInfo::MergeFrom(const DenseInfo& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.DenseInfo)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  version_.MergeFrom(from.version_);
  timestamp_.MergeFrom(from.timestamp_);
  changeset_.MergeFrom(from.changeset_);
  uid_.MergeFrom(from.uid_);
  user_sid_.MergeFrom(from.user_sid_);
  visible_.MergeFrom(from.visible_);
}

void DenseInfo::CopyFrom(const DenseInfo& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.DenseInfo)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool DenseInfo::IsInitialized() const {
  return true;
}

void DenseInfo::InternalSwap(DenseInfo* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  version_.InternalSwap(&other->version_);
  timestamp_.InternalSwap(&other->timestamp_);
  changeset_.InternalSwap(&other->changeset_);
  uid_.InternalSwap(&other->uid_);
  user_sid_.InternalSwap(&other->user_sid_);
  visible_.InternalSwap(&other->visible_);
}

std::string DenseInfo::GetTypeName() const {
  return "OSMPBF.DenseInfo";
}


// ===================================================================

void ChangeSet::InitAsDefaultInstance() {
}
class ChangeSet::_Internal {
 public:
  using HasBits = decltype(std::declval<ChangeSet>()._has_bits_);
  static void set_has_id(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

ChangeSet::ChangeSet(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.ChangeSet)
}
ChangeSet::ChangeSet(const ChangeSet& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  id_ = from.id_;
  // @@protoc_insertion_point(copy_constructor:OSMPBF.ChangeSet)
}

void ChangeSet::SharedCtor() {
  id_ = PROTOBUF_LONGLONG(0);
}

ChangeSet::~ChangeSet() {
  // @@protoc_insertion_point(destructor:OSMPBF.ChangeSet)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void ChangeSet::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
}

void ChangeSet::ArenaDtor(void* object) {
  ChangeSet* _this = reinterpret_cast< ChangeSet* >(object);
  (void)_this;
}
void ChangeSet::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void ChangeSet::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const ChangeSet& ChangeSet::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ChangeSet_osmformat_2eproto.base);
  return *internal_default_instance();
}


void ChangeSet::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.ChangeSet)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  id_ = PROTOBUF_LONGLONG(0);
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* ChangeSet::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // required int64 id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_id(&has_bits);
          id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* ChangeSet::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.ChangeSet)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required int64 id = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_id(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.ChangeSet)
  return target;
}

size_t ChangeSet::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.ChangeSet)
  size_t total_size = 0;

  // required int64 id = 1;
  if (_internal_has_id()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
        this->_internal_id());
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void ChangeSet::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const ChangeSet*>(
      &from));
}

void ChangeSet::MergeFrom(const ChangeSet& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.ChangeSet)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from._internal_has_id()) {
    _internal_set_id(from._internal_id());
  }
}

void ChangeSet::CopyFrom(const ChangeSet& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.ChangeSet)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ChangeSet::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void ChangeSet::InternalSwap(ChangeSet* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  swap(id_, other->id_);
}

std::string ChangeSet::GetTypeName() const {
  return "OSMPBF.ChangeSet";
}


// ===================================================================

void Node::InitAsDefaultInstance() {
  ::OSMPBF::_Node_default_instance_._instance.get_mutable()->info_ = const_cast< ::OSMPBF::Info*>(
      ::OSMPBF::Info::internal_default_instance());
}
class Node::_Internal {
 public:
  using HasBits = decltype(std::declval<Node>()._has_bits_);
  static void set_has_id(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::OSMPBF::Info& info(const Node* msg);
  static void set_has_info(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_lat(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_lon(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x0000000e) ^ 0x0000000e) != 0;
  }
};

const ::OSMPBF::Info&
Node::_Internal::info(const Node* msg) {
  return *msg->info_;
}
Node::Node(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
  keys_(arena),
  vals_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.Node)
}
Node::Node(const Node& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      keys_(from.keys_),
      vals_(from.vals_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if (from._internal_has_info()) {
    info_ = new ::OSMPBF::Info(*from.info_);
  } else {
    info_ = nullptr;
  }
  ::memcpy(&id_, &from.id_,
    static_cast<size_t>(reinterpret_cast<char*>(&lon_) -
    reinterpret_cast<char*>(&id_)) + sizeof(lon_));
  // @@protoc_insertion_point(copy_constructor:OSMPBF.Node)
}

void Node::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Node_osmformat_2eproto.base);
  ::memset(&info_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&lon_) -
      reinterpret_cast<char*>(&info_)) + sizeof(lon_));
}

Node::~Node() {
  // @@protoc_insertion_point(destructor:OSMPBF.Node)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void Node::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
  if (this != internal_default_instance()) delete info_;
}

void Node::ArenaDtor(void* object) {
  Node* _this = reinterpret_cast< Node* >(object);
  (void)_this;
}
void Node::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void Node::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const Node& Node::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Node_osmformat_2eproto.base);
  return *internal_default_instance();
}


void Node::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.Node)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  keys_.Clear();
  vals_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(info_ != nullptr);
    info_->Clear();
  }
  if (cached_has_bits & 0x0000000eu) {
    ::memset(&id_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&lon_) -
        reinterpret_cast<char*>(&id_)) + sizeof(lon_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Node::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // required sint64 id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_id(&has_bits);
          id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated uint32 keys = 2 [packed = true];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_keys(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) {
          _internal_add_keys(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated uint32 vals = 3 [packed = true];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_vals(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) {
          _internal_add_vals(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .OSMPBF.Info info = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_info(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // required sint64 lat = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) {
          _Internal::set_has_lat(&has_bits);
          lat_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // required sint64 lon = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) {
          _Internal::set_has_lon(&has_bits);
          lon_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* Node::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.Node)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required sint64 id = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(1, this->_internal_id(), target);
  }

  // repeated uint32 keys = 2 [packed = true];
  {
    int byte_size = _keys_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt32Packed(
          2, _internal_keys(), byte_size, target);
    }
  }

  // repeated uint32 vals = 3 [packed = true];
  {
    int byte_size = _vals_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt32Packed(
          3, _internal_vals(), byte_size, target);
    }
  }

  // optional .OSMPBF.Info info = 4;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        4, _Internal::info(this), target, stream);
  }

  // required sint64 lat = 8;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(8, this->_internal_lat(), target);
  }

  // required sint64 lon = 9;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteSInt64ToArray(9, this->_internal_lon(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.Node)
  return target;
}

size_t Node::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:OSMPBF.Node)
  size_t total_size = 0;

  if (_internal_has_id()) {
    // required sint64 id = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_id());
  }

  if (_internal_has_lat()) {
    // required sint64 lat = 8;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_lat());
  }

  if (_internal_has_lon()) {
    // required sint64 lon = 9;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_lon());
  }

  return total_size;
}
size_t Node::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.Node)
  size_t total_size = 0;

  if (((_has_bits_[0] & 0x0000000e) ^ 0x0000000e) == 0) {  // All required fields are present.
    // required sint64 id = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_id());

    // required sint64 lat = 8;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_lat());

    // required sint64 lon = 9;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SInt64Size(
        this->_internal_lon());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated uint32 keys = 2 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      UInt32Size(this->keys_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _keys_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated uint32 vals = 3 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      UInt32Size(this->vals_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _vals_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // optional .OSMPBF.Info info = 4;
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *info_);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Node::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const Node*>(
      &from));
}

void Node::MergeFrom(const Node& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.Node)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  keys_.MergeFrom(from.keys_);
  vals_.MergeFrom(from.vals_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_info()->::OSMPBF::Info::MergeFrom(from._internal_info());
    }
    if (cached_has_bits & 0x00000002u) {
      id_ = from.id_;
    }
    if (cached_has_bits & 0x00000004u) {
      lat_ = from.lat_;
    }
    if (cached_has_bits & 0x00000008u) {
      lon_ = from.lon_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void Node::CopyFrom(const Node& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.Node)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Node::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void Node::InternalSwap(Node* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  keys_.InternalSwap(&other->keys_);
  vals_.InternalSwap(&other->vals_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Node, lon_)
      + sizeof(Node::lon_)
      - PROTOBUF_FIELD_OFFSET(Node, info_)>(
          reinterpret_cast<char*>(&info_),
          reinterpret_cast<char*>(&other->info_));
}

std::string Node::GetTypeName() const {
  return "OSMPBF.Node";
}


// ===================================================================

void DenseNodes::InitAsDefaultInstance() {
  ::OSMPBF::_DenseNodes_default_instance_._instance.get_mutable()->denseinfo_ = const_cast< ::OSMPBF::DenseInfo*>(
      ::OSMPBF::DenseInfo::internal_default_instance());
}
class DenseNodes::_Internal {
 public:
  using HasBits = decltype(std::declval<DenseNodes>()._has_bits_);
  static const ::OSMPBF::DenseInfo& denseinfo(const DenseNodes* msg);
  static void set_has_denseinfo(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

const ::OSMPBF::DenseInfo&
DenseNodes::_Internal::denseinfo(const DenseNodes* msg) {
  return *msg->denseinfo_;
}
DenseNodes::DenseNodes(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
  id_(arena),
  lat_(arena),
  lon_(arena),
  keys_vals_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.DenseNodes)
}
DenseNodes::DenseNodes(const DenseNodes& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      id_(from.id_),
      lat_(from.lat_),
      lon_(from.lon_),
      keys_vals_(from.keys_vals_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if (from._internal_has_denseinfo()) {
    denseinfo_ = new ::OSMPBF::DenseInfo(*from.denseinfo_);
  } else {
    denseinfo_ = nullptr;
  }
  // @@protoc_insertion_point(copy_constructor:OSMPBF.DenseNodes)
}

void DenseNodes::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_DenseNodes_osmformat_2eproto.base);
  denseinfo_ = nullptr;
}

DenseNodes::~DenseNodes() {
  // @@protoc_insertion_point(destructor:OSMPBF.DenseNodes)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void DenseNodes::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
  if (this != internal_default_instance()) delete denseinfo_;
}

void DenseNodes::ArenaDtor(void* object) {
  DenseNodes* _this = reinterpret_cast< DenseNodes* >(object);
  (void)_this;
}
void DenseNodes::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void DenseNodes::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const DenseNodes& DenseNodes::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_DenseNodes_osmformat_2eproto.base);
  return *internal_default_instance();
}


void DenseNodes::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.DenseNodes)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  id_.Clear();
  lat_.Clear();
  lon_.Clear();
  keys_vals_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(denseinfo_ != nullptr);
    denseinfo_->Clear();
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* DenseNodes::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // repeated sint64 id = 1 [packed = true];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt64Parser(_internal_mutable_id(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8) {
          _internal_add_id(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .OSMPBF.DenseInfo denseinfo = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_denseinfo(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated sint64 lat = 8 [packed = true];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt64Parser(_internal_mutable_lat(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64) {
          _internal_add_lat(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated sint64 lon = 9 [packed = true];
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt64Parser(_internal_mutable_lon(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72) {
          _internal_add_lon(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated int32 keys_vals = 10 [packed = true];
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_keys_vals(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80) {
          _internal_add_keys_vals(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* DenseNodes::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.DenseNodes)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated sint64 id = 1 [packed = true];
  {
    int byte_size = _id_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteSInt64Packed(
          1, _internal_id(), byte_size, target);
    }
  }

  cached_has_bits = _has_bits_[0];
  // optional .OSMPBF.DenseInfo denseinfo = 5;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        5, _Internal::denseinfo(this), target, stream);
  }

  // repeated sint64 lat = 8 [packed = true];
  {
    int byte_size = _lat_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteSInt64Packed(
          8, _internal_lat(), byte_size, target);
    }
  }

  // repeated sint64 lon = 9 [packed = true];
  {
    int byte_size = _lon_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteSInt64Packed(
          9, _internal_lon(), byte_size, target);
    }
  }

  // repeated int32 keys_vals = 10 [packed = true];
  {
    int byte_size = _keys_vals_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          10, _internal_keys_vals(), byte_size, target);
    }
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.DenseNodes)
  return target;
}

size_t DenseNodes::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.DenseNodes)
  size_t total_size = 0;

  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated sint64 id = 1 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      SInt64Size(this->id_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _id_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated sint64 lat = 8 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      SInt64Size(this->lat_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _lat_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated sint64 lon = 9 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      SInt64Size(this->lon_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _lon_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated int32 keys_vals = 10 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int32Size(this->keys_vals_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _keys_vals_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // optional .OSMPBF.DenseInfo denseinfo = 5;
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *denseinfo_);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DenseNodes::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const DenseNodes*>(
      &from));
}

void DenseNodes::MergeFrom(const DenseNodes& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.DenseNodes)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  id_.MergeFrom(from.id_);
  lat_.MergeFrom(from.lat_);
  lon_.MergeFrom(from.lon_);
  keys_vals_.MergeFrom(from.keys_vals_);
  if (from._internal_has_denseinfo()) {
    _internal_mutable_denseinfo()->::OSMPBF::DenseInfo::MergeFrom(from._internal_denseinfo());
  }
}

void DenseNodes::CopyFrom(const DenseNodes& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.DenseNodes)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool DenseNodes::IsInitialized() const {
  return true;
}

void DenseNodes::InternalSwap(DenseNodes* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  id_.InternalSwap(&other->id_);
  lat_.InternalSwap(&other->lat_);
  lon_.InternalSwap(&other->lon_);
  keys_vals_.InternalSwap(&other->keys_vals_);
  swap(denseinfo_, other->denseinfo_);
}

std::string DenseNodes::GetTypeName() const {
  return "OSMPBF.DenseNodes";
}


// ===================================================================

void Way::InitAsDefaultInstance() {
  ::OSMPBF::_Way_default_instance_._instance.get_mutable()->info_ = const_cast< ::OSMPBF::Info*>(
      ::OSMPBF::Info::internal_default_instance());
}
class Way::_Internal {
 public:
  using HasBits = decltype(std::declval<Way>()._has_bits_);
  static void set_has_id(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::OSMPBF::Info& info(const Way* msg);
  static void set_has_info(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000002) ^ 0x00000002) != 0;
  }
};

const ::OSMPBF::Info&
Way::_Internal::info(const Way* msg) {
  return *msg->info_;
}
Way::Way(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
  keys_(arena),
  vals_(arena),
  refs_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.Way)
}
Way::Way(const Way& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      keys_(from.keys_),
      vals_(from.vals_),
      refs_(from.refs_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if (from._internal_has_info()) {
    info_ = new ::OSMPBF::Info(*from.info_);
  } else {
    info_ = nullptr;
  }
  id_ = from.id_;
  // @@protoc_insertion_point(copy_constructor:OSMPBF.Way)
}

void Way::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Way_osmformat_2eproto.base);
  ::memset(&info_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&id_) -
      reinterpret_cast<char*>(&info_)) + sizeof(id_));
}

Way::~Way() {
  // @@protoc_insertion_point(destructor:OSMPBF.Way)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void Way::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
  if (this != internal_default_instance()) delete info_;
}

void Way::ArenaDtor(void* object) {
  Way* _this = reinterpret_cast< Way* >(object);
  (void)_this;
}
void Way::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void Way::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const Way& Way::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Way_osmformat_2eproto.base);
  return *internal_default_instance();
}


void Way::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.Way)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  keys_.Clear();
  vals_.Clear();
  refs_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(info_ != nullptr);
    info_->Clear();
  }
  id_ = PROTOBUF_LONGLONG(0);
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Way::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // required int64 id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_id(&has_bits);
          id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated uint32 keys = 2 [packed = true];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_keys(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) {
          _internal_add_keys(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated uint32 vals = 3 [packed = true];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_vals(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) {
          _internal_add_vals(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .OSMPBF.Info info = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_info(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated sint64 refs = 8 [packed = true];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt64Parser(_internal_mutable_refs(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64) {
          _internal_add_refs(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* Way::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.Way)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required int64 id = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_id(), target);
  }

  // repeated uint32 keys = 2 [packed = true];
  {
    int byte_size = _keys_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt32Packed(
          2, _internal_keys(), byte_size, target);
    }
  }

  // repeated uint32 vals = 3 [packed = true];
  {
    int byte_size = _vals_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt32Packed(
          3, _internal_vals(), byte_size, target);
    }
  }

  // optional .OSMPBF.Info info = 4;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        4, _Internal::info(this), target, stream);
  }

  // repeated sint64 refs = 8 [packed = true];
  {
    int byte_size = _refs_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteSInt64Packed(
          8, _internal_refs(), byte_size, target);
    }
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.Way)
  return target;
}

size_t Way::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.Way)
  size_t total_size = 0;

  // required int64 id = 1;
  if (_internal_has_id()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
        this->_internal_id());
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated uint32 keys = 2 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      UInt32Size(this->keys_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _keys_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated uint32 vals = 3 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      UInt32Size(this->vals_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _vals_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated sint64 refs = 8 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      SInt64Size(this->refs_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _refs_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // optional .OSMPBF.Info info = 4;
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *info_);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Way::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const Way*>(
      &from));
}

void Way::MergeFrom(const Way& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.Way)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  keys_.MergeFrom(from.keys_);
  vals_.MergeFrom(from.vals_);
  refs_.MergeFrom(from.refs_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_info()->::OSMPBF::Info::MergeFrom(from._internal_info());
    }
    if (cached_has_bits & 0x00000002u) {
      id_ = from.id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void Way::CopyFrom(const Way& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.Way)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Way::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void Way::InternalSwap(Way* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  keys_.InternalSwap(&other->keys_);
  vals_.InternalSwap(&other->vals_);
  refs_.InternalSwap(&other->refs_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Way, id_)
      + sizeof(Way::id_)
      - PROTOBUF_FIELD_OFFSET(Way, info_)>(
          reinterpret_cast<char*>(&info_),
          reinterpret_cast<char*>(&other->info_));
}

std::string Way::GetTypeName() const {
  return "OSMPBF.Way";
}


// ===================================================================

void Relation::InitAsDefaultInstance() {
  ::OSMPBF::_Relation_default_instance_._instance.get_mutable()->info_ = const_cast< ::OSMPBF::Info*>(
      ::OSMPBF::Info::internal_default_instance());
}
class Relation::_Internal {
 public:
  using HasBits = decltype(std::declval<Relation>()._has_bits_);
  static void set_has_id(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::OSMPBF::Info& info(const Relation* msg);
  static void set_has_info(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000002) ^ 0x00000002) != 0;
  }
};

const ::OSMPBF::Info&
Relation::_Internal::info(const Relation* msg) {
  return *msg->info_;
}
Relation::Relation(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena),
  keys_(arena),
  vals_(arena),
  roles_sid_(arena),
  memids_(arena),
  types_(arena) {
  SharedCtor();
  RegisterArenaDtor(arena);
  // @@protoc_insertion_point(arena_constructor:OSMPBF.Relation)
}
Relation::Relation(const Relation& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_),
      keys_(from.keys_),
      vals_(from.vals_),
      roles_sid_(from.roles_sid_),
      memids_(from.memids_),
      types_(from.types_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if (from._internal_has_info()) {
    info_ = new ::OSMPBF::Info(*from.info_);
  } else {
    info_ = nullptr;
  }
  id_ = from.id_;
  // @@protoc_insertion_point(copy_constructor:OSMPBF.Relation)
}

void Relation::SharedCtor() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Relation_osmformat_2eproto.base);
  ::memset(&info_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&id_) -
      reinterpret_cast<char*>(&info_)) + sizeof(id_));
}

Relation::~Relation() {
  // @@protoc_insertion_point(destructor:OSMPBF.Relation)
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

void Relation::SharedDtor() {
  GOOGLE_DCHECK(GetArena() == nullptr);
  if (this != internal_default_instance()) delete info_;
}

void Relation::ArenaDtor(void* object) {
  Relation* _this = reinterpret_cast< Relation* >(object);
  (void)_this;
}
void Relation::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void Relation::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const Relation& Relation::default_instance() {
  ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Relation_osmformat_2eproto.base);
  return *internal_default_instance();
}


void Relation::Clear() {
// @@protoc_insertion_point(message_clear_start:OSMPBF.Relation)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  keys_.Clear();
  vals_.Clear();
  roles_sid_.Clear();
  memids_.Clear();
  types_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(info_ != nullptr);
    info_->Clear();
  }
  id_ = PROTOBUF_LONGLONG(0);
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Relation::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena;
  while (!ctx->Done(&ptr)) {
    ::PROTOBUF_NAMESPACE_ID::uint32 tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    CHK_(ptr);
    switch (tag >> 3) {
      // required int64 id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
          _Internal::set_has_id(&has_bits);
          id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated uint32 keys = 2 [packed = true];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_keys(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) {
          _internal_add_keys(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated uint32 vals = 3 [packed = true];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_vals(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24) {
          _internal_add_vals(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // optional .OSMPBF.Info info = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_info(), ptr);
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated int32 roles_sid = 8 [packed = true];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_roles_sid(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64) {
          _internal_add_roles_sid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated sint64 memids = 9 [packed = true];
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedSInt64Parser(_internal_mutable_memids(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72) {
          _internal_add_memids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarintZigZag64(&ptr));
          CHK_(ptr);
        } else goto handle_unusual;
        continue;
      // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_types(), ptr, ctx, ::OSMPBF::Relation_MemberType_IsValid, &_internal_metadata_, 10);
          CHK_(ptr);
        } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80) {
          ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::OSMPBF::Relation_MemberType_IsValid(val))) {
            _internal_add_types(static_cast<::OSMPBF::Relation_MemberType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(10, val, mutable_unknown_fields());
          }
        } else goto handle_unusual;
        continue;
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->SetLastTag(tag);
          goto success;
        }
        ptr = UnknownFieldParse(tag,
            _internal_metadata_.mutable_unknown_fields<std::string>(),
            ptr, ctx);
        CHK_(ptr != nullptr);
        continue;
      }
    }  // switch
  }  // while
success:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto success;
#undef CHK_
}

::PROTOBUF_NAMESPACE_ID::uint8* Relation::_InternalSerialize(
    ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:OSMPBF.Relation)
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required int64 id = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_id(), target);
  }

  // repeated uint32 keys = 2 [packed = true];
  {
    int byte_size = _keys_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt32Packed(
          2, _internal_keys(), byte_size, target);
    }
  }

  // repeated uint32 vals = 3 [packed = true];
  {
    int byte_size = _vals_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteUInt32Packed(
          3, _internal_vals(), byte_size, target);
    }
  }

  // optional .OSMPBF.Info info = 4;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        4, _Internal::info(this), target, stream);
  }

  // repeated int32 roles_sid = 8 [packed = true];
  {
    int byte_size = _roles_sid_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          8, _internal_roles_sid(), byte_size, target);
    }
  }

  // repeated sint64 memids = 9 [packed = true];
  {
    int byte_size = _memids_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteSInt64Packed(
          9, _internal_memids(), byte_size, target);
    }
  }

  // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];
  {
    int byte_size = _types_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteEnumPacked(
          10, types_, byte_size, target);
    }
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:OSMPBF.Relation)
  return target;
}

size_t Relation::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:OSMPBF.Relation)
  size_t total_size = 0;

  // required int64 id = 1;
  if (_internal_has_id()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
        this->_internal_id());
  }
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // repeated uint32 keys = 2 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      UInt32Size(this->keys_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _keys_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated uint32 vals = 3 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      UInt32Size(this->vals_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _vals_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated int32 roles_sid = 8 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int32Size(this->roles_sid_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _roles_sid_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated sint64 memids = 9 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      SInt64Size(this->memids_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _memids_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true];
  {
    size_t data_size = 0;
    unsigned int count = static_cast<unsigned int>(this->_internal_types_size());for (unsigned int i = 0; i < count; i++) {
      data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(
        this->_internal_types(static_cast<int>(i)));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _types_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // optional .OSMPBF.Info info = 4;
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *info_);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Relation::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const Relation*>(
      &from));
}

void Relation::MergeFrom(const Relation& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:OSMPBF.Relation)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  keys_.MergeFrom(from.keys_);
  vals_.MergeFrom(from.vals_);
  roles_sid_.MergeFrom(from.roles_sid_);
  memids_.MergeFrom(from.memids_);
  types_.MergeFrom(from.types_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_info()->::OSMPBF::Info::MergeFrom(from._internal_info());
    }
    if (cached_has_bits & 0x00000002u) {
      id_ = from.id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
}

void Relation::CopyFrom(const Relation& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:OSMPBF.Relation)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Relation::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void Relation::InternalSwap(Relation* other) {
  using std::swap;
  _internal_metadata_.Swap<std::string>(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  keys_.InternalSwap(&other->keys_);
  vals_.InternalSwap(&other->vals_);
  roles_sid_.InternalSwap(&other->roles_sid_);
  memids_.InternalSwap(&other->memids_);
  types_.InternalSwap(&other->types_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Relation, id_)
      + sizeof(Relation::id_)
      - PROTOBUF_FIELD_OFFSET(Relation, info_)>(
          reinterpret_cast<char*>(&info_),
          reinterpret_cast<char*>(&other->info_));
}

std::string Relation::GetTypeName() const {
  return "OSMPBF.Relation";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace OSMPBF
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::OSMPBF::HeaderBlock* Arena::CreateMaybeMessage< ::OSMPBF::HeaderBlock >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::HeaderBlock >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::HeaderBBox* Arena::CreateMaybeMessage< ::OSMPBF::HeaderBBox >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::HeaderBBox >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::PrimitiveBlock* Arena::CreateMaybeMessage< ::OSMPBF::PrimitiveBlock >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::PrimitiveBlock >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::PrimitiveGroup* Arena::CreateMaybeMessage< ::OSMPBF::PrimitiveGroup >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::PrimitiveGroup >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::StringTable* Arena::CreateMaybeMessage< ::OSMPBF::StringTable >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::StringTable >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::Info* Arena::CreateMaybeMessage< ::OSMPBF::Info >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::Info >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::DenseInfo* Arena::CreateMaybeMessage< ::OSMPBF::DenseInfo >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::DenseInfo >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::ChangeSet* Arena::CreateMaybeMessage< ::OSMPBF::ChangeSet >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::ChangeSet >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::Node* Arena::CreateMaybeMessage< ::OSMPBF::Node >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::Node >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::DenseNodes* Arena::CreateMaybeMessage< ::OSMPBF::DenseNodes >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::DenseNodes >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::Way* Arena::CreateMaybeMessage< ::OSMPBF::Way >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::Way >(arena);
}
template<> PROTOBUF_NOINLINE ::OSMPBF::Relation* Arena::CreateMaybeMessage< ::OSMPBF::Relation >(Arena* arena) {
  return Arena::CreateMessageInternal< ::OSMPBF::Relation >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
