PBF Support (Thanks to Christian for explanations)
This commit is contained in:
@@ -0,0 +1,848 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
|
||||
#include "fileformat.pb.h"
|
||||
#include <google/protobuf/stubs/once.h>
|
||||
#include <google/protobuf/io/coded_stream.h>
|
||||
#include <google/protobuf/wire_format_lite_inl.h>
|
||||
#include <google/protobuf/descriptor.h>
|
||||
#include <google/protobuf/reflection_ops.h>
|
||||
#include <google/protobuf/wire_format.h>
|
||||
// @@protoc_insertion_point(includes)
|
||||
|
||||
namespace OSMPBF {
|
||||
|
||||
namespace {
|
||||
|
||||
const ::google::protobuf::Descriptor* Blob_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
Blob_reflection_ = NULL;
|
||||
const ::google::protobuf::Descriptor* BlobHeader_descriptor_ = NULL;
|
||||
const ::google::protobuf::internal::GeneratedMessageReflection*
|
||||
BlobHeader_reflection_ = NULL;
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
void protobuf_AssignDesc_fileformat_2eproto() {
|
||||
protobuf_AddDesc_fileformat_2eproto();
|
||||
const ::google::protobuf::FileDescriptor* file =
|
||||
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
|
||||
"fileformat.proto");
|
||||
GOOGLE_CHECK(file != NULL);
|
||||
Blob_descriptor_ = file->message_type(0);
|
||||
static const int Blob_offsets_[5] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Blob, raw_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Blob, raw_size_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Blob, zlib_data_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Blob, lzma_data_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Blob, obsolete_bzip2_data_),
|
||||
};
|
||||
Blob_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
Blob_descriptor_,
|
||||
Blob::default_instance_,
|
||||
Blob_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Blob, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Blob, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(Blob));
|
||||
BlobHeader_descriptor_ = file->message_type(1);
|
||||
static const int BlobHeader_offsets_[3] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobHeader, type_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobHeader, indexdata_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobHeader, datasize_),
|
||||
};
|
||||
BlobHeader_reflection_ =
|
||||
new ::google::protobuf::internal::GeneratedMessageReflection(
|
||||
BlobHeader_descriptor_,
|
||||
BlobHeader::default_instance_,
|
||||
BlobHeader_offsets_,
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobHeader, _has_bits_[0]),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(BlobHeader, _unknown_fields_),
|
||||
-1,
|
||||
::google::protobuf::DescriptorPool::generated_pool(),
|
||||
::google::protobuf::MessageFactory::generated_factory(),
|
||||
sizeof(BlobHeader));
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
|
||||
inline void protobuf_AssignDescriptorsOnce() {
|
||||
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
|
||||
&protobuf_AssignDesc_fileformat_2eproto);
|
||||
}
|
||||
|
||||
void protobuf_RegisterTypes(const ::std::string&) {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
Blob_descriptor_, &Blob::default_instance());
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
|
||||
BlobHeader_descriptor_, &BlobHeader::default_instance());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void protobuf_ShutdownFile_fileformat_2eproto() {
|
||||
delete Blob::default_instance_;
|
||||
delete Blob_reflection_;
|
||||
delete BlobHeader::default_instance_;
|
||||
delete BlobHeader_reflection_;
|
||||
}
|
||||
|
||||
void protobuf_AddDesc_fileformat_2eproto() {
|
||||
static bool already_here = false;
|
||||
if (already_here) return;
|
||||
already_here = true;
|
||||
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
||||
|
||||
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
|
||||
"\n\020fileformat.proto\022\006OSMPBF\"l\n\004Blob\022\013\n\003ra"
|
||||
"w\030\001 \001(\014\022\020\n\010raw_size\030\002 \001(\005\022\021\n\tzlib_data\030\003"
|
||||
" \001(\014\022\021\n\tlzma_data\030\004 \001(\014\022\037\n\023OBSOLETE_bzip"
|
||||
"2_data\030\005 \001(\014B\002\030\001\"?\n\nBlobHeader\022\014\n\004type\030\001"
|
||||
" \002(\t\022\021\n\tindexdata\030\002 \001(\014\022\020\n\010datasize\030\003 \002("
|
||||
"\005B\017\n\rcrosby.binary", 218);
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||||
"fileformat.proto", &protobuf_RegisterTypes);
|
||||
Blob::default_instance_ = new Blob();
|
||||
BlobHeader::default_instance_ = new BlobHeader();
|
||||
Blob::default_instance_->InitAsDefaultInstance();
|
||||
BlobHeader::default_instance_->InitAsDefaultInstance();
|
||||
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_fileformat_2eproto);
|
||||
}
|
||||
|
||||
// Force AddDescriptors() to be called at static initialization time.
|
||||
struct StaticDescriptorInitializer_fileformat_2eproto {
|
||||
StaticDescriptorInitializer_fileformat_2eproto() {
|
||||
protobuf_AddDesc_fileformat_2eproto();
|
||||
}
|
||||
} static_descriptor_initializer_fileformat_2eproto_;
|
||||
|
||||
|
||||
// ===================================================================
|
||||
|
||||
const ::std::string Blob::_default_raw_;
|
||||
const ::std::string Blob::_default_zlib_data_;
|
||||
const ::std::string Blob::_default_lzma_data_;
|
||||
const ::std::string Blob::_default_obsolete_bzip2_data_;
|
||||
#ifndef _MSC_VER
|
||||
const int Blob::kRawFieldNumber;
|
||||
const int Blob::kRawSizeFieldNumber;
|
||||
const int Blob::kZlibDataFieldNumber;
|
||||
const int Blob::kLzmaDataFieldNumber;
|
||||
const int Blob::kOBSOLETEBzip2DataFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
Blob::Blob()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
}
|
||||
|
||||
void Blob::InitAsDefaultInstance() {
|
||||
}
|
||||
|
||||
Blob::Blob(const Blob& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
void Blob::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
raw_ = const_cast< ::std::string*>(&_default_raw_);
|
||||
raw_size_ = 0;
|
||||
zlib_data_ = const_cast< ::std::string*>(&_default_zlib_data_);
|
||||
lzma_data_ = const_cast< ::std::string*>(&_default_lzma_data_);
|
||||
obsolete_bzip2_data_ = const_cast< ::std::string*>(&_default_obsolete_bzip2_data_);
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
Blob::~Blob() {
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void Blob::SharedDtor() {
|
||||
if (raw_ != &_default_raw_) {
|
||||
delete raw_;
|
||||
}
|
||||
if (zlib_data_ != &_default_zlib_data_) {
|
||||
delete zlib_data_;
|
||||
}
|
||||
if (lzma_data_ != &_default_lzma_data_) {
|
||||
delete lzma_data_;
|
||||
}
|
||||
if (obsolete_bzip2_data_ != &_default_obsolete_bzip2_data_) {
|
||||
delete obsolete_bzip2_data_;
|
||||
}
|
||||
if (this != default_instance_) {
|
||||
}
|
||||
}
|
||||
|
||||
void Blob::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* Blob::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return Blob_descriptor_;
|
||||
}
|
||||
|
||||
const Blob& Blob::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_fileformat_2eproto(); return *default_instance_;
|
||||
}
|
||||
|
||||
Blob* Blob::default_instance_ = NULL;
|
||||
|
||||
Blob* Blob::New() const {
|
||||
return new Blob;
|
||||
}
|
||||
|
||||
void Blob::Clear() {
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (_has_bit(0)) {
|
||||
if (raw_ != &_default_raw_) {
|
||||
raw_->clear();
|
||||
}
|
||||
}
|
||||
raw_size_ = 0;
|
||||
if (_has_bit(2)) {
|
||||
if (zlib_data_ != &_default_zlib_data_) {
|
||||
zlib_data_->clear();
|
||||
}
|
||||
}
|
||||
if (_has_bit(3)) {
|
||||
if (lzma_data_ != &_default_lzma_data_) {
|
||||
lzma_data_->clear();
|
||||
}
|
||||
}
|
||||
if (_has_bit(4)) {
|
||||
if (obsolete_bzip2_data_ != &_default_obsolete_bzip2_data_) {
|
||||
obsolete_bzip2_data_->clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
mutable_unknown_fields()->Clear();
|
||||
}
|
||||
|
||||
bool Blob::MergePartialFromCodedStream(
|
||||
::google::protobuf::io::CodedInputStream* input) {
|
||||
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
|
||||
::google::protobuf::uint32 tag;
|
||||
while ((tag = input->ReadTag()) != 0) {
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// optional bytes raw = 1;
|
||||
case 1: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
|
||||
input, this->mutable_raw()));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(16)) goto parse_raw_size;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional int32 raw_size = 2;
|
||||
case 2: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||||
parse_raw_size:
|
||||
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
||||
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
|
||||
input, &raw_size_)));
|
||||
_set_bit(1);
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(26)) goto parse_zlib_data;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional bytes zlib_data = 3;
|
||||
case 3: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_zlib_data:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
|
||||
input, this->mutable_zlib_data()));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(34)) goto parse_lzma_data;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional bytes lzma_data = 4;
|
||||
case 4: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_lzma_data:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
|
||||
input, this->mutable_lzma_data()));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(42)) goto parse_OBSOLETE_bzip2_data;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];
|
||||
case 5: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_OBSOLETE_bzip2_data:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
|
||||
input, this->mutable_obsolete_bzip2_data()));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectAtEnd()) return true;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
handle_uninterpreted:
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
|
||||
return true;
|
||||
}
|
||||
DO_(::google::protobuf::internal::WireFormat::SkipField(
|
||||
input, tag, mutable_unknown_fields()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
#undef DO_
|
||||
}
|
||||
|
||||
void Blob::SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const {
|
||||
// optional bytes raw = 1;
|
||||
if (_has_bit(0)) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytes(
|
||||
1, this->raw(), output);
|
||||
}
|
||||
|
||||
// optional int32 raw_size = 2;
|
||||
if (_has_bit(1)) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->raw_size(), output);
|
||||
}
|
||||
|
||||
// optional bytes zlib_data = 3;
|
||||
if (_has_bit(2)) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytes(
|
||||
3, this->zlib_data(), output);
|
||||
}
|
||||
|
||||
// optional bytes lzma_data = 4;
|
||||
if (_has_bit(3)) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytes(
|
||||
4, this->lzma_data(), output);
|
||||
}
|
||||
|
||||
// optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];
|
||||
if (_has_bit(4)) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytes(
|
||||
5, this->obsolete_bzip2_data(), output);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
|
||||
unknown_fields(), output);
|
||||
}
|
||||
}
|
||||
|
||||
::google::protobuf::uint8* Blob::SerializeWithCachedSizesToArray(
|
||||
::google::protobuf::uint8* target) const {
|
||||
// optional bytes raw = 1;
|
||||
if (_has_bit(0)) {
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
|
||||
1, this->raw(), target);
|
||||
}
|
||||
|
||||
// optional int32 raw_size = 2;
|
||||
if (_has_bit(1)) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->raw_size(), target);
|
||||
}
|
||||
|
||||
// optional bytes zlib_data = 3;
|
||||
if (_has_bit(2)) {
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
|
||||
3, this->zlib_data(), target);
|
||||
}
|
||||
|
||||
// optional bytes lzma_data = 4;
|
||||
if (_has_bit(3)) {
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
|
||||
4, this->lzma_data(), target);
|
||||
}
|
||||
|
||||
// optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];
|
||||
if (_has_bit(4)) {
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
|
||||
5, this->obsolete_bzip2_data(), target);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
|
||||
unknown_fields(), target);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
int Blob::ByteSize() const {
|
||||
int total_size = 0;
|
||||
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
// optional bytes raw = 1;
|
||||
if (has_raw()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::BytesSize(
|
||||
this->raw());
|
||||
}
|
||||
|
||||
// optional int32 raw_size = 2;
|
||||
if (has_raw_size()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::Int32Size(
|
||||
this->raw_size());
|
||||
}
|
||||
|
||||
// optional bytes zlib_data = 3;
|
||||
if (has_zlib_data()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::BytesSize(
|
||||
this->zlib_data());
|
||||
}
|
||||
|
||||
// optional bytes lzma_data = 4;
|
||||
if (has_lzma_data()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::BytesSize(
|
||||
this->lzma_data());
|
||||
}
|
||||
|
||||
// optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];
|
||||
if (has_obsolete_bzip2_data()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::BytesSize(
|
||||
this->obsolete_bzip2_data());
|
||||
}
|
||||
|
||||
}
|
||||
if (!unknown_fields().empty()) {
|
||||
total_size +=
|
||||
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
|
||||
unknown_fields());
|
||||
}
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = total_size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
return total_size;
|
||||
}
|
||||
|
||||
void Blob::MergeFrom(const ::google::protobuf::Message& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
const Blob* source =
|
||||
::google::protobuf::internal::dynamic_cast_if_available<const Blob*>(
|
||||
&from);
|
||||
if (source == NULL) {
|
||||
::google::protobuf::internal::ReflectionOps::Merge(from, this);
|
||||
} else {
|
||||
MergeFrom(*source);
|
||||
}
|
||||
}
|
||||
|
||||
void Blob::MergeFrom(const Blob& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (from._has_bit(0)) {
|
||||
set_raw(from.raw());
|
||||
}
|
||||
if (from._has_bit(1)) {
|
||||
set_raw_size(from.raw_size());
|
||||
}
|
||||
if (from._has_bit(2)) {
|
||||
set_zlib_data(from.zlib_data());
|
||||
}
|
||||
if (from._has_bit(3)) {
|
||||
set_lzma_data(from.lzma_data());
|
||||
}
|
||||
if (from._has_bit(4)) {
|
||||
set_obsolete_bzip2_data(from.obsolete_bzip2_data());
|
||||
}
|
||||
}
|
||||
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
|
||||
}
|
||||
|
||||
void Blob::CopyFrom(const ::google::protobuf::Message& from) {
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
void Blob::CopyFrom(const Blob& from) {
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
bool Blob::IsInitialized() const {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Blob::Swap(Blob* other) {
|
||||
if (other != this) {
|
||||
std::swap(raw_, other->raw_);
|
||||
std::swap(raw_size_, other->raw_size_);
|
||||
std::swap(zlib_data_, other->zlib_data_);
|
||||
std::swap(lzma_data_, other->lzma_data_);
|
||||
std::swap(obsolete_bzip2_data_, other->obsolete_bzip2_data_);
|
||||
std::swap(_has_bits_[0], other->_has_bits_[0]);
|
||||
_unknown_fields_.Swap(&other->_unknown_fields_);
|
||||
std::swap(_cached_size_, other->_cached_size_);
|
||||
}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata Blob::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = Blob_descriptor_;
|
||||
metadata.reflection = Blob_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
||||
// ===================================================================
|
||||
|
||||
const ::std::string BlobHeader::_default_type_;
|
||||
const ::std::string BlobHeader::_default_indexdata_;
|
||||
#ifndef _MSC_VER
|
||||
const int BlobHeader::kTypeFieldNumber;
|
||||
const int BlobHeader::kIndexdataFieldNumber;
|
||||
const int BlobHeader::kDatasizeFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
BlobHeader::BlobHeader()
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
}
|
||||
|
||||
void BlobHeader::InitAsDefaultInstance() {
|
||||
}
|
||||
|
||||
BlobHeader::BlobHeader(const BlobHeader& from)
|
||||
: ::google::protobuf::Message() {
|
||||
SharedCtor();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
void BlobHeader::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
type_ = const_cast< ::std::string*>(&_default_type_);
|
||||
indexdata_ = const_cast< ::std::string*>(&_default_indexdata_);
|
||||
datasize_ = 0;
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
}
|
||||
|
||||
BlobHeader::~BlobHeader() {
|
||||
SharedDtor();
|
||||
}
|
||||
|
||||
void BlobHeader::SharedDtor() {
|
||||
if (type_ != &_default_type_) {
|
||||
delete type_;
|
||||
}
|
||||
if (indexdata_ != &_default_indexdata_) {
|
||||
delete indexdata_;
|
||||
}
|
||||
if (this != default_instance_) {
|
||||
}
|
||||
}
|
||||
|
||||
void BlobHeader::SetCachedSize(int size) const {
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
}
|
||||
const ::google::protobuf::Descriptor* BlobHeader::descriptor() {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
return BlobHeader_descriptor_;
|
||||
}
|
||||
|
||||
const BlobHeader& BlobHeader::default_instance() {
|
||||
if (default_instance_ == NULL) protobuf_AddDesc_fileformat_2eproto(); return *default_instance_;
|
||||
}
|
||||
|
||||
BlobHeader* BlobHeader::default_instance_ = NULL;
|
||||
|
||||
BlobHeader* BlobHeader::New() const {
|
||||
return new BlobHeader;
|
||||
}
|
||||
|
||||
void BlobHeader::Clear() {
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (_has_bit(0)) {
|
||||
if (type_ != &_default_type_) {
|
||||
type_->clear();
|
||||
}
|
||||
}
|
||||
if (_has_bit(1)) {
|
||||
if (indexdata_ != &_default_indexdata_) {
|
||||
indexdata_->clear();
|
||||
}
|
||||
}
|
||||
datasize_ = 0;
|
||||
}
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
mutable_unknown_fields()->Clear();
|
||||
}
|
||||
|
||||
bool BlobHeader::MergePartialFromCodedStream(
|
||||
::google::protobuf::io::CodedInputStream* input) {
|
||||
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
|
||||
::google::protobuf::uint32 tag;
|
||||
while ((tag = input->ReadTag()) != 0) {
|
||||
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
||||
// required string type = 1;
|
||||
case 1: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
|
||||
input, this->mutable_type()));
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->type().data(), this->type().length(),
|
||||
::google::protobuf::internal::WireFormat::PARSE);
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(18)) goto parse_indexdata;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional bytes indexdata = 2;
|
||||
case 2: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_indexdata:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
|
||||
input, this->mutable_indexdata()));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(24)) goto parse_datasize;
|
||||
break;
|
||||
}
|
||||
|
||||
// required int32 datasize = 3;
|
||||
case 3: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||||
parse_datasize:
|
||||
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
||||
::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
|
||||
input, &datasize_)));
|
||||
_set_bit(2);
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectAtEnd()) return true;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
handle_uninterpreted:
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
|
||||
return true;
|
||||
}
|
||||
DO_(::google::protobuf::internal::WireFormat::SkipField(
|
||||
input, tag, mutable_unknown_fields()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
#undef DO_
|
||||
}
|
||||
|
||||
void BlobHeader::SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const {
|
||||
// required string type = 1;
|
||||
if (_has_bit(0)) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->type().data(), this->type().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
::google::protobuf::internal::WireFormatLite::WriteString(
|
||||
1, this->type(), output);
|
||||
}
|
||||
|
||||
// optional bytes indexdata = 2;
|
||||
if (_has_bit(1)) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytes(
|
||||
2, this->indexdata(), output);
|
||||
}
|
||||
|
||||
// required int32 datasize = 3;
|
||||
if (_has_bit(2)) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->datasize(), output);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
|
||||
unknown_fields(), output);
|
||||
}
|
||||
}
|
||||
|
||||
::google::protobuf::uint8* BlobHeader::SerializeWithCachedSizesToArray(
|
||||
::google::protobuf::uint8* target) const {
|
||||
// required string type = 1;
|
||||
if (_has_bit(0)) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->type().data(), this->type().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
|
||||
1, this->type(), target);
|
||||
}
|
||||
|
||||
// optional bytes indexdata = 2;
|
||||
if (_has_bit(1)) {
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
|
||||
2, this->indexdata(), target);
|
||||
}
|
||||
|
||||
// required int32 datasize = 3;
|
||||
if (_has_bit(2)) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->datasize(), target);
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
|
||||
unknown_fields(), target);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
int BlobHeader::ByteSize() const {
|
||||
int total_size = 0;
|
||||
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
// required string type = 1;
|
||||
if (has_type()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::StringSize(
|
||||
this->type());
|
||||
}
|
||||
|
||||
// optional bytes indexdata = 2;
|
||||
if (has_indexdata()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::BytesSize(
|
||||
this->indexdata());
|
||||
}
|
||||
|
||||
// required int32 datasize = 3;
|
||||
if (has_datasize()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::Int32Size(
|
||||
this->datasize());
|
||||
}
|
||||
|
||||
}
|
||||
if (!unknown_fields().empty()) {
|
||||
total_size +=
|
||||
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
|
||||
unknown_fields());
|
||||
}
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
||||
_cached_size_ = total_size;
|
||||
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
||||
return total_size;
|
||||
}
|
||||
|
||||
void BlobHeader::MergeFrom(const ::google::protobuf::Message& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
const BlobHeader* source =
|
||||
::google::protobuf::internal::dynamic_cast_if_available<const BlobHeader*>(
|
||||
&from);
|
||||
if (source == NULL) {
|
||||
::google::protobuf::internal::ReflectionOps::Merge(from, this);
|
||||
} else {
|
||||
MergeFrom(*source);
|
||||
}
|
||||
}
|
||||
|
||||
void BlobHeader::MergeFrom(const BlobHeader& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (from._has_bit(0)) {
|
||||
set_type(from.type());
|
||||
}
|
||||
if (from._has_bit(1)) {
|
||||
set_indexdata(from.indexdata());
|
||||
}
|
||||
if (from._has_bit(2)) {
|
||||
set_datasize(from.datasize());
|
||||
}
|
||||
}
|
||||
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
|
||||
}
|
||||
|
||||
void BlobHeader::CopyFrom(const ::google::protobuf::Message& from) {
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
void BlobHeader::CopyFrom(const BlobHeader& from) {
|
||||
if (&from == this) return;
|
||||
Clear();
|
||||
MergeFrom(from);
|
||||
}
|
||||
|
||||
bool BlobHeader::IsInitialized() const {
|
||||
if ((_has_bits_[0] & 0x00000005) != 0x00000005) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void BlobHeader::Swap(BlobHeader* other) {
|
||||
if (other != this) {
|
||||
std::swap(type_, other->type_);
|
||||
std::swap(indexdata_, other->indexdata_);
|
||||
std::swap(datasize_, other->datasize_);
|
||||
std::swap(_has_bits_[0], other->_has_bits_[0]);
|
||||
_unknown_fields_.Swap(&other->_unknown_fields_);
|
||||
std::swap(_cached_size_, other->_cached_size_);
|
||||
}
|
||||
}
|
||||
|
||||
::google::protobuf::Metadata BlobHeader::GetMetadata() const {
|
||||
protobuf_AssignDescriptorsOnce();
|
||||
::google::protobuf::Metadata metadata;
|
||||
metadata.descriptor = BlobHeader_descriptor_;
|
||||
metadata.reflection = BlobHeader_reflection_;
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
} // namespace OSMPBF
|
||||
|
||||
// @@protoc_insertion_point(global_scope)
|
||||
@@ -0,0 +1,599 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: fileformat.proto
|
||||
|
||||
#ifndef PROTOBUF_fileformat_2eproto__INCLUDED
|
||||
#define PROTOBUF_fileformat_2eproto__INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <google/protobuf/stubs/common.h>
|
||||
|
||||
#if GOOGLE_PROTOBUF_VERSION < 2003000
|
||||
#error This file was generated by a newer version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 2003000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
#endif
|
||||
|
||||
#include <google/protobuf/generated_message_util.h>
|
||||
#include <google/protobuf/repeated_field.h>
|
||||
#include <google/protobuf/extension_set.h>
|
||||
#include <google/protobuf/generated_message_reflection.h>
|
||||
// @@protoc_insertion_point(includes)
|
||||
|
||||
namespace OSMPBF {
|
||||
|
||||
// Internal implementation detail -- do not call these.
|
||||
void protobuf_AddDesc_fileformat_2eproto();
|
||||
void protobuf_AssignDesc_fileformat_2eproto();
|
||||
void protobuf_ShutdownFile_fileformat_2eproto();
|
||||
|
||||
class Blob;
|
||||
class BlobHeader;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class Blob : public ::google::protobuf::Message {
|
||||
public:
|
||||
Blob();
|
||||
virtual ~Blob();
|
||||
|
||||
Blob(const Blob& from);
|
||||
|
||||
inline Blob& operator=(const Blob& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const Blob& default_instance();
|
||||
|
||||
void Swap(Blob* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
Blob* New() const;
|
||||
void CopyFrom(const ::google::protobuf::Message& from);
|
||||
void MergeFrom(const ::google::protobuf::Message& from);
|
||||
void CopyFrom(const Blob& from);
|
||||
void MergeFrom(const Blob& from);
|
||||
void Clear();
|
||||
bool IsInitialized() const;
|
||||
|
||||
int ByteSize() const;
|
||||
bool MergePartialFromCodedStream(
|
||||
::google::protobuf::io::CodedInputStream* input);
|
||||
void SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const;
|
||||
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// optional bytes raw = 1;
|
||||
inline bool has_raw() const;
|
||||
inline void clear_raw();
|
||||
static const int kRawFieldNumber = 1;
|
||||
inline const ::std::string& raw() const;
|
||||
inline void set_raw(const ::std::string& value);
|
||||
inline void set_raw(const char* value);
|
||||
inline void set_raw(const void* value, size_t size);
|
||||
inline ::std::string* mutable_raw();
|
||||
|
||||
// optional int32 raw_size = 2;
|
||||
inline bool has_raw_size() const;
|
||||
inline void clear_raw_size();
|
||||
static const int kRawSizeFieldNumber = 2;
|
||||
inline ::google::protobuf::int32 raw_size() const;
|
||||
inline void set_raw_size(::google::protobuf::int32 value);
|
||||
|
||||
// optional bytes zlib_data = 3;
|
||||
inline bool has_zlib_data() const;
|
||||
inline void clear_zlib_data();
|
||||
static const int kZlibDataFieldNumber = 3;
|
||||
inline const ::std::string& zlib_data() const;
|
||||
inline void set_zlib_data(const ::std::string& value);
|
||||
inline void set_zlib_data(const char* value);
|
||||
inline void set_zlib_data(const void* value, size_t size);
|
||||
inline ::std::string* mutable_zlib_data();
|
||||
|
||||
// optional bytes lzma_data = 4;
|
||||
inline bool has_lzma_data() const;
|
||||
inline void clear_lzma_data();
|
||||
static const int kLzmaDataFieldNumber = 4;
|
||||
inline const ::std::string& lzma_data() const;
|
||||
inline void set_lzma_data(const ::std::string& value);
|
||||
inline void set_lzma_data(const char* value);
|
||||
inline void set_lzma_data(const void* value, size_t size);
|
||||
inline ::std::string* mutable_lzma_data();
|
||||
|
||||
// optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];
|
||||
inline bool has_obsolete_bzip2_data() const PROTOBUF_DEPRECATED;
|
||||
inline void clear_obsolete_bzip2_data() PROTOBUF_DEPRECATED;
|
||||
static const int kOBSOLETEBzip2DataFieldNumber = 5;
|
||||
inline const ::std::string& obsolete_bzip2_data() const PROTOBUF_DEPRECATED;
|
||||
inline void set_obsolete_bzip2_data(const ::std::string& value) PROTOBUF_DEPRECATED;
|
||||
inline void set_obsolete_bzip2_data(const char* value) PROTOBUF_DEPRECATED;
|
||||
inline void set_obsolete_bzip2_data(const void* value, size_t size) PROTOBUF_DEPRECATED;
|
||||
inline ::std::string* mutable_obsolete_bzip2_data() PROTOBUF_DEPRECATED;
|
||||
|
||||
// @@protoc_insertion_point(class_scope:OSMPBF.Blob)
|
||||
private:
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
mutable int _cached_size_;
|
||||
|
||||
::std::string* raw_;
|
||||
static const ::std::string _default_raw_;
|
||||
::google::protobuf::int32 raw_size_;
|
||||
::std::string* zlib_data_;
|
||||
static const ::std::string _default_zlib_data_;
|
||||
::std::string* lzma_data_;
|
||||
static const ::std::string _default_lzma_data_;
|
||||
::std::string* obsolete_bzip2_data_;
|
||||
static const ::std::string _default_obsolete_bzip2_data_;
|
||||
friend void protobuf_AddDesc_fileformat_2eproto();
|
||||
friend void protobuf_AssignDesc_fileformat_2eproto();
|
||||
friend void protobuf_ShutdownFile_fileformat_2eproto();
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[(5 + 31) / 32];
|
||||
|
||||
// WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
|
||||
inline bool _has_bit(int index) const {
|
||||
return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
|
||||
}
|
||||
inline void _set_bit(int index) {
|
||||
_has_bits_[index / 32] |= (1u << (index % 32));
|
||||
}
|
||||
inline void _clear_bit(int index) {
|
||||
_has_bits_[index / 32] &= ~(1u << (index % 32));
|
||||
}
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static Blob* default_instance_;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class BlobHeader : public ::google::protobuf::Message {
|
||||
public:
|
||||
BlobHeader();
|
||||
virtual ~BlobHeader();
|
||||
|
||||
BlobHeader(const BlobHeader& from);
|
||||
|
||||
inline BlobHeader& operator=(const BlobHeader& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
|
||||
return _unknown_fields_;
|
||||
}
|
||||
|
||||
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
|
||||
return &_unknown_fields_;
|
||||
}
|
||||
|
||||
static const ::google::protobuf::Descriptor* descriptor();
|
||||
static const BlobHeader& default_instance();
|
||||
|
||||
void Swap(BlobHeader* other);
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
BlobHeader* New() const;
|
||||
void CopyFrom(const ::google::protobuf::Message& from);
|
||||
void MergeFrom(const ::google::protobuf::Message& from);
|
||||
void CopyFrom(const BlobHeader& from);
|
||||
void MergeFrom(const BlobHeader& from);
|
||||
void Clear();
|
||||
bool IsInitialized() const;
|
||||
|
||||
int ByteSize() const;
|
||||
bool MergePartialFromCodedStream(
|
||||
::google::protobuf::io::CodedInputStream* input);
|
||||
void SerializeWithCachedSizes(
|
||||
::google::protobuf::io::CodedOutputStream* output) const;
|
||||
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
|
||||
int GetCachedSize() const { return _cached_size_; }
|
||||
private:
|
||||
void SharedCtor();
|
||||
void SharedDtor();
|
||||
void SetCachedSize(int size) const;
|
||||
public:
|
||||
|
||||
::google::protobuf::Metadata GetMetadata() const;
|
||||
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
|
||||
// required string type = 1;
|
||||
inline bool has_type() const;
|
||||
inline void clear_type();
|
||||
static const int kTypeFieldNumber = 1;
|
||||
inline const ::std::string& type() const;
|
||||
inline void set_type(const ::std::string& value);
|
||||
inline void set_type(const char* value);
|
||||
inline void set_type(const char* value, size_t size);
|
||||
inline ::std::string* mutable_type();
|
||||
|
||||
// optional bytes indexdata = 2;
|
||||
inline bool has_indexdata() const;
|
||||
inline void clear_indexdata();
|
||||
static const int kIndexdataFieldNumber = 2;
|
||||
inline const ::std::string& indexdata() const;
|
||||
inline void set_indexdata(const ::std::string& value);
|
||||
inline void set_indexdata(const char* value);
|
||||
inline void set_indexdata(const void* value, size_t size);
|
||||
inline ::std::string* mutable_indexdata();
|
||||
|
||||
// required int32 datasize = 3;
|
||||
inline bool has_datasize() const;
|
||||
inline void clear_datasize();
|
||||
static const int kDatasizeFieldNumber = 3;
|
||||
inline ::google::protobuf::int32 datasize() const;
|
||||
inline void set_datasize(::google::protobuf::int32 value);
|
||||
|
||||
// @@protoc_insertion_point(class_scope:OSMPBF.BlobHeader)
|
||||
private:
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
mutable int _cached_size_;
|
||||
|
||||
::std::string* type_;
|
||||
static const ::std::string _default_type_;
|
||||
::std::string* indexdata_;
|
||||
static const ::std::string _default_indexdata_;
|
||||
::google::protobuf::int32 datasize_;
|
||||
friend void protobuf_AddDesc_fileformat_2eproto();
|
||||
friend void protobuf_AssignDesc_fileformat_2eproto();
|
||||
friend void protobuf_ShutdownFile_fileformat_2eproto();
|
||||
|
||||
::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
|
||||
|
||||
// WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
|
||||
inline bool _has_bit(int index) const {
|
||||
return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
|
||||
}
|
||||
inline void _set_bit(int index) {
|
||||
_has_bits_[index / 32] |= (1u << (index % 32));
|
||||
}
|
||||
inline void _clear_bit(int index) {
|
||||
_has_bits_[index / 32] &= ~(1u << (index % 32));
|
||||
}
|
||||
|
||||
void InitAsDefaultInstance();
|
||||
static BlobHeader* default_instance_;
|
||||
};
|
||||
// ===================================================================
|
||||
|
||||
|
||||
// ===================================================================
|
||||
|
||||
// Blob
|
||||
|
||||
// optional bytes raw = 1;
|
||||
inline bool Blob::has_raw() const {
|
||||
return _has_bit(0);
|
||||
}
|
||||
inline void Blob::clear_raw() {
|
||||
if (raw_ != &_default_raw_) {
|
||||
raw_->clear();
|
||||
}
|
||||
_clear_bit(0);
|
||||
}
|
||||
inline const ::std::string& Blob::raw() const {
|
||||
return *raw_;
|
||||
}
|
||||
inline void Blob::set_raw(const ::std::string& value) {
|
||||
_set_bit(0);
|
||||
if (raw_ == &_default_raw_) {
|
||||
raw_ = new ::std::string;
|
||||
}
|
||||
raw_->assign(value);
|
||||
}
|
||||
inline void Blob::set_raw(const char* value) {
|
||||
_set_bit(0);
|
||||
if (raw_ == &_default_raw_) {
|
||||
raw_ = new ::std::string;
|
||||
}
|
||||
raw_->assign(value);
|
||||
}
|
||||
inline void Blob::set_raw(const void* value, size_t size) {
|
||||
_set_bit(0);
|
||||
if (raw_ == &_default_raw_) {
|
||||
raw_ = new ::std::string;
|
||||
}
|
||||
raw_->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* Blob::mutable_raw() {
|
||||
_set_bit(0);
|
||||
if (raw_ == &_default_raw_) {
|
||||
raw_ = new ::std::string;
|
||||
}
|
||||
return raw_;
|
||||
}
|
||||
|
||||
// optional int32 raw_size = 2;
|
||||
inline bool Blob::has_raw_size() const {
|
||||
return _has_bit(1);
|
||||
}
|
||||
inline void Blob::clear_raw_size() {
|
||||
raw_size_ = 0;
|
||||
_clear_bit(1);
|
||||
}
|
||||
inline ::google::protobuf::int32 Blob::raw_size() const {
|
||||
return raw_size_;
|
||||
}
|
||||
inline void Blob::set_raw_size(::google::protobuf::int32 value) {
|
||||
_set_bit(1);
|
||||
raw_size_ = value;
|
||||
}
|
||||
|
||||
// optional bytes zlib_data = 3;
|
||||
inline bool Blob::has_zlib_data() const {
|
||||
return _has_bit(2);
|
||||
}
|
||||
inline void Blob::clear_zlib_data() {
|
||||
if (zlib_data_ != &_default_zlib_data_) {
|
||||
zlib_data_->clear();
|
||||
}
|
||||
_clear_bit(2);
|
||||
}
|
||||
inline const ::std::string& Blob::zlib_data() const {
|
||||
return *zlib_data_;
|
||||
}
|
||||
inline void Blob::set_zlib_data(const ::std::string& value) {
|
||||
_set_bit(2);
|
||||
if (zlib_data_ == &_default_zlib_data_) {
|
||||
zlib_data_ = new ::std::string;
|
||||
}
|
||||
zlib_data_->assign(value);
|
||||
}
|
||||
inline void Blob::set_zlib_data(const char* value) {
|
||||
_set_bit(2);
|
||||
if (zlib_data_ == &_default_zlib_data_) {
|
||||
zlib_data_ = new ::std::string;
|
||||
}
|
||||
zlib_data_->assign(value);
|
||||
}
|
||||
inline void Blob::set_zlib_data(const void* value, size_t size) {
|
||||
_set_bit(2);
|
||||
if (zlib_data_ == &_default_zlib_data_) {
|
||||
zlib_data_ = new ::std::string;
|
||||
}
|
||||
zlib_data_->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* Blob::mutable_zlib_data() {
|
||||
_set_bit(2);
|
||||
if (zlib_data_ == &_default_zlib_data_) {
|
||||
zlib_data_ = new ::std::string;
|
||||
}
|
||||
return zlib_data_;
|
||||
}
|
||||
|
||||
// optional bytes lzma_data = 4;
|
||||
inline bool Blob::has_lzma_data() const {
|
||||
return _has_bit(3);
|
||||
}
|
||||
inline void Blob::clear_lzma_data() {
|
||||
if (lzma_data_ != &_default_lzma_data_) {
|
||||
lzma_data_->clear();
|
||||
}
|
||||
_clear_bit(3);
|
||||
}
|
||||
inline const ::std::string& Blob::lzma_data() const {
|
||||
return *lzma_data_;
|
||||
}
|
||||
inline void Blob::set_lzma_data(const ::std::string& value) {
|
||||
_set_bit(3);
|
||||
if (lzma_data_ == &_default_lzma_data_) {
|
||||
lzma_data_ = new ::std::string;
|
||||
}
|
||||
lzma_data_->assign(value);
|
||||
}
|
||||
inline void Blob::set_lzma_data(const char* value) {
|
||||
_set_bit(3);
|
||||
if (lzma_data_ == &_default_lzma_data_) {
|
||||
lzma_data_ = new ::std::string;
|
||||
}
|
||||
lzma_data_->assign(value);
|
||||
}
|
||||
inline void Blob::set_lzma_data(const void* value, size_t size) {
|
||||
_set_bit(3);
|
||||
if (lzma_data_ == &_default_lzma_data_) {
|
||||
lzma_data_ = new ::std::string;
|
||||
}
|
||||
lzma_data_->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* Blob::mutable_lzma_data() {
|
||||
_set_bit(3);
|
||||
if (lzma_data_ == &_default_lzma_data_) {
|
||||
lzma_data_ = new ::std::string;
|
||||
}
|
||||
return lzma_data_;
|
||||
}
|
||||
|
||||
// optional bytes OBSOLETE_bzip2_data = 5 [deprecated = true];
|
||||
inline bool Blob::has_obsolete_bzip2_data() const {
|
||||
return _has_bit(4);
|
||||
}
|
||||
inline void Blob::clear_obsolete_bzip2_data() {
|
||||
if (obsolete_bzip2_data_ != &_default_obsolete_bzip2_data_) {
|
||||
obsolete_bzip2_data_->clear();
|
||||
}
|
||||
_clear_bit(4);
|
||||
}
|
||||
inline const ::std::string& Blob::obsolete_bzip2_data() const {
|
||||
return *obsolete_bzip2_data_;
|
||||
}
|
||||
inline void Blob::set_obsolete_bzip2_data(const ::std::string& value) {
|
||||
_set_bit(4);
|
||||
if (obsolete_bzip2_data_ == &_default_obsolete_bzip2_data_) {
|
||||
obsolete_bzip2_data_ = new ::std::string;
|
||||
}
|
||||
obsolete_bzip2_data_->assign(value);
|
||||
}
|
||||
inline void Blob::set_obsolete_bzip2_data(const char* value) {
|
||||
_set_bit(4);
|
||||
if (obsolete_bzip2_data_ == &_default_obsolete_bzip2_data_) {
|
||||
obsolete_bzip2_data_ = new ::std::string;
|
||||
}
|
||||
obsolete_bzip2_data_->assign(value);
|
||||
}
|
||||
inline void Blob::set_obsolete_bzip2_data(const void* value, size_t size) {
|
||||
_set_bit(4);
|
||||
if (obsolete_bzip2_data_ == &_default_obsolete_bzip2_data_) {
|
||||
obsolete_bzip2_data_ = new ::std::string;
|
||||
}
|
||||
obsolete_bzip2_data_->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* Blob::mutable_obsolete_bzip2_data() {
|
||||
_set_bit(4);
|
||||
if (obsolete_bzip2_data_ == &_default_obsolete_bzip2_data_) {
|
||||
obsolete_bzip2_data_ = new ::std::string;
|
||||
}
|
||||
return obsolete_bzip2_data_;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// BlobHeader
|
||||
|
||||
// required string type = 1;
|
||||
inline bool BlobHeader::has_type() const {
|
||||
return _has_bit(0);
|
||||
}
|
||||
inline void BlobHeader::clear_type() {
|
||||
if (type_ != &_default_type_) {
|
||||
type_->clear();
|
||||
}
|
||||
_clear_bit(0);
|
||||
}
|
||||
inline const ::std::string& BlobHeader::type() const {
|
||||
return *type_;
|
||||
}
|
||||
inline void BlobHeader::set_type(const ::std::string& value) {
|
||||
_set_bit(0);
|
||||
if (type_ == &_default_type_) {
|
||||
type_ = new ::std::string;
|
||||
}
|
||||
type_->assign(value);
|
||||
}
|
||||
inline void BlobHeader::set_type(const char* value) {
|
||||
_set_bit(0);
|
||||
if (type_ == &_default_type_) {
|
||||
type_ = new ::std::string;
|
||||
}
|
||||
type_->assign(value);
|
||||
}
|
||||
inline void BlobHeader::set_type(const char* value, size_t size) {
|
||||
_set_bit(0);
|
||||
if (type_ == &_default_type_) {
|
||||
type_ = new ::std::string;
|
||||
}
|
||||
type_->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* BlobHeader::mutable_type() {
|
||||
_set_bit(0);
|
||||
if (type_ == &_default_type_) {
|
||||
type_ = new ::std::string;
|
||||
}
|
||||
return type_;
|
||||
}
|
||||
|
||||
// optional bytes indexdata = 2;
|
||||
inline bool BlobHeader::has_indexdata() const {
|
||||
return _has_bit(1);
|
||||
}
|
||||
inline void BlobHeader::clear_indexdata() {
|
||||
if (indexdata_ != &_default_indexdata_) {
|
||||
indexdata_->clear();
|
||||
}
|
||||
_clear_bit(1);
|
||||
}
|
||||
inline const ::std::string& BlobHeader::indexdata() const {
|
||||
return *indexdata_;
|
||||
}
|
||||
inline void BlobHeader::set_indexdata(const ::std::string& value) {
|
||||
_set_bit(1);
|
||||
if (indexdata_ == &_default_indexdata_) {
|
||||
indexdata_ = new ::std::string;
|
||||
}
|
||||
indexdata_->assign(value);
|
||||
}
|
||||
inline void BlobHeader::set_indexdata(const char* value) {
|
||||
_set_bit(1);
|
||||
if (indexdata_ == &_default_indexdata_) {
|
||||
indexdata_ = new ::std::string;
|
||||
}
|
||||
indexdata_->assign(value);
|
||||
}
|
||||
inline void BlobHeader::set_indexdata(const void* value, size_t size) {
|
||||
_set_bit(1);
|
||||
if (indexdata_ == &_default_indexdata_) {
|
||||
indexdata_ = new ::std::string;
|
||||
}
|
||||
indexdata_->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* BlobHeader::mutable_indexdata() {
|
||||
_set_bit(1);
|
||||
if (indexdata_ == &_default_indexdata_) {
|
||||
indexdata_ = new ::std::string;
|
||||
}
|
||||
return indexdata_;
|
||||
}
|
||||
|
||||
// required int32 datasize = 3;
|
||||
inline bool BlobHeader::has_datasize() const {
|
||||
return _has_bit(2);
|
||||
}
|
||||
inline void BlobHeader::clear_datasize() {
|
||||
datasize_ = 0;
|
||||
_clear_bit(2);
|
||||
}
|
||||
inline ::google::protobuf::int32 BlobHeader::datasize() const {
|
||||
return datasize_;
|
||||
}
|
||||
inline void BlobHeader::set_datasize(::google::protobuf::int32 value) {
|
||||
_set_bit(2);
|
||||
datasize_ = value;
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(namespace_scope)
|
||||
|
||||
} // namespace OSMPBF
|
||||
|
||||
#ifndef SWIG
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
|
||||
|
||||
} // namespace google
|
||||
} // namespace protobuf
|
||||
#endif // SWIG
|
||||
|
||||
// @@protoc_insertion_point(global_scope)
|
||||
|
||||
#endif // PROTOBUF_fileformat_2eproto__INCLUDED
|
||||
@@ -0,0 +1,53 @@
|
||||
/** Copyright (c) 2010 Scott A. Crosby. <scott@sacrosby.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
option java_package = "crosby.binary";
|
||||
package OSMPBF;
|
||||
|
||||
//protoc --java_out=../.. fileformat.proto
|
||||
|
||||
|
||||
//
|
||||
// STORAGE LAYER: Storing primitives.
|
||||
//
|
||||
|
||||
message Blob {
|
||||
optional bytes raw = 1; // No compression
|
||||
optional int32 raw_size = 2; // When compressed, the uncompressed size
|
||||
|
||||
// Possible compressed versions of the data.
|
||||
optional bytes zlib_data = 3;
|
||||
|
||||
// PROPOSED feature for LZMA compressed data. SUPPORT IS NOT REQUIRED.
|
||||
optional bytes lzma_data = 4;
|
||||
|
||||
// Formerly used for bzip2 compressed data. Depreciated in 2010.
|
||||
optional bytes OBSOLETE_bzip2_data = 5 [deprecated=true]; // Don't reuse this tag number.
|
||||
}
|
||||
|
||||
/* A file contains an sequence of fileblock headers, each prefixed by
|
||||
their length in network byte order, followed by a data block
|
||||
containing the actual data. types staring with a "_" are reserved.
|
||||
*/
|
||||
|
||||
message BlobHeader {
|
||||
required string type = 1;
|
||||
optional bytes indexdata = 2;
|
||||
required int32 datasize = 3;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,226 @@
|
||||
/** Copyright (c) 2010 Scott A. Crosby. <scott@sacrosby.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
option java_package = "crosby.binary";
|
||||
package OSMPBF;
|
||||
|
||||
/* OSM Binary file format
|
||||
|
||||
This is the master schema file of the OSM binary file format. This
|
||||
file is designed to support limited random-access and future
|
||||
extendability.
|
||||
|
||||
A binary OSM file consists of a sequence of FileBlocks (please see
|
||||
fileformat.proto). The first fileblock contains a serialized instance
|
||||
of HeaderBlock, followed by a sequence of PrimitiveBlock blocks that
|
||||
contain the primitives.
|
||||
|
||||
Each primitiveblock is designed to be independently parsable. It
|
||||
contains a string table storing all strings in that block (keys and
|
||||
values in tags, roles in relations, usernames, etc.) as well as
|
||||
metadata containing the precision of coordinates or timestamps in that
|
||||
block.
|
||||
|
||||
A primitiveblock contains a sequence of primitive groups, each
|
||||
containing primitives of the same type (nodes, densenodes, ways,
|
||||
relations). Coordinates are stored in signed 64-bit integers. Lat&lon
|
||||
are measured in units <granularity> nanodegrees. The default of
|
||||
granularity of 100 nanodegrees corresponds to about 1cm on the ground,
|
||||
and a full lat or lon fits into 32 bits.
|
||||
|
||||
Converting an integer to a lattitude or longitude uses the formula:
|
||||
$OUT = IN * granularity / 10**9$. Many encoding schemes use delta
|
||||
coding when representing nodes and relations.
|
||||
|
||||
*/
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* Contains the file header. */
|
||||
|
||||
message HeaderBlock {
|
||||
optional HeaderBBox bbox = 1;
|
||||
/* Additional tags to aid in parsing this dataset */
|
||||
repeated string required_features = 4;
|
||||
repeated string optional_features = 5;
|
||||
|
||||
optional string writingprogram = 16;
|
||||
optional string source = 17; // From the bbox field.
|
||||
}
|
||||
|
||||
|
||||
/** The bounding box field in the OSM header. BBOX, as used in the OSM
|
||||
header. Units are always in nanodegrees -- they do not obey
|
||||
granularity rules. */
|
||||
|
||||
message HeaderBBox {
|
||||
required sint64 left = 1;
|
||||
required sint64 right = 2;
|
||||
required sint64 top = 3;
|
||||
required sint64 bottom = 4;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
message PrimitiveBlock {
|
||||
required StringTable stringtable = 1;
|
||||
repeated PrimitiveGroup primitivegroup = 2;
|
||||
|
||||
// Granularity, units of nanodegrees, used to store coordinates in this block
|
||||
optional int32 granularity = 17 [default=100];
|
||||
// Offset value between the output coordinates coordinates and the granularity grid in unites of nanodegrees.
|
||||
optional int64 lat_offset = 19 [default=0];
|
||||
optional int64 lon_offset = 20 [default=0];
|
||||
|
||||
// Granularity of dates, normally represented in units of milliseconds since the 1970 epoch.
|
||||
optional int32 date_granularity = 18 [default=1000];
|
||||
|
||||
|
||||
// Proposed extension:
|
||||
//optional BBox bbox = XX;
|
||||
}
|
||||
|
||||
// Group of OSMPrimitives. All primitives in a group must be the same type.
|
||||
message PrimitiveGroup {
|
||||
repeated Node nodes = 1;
|
||||
optional DenseNodes dense = 2;
|
||||
repeated Way ways = 3;
|
||||
repeated Relation relations = 4;
|
||||
repeated ChangeSet changesets = 5;
|
||||
}
|
||||
|
||||
|
||||
/** String table, contains the common strings in each block.
|
||||
|
||||
Note that we reserve index '0' as a delimiter, so the entry at that
|
||||
index in the table is ALWAYS blank and unused.
|
||||
|
||||
*/
|
||||
message StringTable {
|
||||
repeated bytes s = 1;
|
||||
}
|
||||
|
||||
/* Optional metadata that may be included into each primitive. */
|
||||
message Info {
|
||||
optional int32 version = 1 [default = -1];
|
||||
optional int64 timestamp = 2;
|
||||
optional int64 changeset = 3;
|
||||
optional int32 uid = 4;
|
||||
optional uint32 user_sid = 5; // String IDs
|
||||
}
|
||||
|
||||
/** Optional metadata that may be included into each primitive. Special dense format used in DenseNodes. */
|
||||
message DenseInfo {
|
||||
repeated int32 version = 1 [packed = true];
|
||||
repeated sint64 timestamp = 2 [packed = true]; // DELTA coded
|
||||
repeated sint64 changeset = 3 [packed = true]; // DELTA coded
|
||||
repeated sint32 uid = 4 [packed = true]; // DELTA coded
|
||||
repeated sint32 user_sid = 5 [packed = true]; // String IDs for usernames. DELTA coded
|
||||
}
|
||||
|
||||
|
||||
// THIS IS STUB DESIGN FOR CHANGESETS. NOT USED RIGHT NOW.
|
||||
// TODO: REMOVE THIS?
|
||||
message ChangeSet {
|
||||
required int64 id = 1;
|
||||
//
|
||||
// // Parallel arrays.
|
||||
// repeated uint32 keys = 2 [packed = true]; // String IDs.
|
||||
// repeated uint32 vals = 3 [packed = true]; // String IDs.
|
||||
//
|
||||
// optional Info info = 4;
|
||||
|
||||
// optional int64 created_at = 8;
|
||||
// optional int64 closetime_delta = 9;
|
||||
// optional bool open = 10;
|
||||
// optional HeaderBBox bbox = 11;
|
||||
}
|
||||
|
||||
|
||||
message Node {
|
||||
required sint64 id = 1;
|
||||
// Parallel arrays.
|
||||
repeated uint32 keys = 2 [packed = true]; // String IDs.
|
||||
repeated uint32 vals = 3 [packed = true]; // String IDs.
|
||||
|
||||
optional Info info = 4; // May be omitted in omitmeta
|
||||
|
||||
required sint64 lat = 8;
|
||||
required sint64 lon = 9;
|
||||
}
|
||||
|
||||
/* Used to densly represent a sequence of nodes that do not have any tags.
|
||||
|
||||
We represent these nodes columnwise as five columns: ID's, lats, and
|
||||
lons, all delta coded. When metadata is not omitted,
|
||||
|
||||
We encode keys & vals for all nodes as a single array of integers
|
||||
containing key-stringid and val-stringid, using a stringid of 0 as a
|
||||
delimiter between nodes.
|
||||
|
||||
( (<keyid> <valid>)* '0' )*
|
||||
*/
|
||||
|
||||
message DenseNodes {
|
||||
repeated sint64 id = 1 [packed = true]; // DELTA coded
|
||||
|
||||
//repeated Info info = 4;
|
||||
optional DenseInfo denseinfo = 5;
|
||||
|
||||
repeated sint64 lat = 8 [packed = true]; // DELTA coded
|
||||
repeated sint64 lon = 9 [packed = true]; // DELTA coded
|
||||
|
||||
// Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless.
|
||||
repeated int32 keys_vals = 10 [packed = true];
|
||||
}
|
||||
|
||||
|
||||
message Way {
|
||||
required int64 id = 1;
|
||||
// Parallel arrays.
|
||||
repeated uint32 keys = 2 [packed = true];
|
||||
repeated uint32 vals = 3 [packed = true];
|
||||
|
||||
optional Info info = 4;
|
||||
|
||||
repeated sint64 refs = 8 [packed = true]; // DELTA coded
|
||||
}
|
||||
|
||||
message Relation {
|
||||
enum MemberType {
|
||||
NODE = 0;
|
||||
WAY = 1;
|
||||
RELATION = 2;
|
||||
}
|
||||
required int64 id = 1;
|
||||
|
||||
// Parallel arrays.
|
||||
repeated uint32 keys = 2 [packed = true];
|
||||
repeated uint32 vals = 3 [packed = true];
|
||||
|
||||
optional Info info = 4;
|
||||
|
||||
// Parallel arrays
|
||||
repeated int32 roles_sid = 8 [packed = true];
|
||||
repeated sint64 memids = 9 [packed = true]; // DELTA encoded
|
||||
repeated MemberType types = 10 [packed = true];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user