diff --git a/Contractor/Contractor.h b/Contractor/Contractor.h index 2d1a08398..f15c5a77e 100644 --- a/Contractor/Contractor.h +++ b/Contractor/Contractor.h @@ -275,21 +275,17 @@ public: } template< class InputEdge > - void CheckForAllOrigEdges(std::vector< InputEdge >& inputEdges) - { - for(unsigned int i = 0; i < inputEdges.size(); i++) - { + void CheckForAllOrigEdges(std::vector< InputEdge >& inputEdges) { + for(unsigned int i = 0; i < inputEdges.size(); i++) { bool found = false; _DynamicGraph::EdgeIterator eit = _graph->BeginEdges(inputEdges[i].source()); - for(;eit<_graph->EndEdges(inputEdges[i].source()); eit++) - { - if(_graph->GetEdgeData(eit).distance = inputEdges[i].weight()) + for(;eit<_graph->EndEdges(inputEdges[i].source()); eit++) { + if(_graph->GetEdgeData(eit).distance == inputEdges[i].weight()) found = true; } eit = _graph->BeginEdges(inputEdges[i].target()); - for(;eit<_graph->EndEdges(inputEdges[i].target()); eit++) - { - if(_graph->GetEdgeData(eit).distance = inputEdges[i].weight()) + for(;eit<_graph->EndEdges(inputEdges[i].target()); eit++) { + if(_graph->GetEdgeData(eit).distance == inputEdges[i].weight()) found = true; } assert(found); @@ -303,7 +299,7 @@ public: unsigned maxThreads = omp_get_max_threads(); std::vector < _ThreadData* > threadData; - for ( int threadNum = 0; threadNum < maxThreads; ++threadNum ) { + for ( unsigned threadNum = 0; threadNum < maxThreads; ++threadNum ) { threadData.push_back( new _ThreadData( numberOfNodes ) ); } cout << "Contractor is using " << maxThreads << " threads" << endl; @@ -388,7 +384,7 @@ public: timeLast = _Timestamp(); //insert new edges - for ( int threadNum = 0; threadNum < maxThreads; ++threadNum ) { + for ( unsigned threadNum = 0; threadNum < maxThreads; ++threadNum ) { _ThreadData& data = *threadData[threadNum]; for ( int i = 0; i < ( int ) data.insertedEdges.size(); ++i ) { const _ImportEdge& edge = data.insertedEdges[i]; @@ -442,14 +438,11 @@ public: p.printStatus(levelID); } - for ( int threadNum = 0; threadNum < maxThreads; threadNum++ ) { - // _witnessList.insert( _witnessList.end(), threadData[threadNum]->witnessList.begin(), threadData[threadNum]->witnessList.end() ); + for ( unsigned threadNum = 0; threadNum < maxThreads; threadNum++ ) { delete threadData[threadNum]; } - // log.PrintSummary(); - // cout << "Total Time: " << log.GetSum().GetTotalTime()<< " s" << endl; - cout << "checking sanity of generated data ..." << flush; + cout << "[contractor] checking sanity of generated data ..." << flush; _CheckCH<_EdgeData>(); cout << "ok" << endl; } @@ -595,7 +588,7 @@ private: if ( node != source ) heap.Insert( node, inData.distance, _HeapData() ); int maxDistance = 0; - unsigned numTargets = 0; + //unsigned numTargets = 0; for ( _DynamicGraph::EdgeIterator outEdge = _graph->BeginEdges( node ), endOutEdges = _graph->EndEdges( node ); outEdge != endOutEdges; ++outEdge ) { const _EdgeData& outData = _graph->GetEdgeData( outEdge ); diff --git a/DataStructures/BaseParser.h b/DataStructures/BaseParser.h new file mode 100644 index 000000000..7d0bc9011 --- /dev/null +++ b/DataStructures/BaseParser.h @@ -0,0 +1,34 @@ +/* + open source routing machine + Copyright (C) Dennis Luxen, others 2010 + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +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 Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. + */ + +#ifndef BASEPARSER_H_ +#define BASEPARSER_H_ + +template +class BaseParser { +public: + virtual ~BaseParser() {} + virtual bool Init() = 0; + virtual bool RegisterCallbacks(bool (*nodeCallbackPointer)(NodeT), bool (*relationCallbackPointer)(RelationT), bool (*wayCallbackPointer)(WayT)) = 0; + virtual bool Parse() = 0; +private: +}; + +#endif /* BASEPARSER_H_ */ diff --git a/DataStructures/ExtractorStructs.h b/DataStructures/ExtractorStructs.h index 5ee10fca1..f1bab4763 100644 --- a/DataStructures/ExtractorStructs.h +++ b/DataStructures/ExtractorStructs.h @@ -50,8 +50,6 @@ std::string names[14] = { "motorway", "motorway_link", "trunk", "trunk_link", "p double speeds[14] = { 110, 90, 90, 70, 70, 60, 60, 50, 55, 25, 40 , 10, 30, 5}; struct _Node : NodeInfo{ - bool trafficSignal; - _Node(int _lat, int _lon, unsigned int _id) : NodeInfo(_lat, _lon, _id) {} _Node() {} @@ -77,15 +75,26 @@ struct _Coordinate { }; struct _Way { + _Way() { + direction = _Way::notSure; + maximumSpeed = -1; + type = -1; + useful = false; + access = true; + } + std::vector< NodeID > path; enum { notSure = 0, oneway, bidirectional, opposite } direction; + unsigned id; unsigned nameID; + std::string name; double maximumSpeed; - bool usefull:1; + bool useful:1; bool access:1; short type; + HashTable keyVals; }; struct _Relation { @@ -114,11 +123,11 @@ struct Settings { vector< double > speed; vector< string > names; } speedProfile; -// vector accessList; - int trafficLightPenalty; + // vector accessList; + // int trafficLightPenalty; int indexInAccessListOf( const string & key) { - for(int i = 0; i< speedProfile.names.size(); i++) + for(unsigned i = 0; i< speedProfile.names.size(); i++) { if(speedProfile.names[i] == key) return i; @@ -195,265 +204,6 @@ struct CmpNodeByID : public std::binary_function<_Node, _Node, bool> } }; - -_Way _ReadXMLWay( xmlTextReaderPtr& inputReader, Settings& settings, string& name) { - _Way way; - way.direction = _Way::notSure; - way.maximumSpeed = -1; - way.type = -1; - way.usefull = false; - way.access = true; -// cout << "new way" << endl; - if ( xmlTextReaderIsEmptyElement( inputReader ) != 1 ) { - const int depth = xmlTextReaderDepth( inputReader ); - while ( xmlTextReaderRead( inputReader ) == 1 ) { - const int childType = xmlTextReaderNodeType( inputReader ); - if ( childType != 1 && childType != 15 ) - continue; - const int childDepth = xmlTextReaderDepth( inputReader ); - xmlChar* childName = xmlTextReaderName( inputReader ); - if ( childName == NULL ) - continue; - - if ( depth == childDepth && childType == 15 && xmlStrEqual( childName, ( const xmlChar* ) "way" ) == 1 ) { - xmlFree( childName ); - break; - } - if ( childType != 1 ) { - xmlFree( childName ); - continue; - } - - if ( xmlStrEqual( childName, ( const xmlChar* ) "tag" ) == 1 ) { - xmlChar* k = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "k" ); - xmlChar* value = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "v" ); -// cout << "->k=" << k << ", v=" << value << endl; - if ( k != NULL && value != NULL ) { - - if ( xmlStrEqual( k, ( const xmlChar* ) "name" ) == 1 ) { - name = string((char *) value); - } else if ( xmlStrEqual( k, ( const xmlChar* ) "ref" ) == 1 ) { - if(name == "") - { - name = string((char *) value); -// cout << ", ref: " << name << endl; - } - } - - if ( xmlStrEqual( k, ( const xmlChar* ) "oneway" ) == 1 ) { - if ( xmlStrEqual( value, ( const xmlChar* ) "no" ) == 1 || xmlStrEqual( value, ( const xmlChar* ) "false" ) == 1 || xmlStrEqual( value, ( const xmlChar* ) "0" ) == 1 ) - way.direction = _Way::bidirectional; - else if ( xmlStrEqual( value, ( const xmlChar* ) "yes" ) == 1 || xmlStrEqual( value, ( const xmlChar* ) "true" ) == 1 || xmlStrEqual( value, ( const xmlChar* ) "1" ) == 1 ) - way.direction = _Way::oneway; - else if ( xmlStrEqual( value, ( const xmlChar* ) "-1" ) == 1 ) - way.direction = _Way::opposite; - } else if ( xmlStrEqual( k, ( const xmlChar* ) "junction" ) == 1 ) { - if ( xmlStrEqual( value, ( const xmlChar* ) "roundabout" ) == 1 ) { - if ( way.direction == _Way::notSure ) { - way.direction = _Way::oneway; - } - way.usefull = true; - if(way.type == -1) - way.type = 9; - } - } else if ( xmlStrEqual( k, ( const xmlChar* ) "route" ) == 1 ) { - string name( (const char* ) value ); - if (name == "ferry") { - for ( int i = 0; i < settings.speedProfile.names.size(); i++ ) { - if ( name == settings.speedProfile.names[i] ) { - way.type = i; - way.maximumSpeed = settings.speedProfile.speed[i]; - way.usefull = true; - way.direction == _Way::bidirectional; - break; - } - } - } - } else if ( xmlStrEqual( k, ( const xmlChar* ) "highway" ) == 1 ) { - string name( ( const char* ) value ); - for ( int i = 0; i < settings.speedProfile.names.size(); i++ ) { - if ( name == settings.speedProfile.names[i] ) { - way.type = i; - way.usefull = true; - break; - } - } - if ( name == "motorway" ) { - if ( way.direction == _Way::notSure ) { - way.direction = _Way::oneway; - } - } else if ( name == "motorway_link" ) { - if ( way.direction == _Way::notSure ) { - way.direction = _Way::oneway; - } - } - } else if ( xmlStrEqual( k, ( const xmlChar* ) "maxspeed" ) == 1 ) { - double maxspeed = atof(( const char* ) value ); - - xmlChar buffer[100]; - xmlStrPrintf( buffer, 100, ( const xmlChar* ) "%.lf", maxspeed ); - if ( xmlStrEqual( value, buffer ) == 1 ) { - way.maximumSpeed = maxspeed; - } else { - xmlStrPrintf( buffer, 100, ( const xmlChar* ) "%.lf kmh", maxspeed ); - if ( xmlStrEqual( value, buffer ) == 1 ) { - way.maximumSpeed = maxspeed; - } else { - xmlStrPrintf( buffer, 100, ( const xmlChar* ) "%.lfkmh", maxspeed ); - if ( xmlStrEqual( value, buffer ) == 1 ) { - way.maximumSpeed = maxspeed; - } else { - xmlStrPrintf( buffer, 100, ( const xmlChar* ) "%.lf km/h", maxspeed ); - if ( xmlStrEqual( value, buffer ) == 1 ) { - way.maximumSpeed = maxspeed; - } else { - xmlStrPrintf( buffer, 100, ( const xmlChar* ) "%.lfkm/h", maxspeed ); - if ( xmlStrEqual( value, buffer ) == 1 ) { - way.maximumSpeed = maxspeed; - } else { - xmlStrPrintf( buffer, 100, ( const xmlChar* ) "%.lf mph", maxspeed ); - if ( xmlStrEqual( value, buffer ) == 1 ) { - way.maximumSpeed = maxspeed; - } else { - xmlStrPrintf( buffer, 100, ( const xmlChar* ) "%.lfmph", maxspeed ); - if ( xmlStrEqual( value, buffer ) == 1 ) { - way.maximumSpeed = maxspeed; - } else { - xmlStrPrintf( buffer, 100, ( const xmlChar* ) "%.lf mp/h", maxspeed ); - if ( xmlStrEqual( value, buffer ) == 1 ) { - way.maximumSpeed = maxspeed; - } else { - xmlStrPrintf( buffer, 100, ( const xmlChar* ) "%.lfmp/h", maxspeed ); - if ( xmlStrEqual( value, buffer ) == 1 ) { - way.maximumSpeed = maxspeed; - } - } - } - } - } - } - } - } - } - } else { - if ( xmlStrEqual( k, (const xmlChar*) "access" )) - { - if ( xmlStrEqual( value, ( const xmlChar* ) "private" ) == 1) - - if ( xmlStrEqual( value, ( const xmlChar* ) "private" ) == 1 - || xmlStrEqual( value, ( const xmlChar* ) "no" ) == 1 - || xmlStrEqual( value, ( const xmlChar* ) "agricultural" ) == 1 - || xmlStrEqual( value, ( const xmlChar* ) "forestry" ) == 1 - || xmlStrEqual( value, ( const xmlChar* ) "delivery" ) == 1 - ) { - way.access = false; - } - else if ( xmlStrEqual( value, ( const xmlChar* ) "yes" ) == 1 - || xmlStrEqual( value, ( const xmlChar* ) "designated" ) == 1 - || xmlStrEqual( value, ( const xmlChar* ) "official" ) == 1 - || xmlStrEqual( value, ( const xmlChar* ) "permissive" ) == 1 - ) { - way.access = true; - } - } - if ( xmlStrEqual( k, (const xmlChar*) "motorcar" )) - { - if ( xmlStrEqual( value, ( const xmlChar* ) "yes" ) == 1) - { - way.access = true; - } else if ( xmlStrEqual( k, (const xmlChar*) "no" )) { - way.access = false; - } - - } - } - if ( k != NULL ) - xmlFree( k ); - if ( value != NULL ) - xmlFree( value ); - } - } else if ( xmlStrEqual( childName, ( const xmlChar* ) "nd" ) == 1 ) { - xmlChar* ref = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "ref" ); - if ( ref != NULL ) { - way.path.push_back( atoi(( const char* ) ref ) ); - xmlFree( ref ); - } - } - xmlFree( childName ); - } - } - return way; -} - -_Node _ReadXMLNode( xmlTextReaderPtr& inputReader ) { - _Node node; - node.trafficSignal = false; - - xmlChar* attribute = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "lat" ); - if ( attribute != NULL ) { - node.lat = static_cast(100000.*atof(( const char* ) attribute ) ); - xmlFree( attribute ); - } - attribute = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "lon" ); - if ( attribute != NULL ) { - node.lon = static_cast(100000.*atof(( const char* ) attribute )); - xmlFree( attribute ); - } - attribute = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "id" ); - if ( attribute != NULL ) { - node.id = atoi(( const char* ) attribute ); - xmlFree( attribute ); - } - - if ( xmlTextReaderIsEmptyElement( inputReader ) != 1 ) { - const int depth = xmlTextReaderDepth( inputReader ); - while ( xmlTextReaderRead( inputReader ) == 1 ) { - const int childType = xmlTextReaderNodeType( inputReader ); - // 1 = Element, 15 = EndElement - if ( childType != 1 && childType != 15 ) - continue; - const int childDepth = xmlTextReaderDepth( inputReader ); - xmlChar* childName = xmlTextReaderName( inputReader ); - if ( childName == NULL ) - continue; - - if ( depth == childDepth && childType == 15 && xmlStrEqual( childName, ( const xmlChar* ) "node" ) == 1 ) { - xmlFree( childName ); - break; - } - if ( childType != 1 ) { - xmlFree( childName ); - continue; - } - - if ( xmlStrEqual( childName, ( const xmlChar* ) "tag" ) == 1 ) { - xmlChar* k = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "k" ); - xmlChar* value = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "v" ); - if ( k != NULL && value != NULL ) { - if ( xmlStrEqual( k, ( const xmlChar* ) "highway" ) == 1 ) { - if ( xmlStrEqual( value, ( const xmlChar* ) "traffic_signals" ) == 1 ) - node.trafficSignal = true; - } - } - if ( k != NULL ) - xmlFree( k ); - if ( value != NULL ) - xmlFree( value ); - } - - xmlFree( childName ); - } - } - return node; -} - -_Relation _ReadXMLRelation ( xmlTextReaderPtr& inputReader ) { - _Relation relation; - relation.type = _Relation::unknown; - - return relation; -} - double ApproximateDistance( const int lat1, const int lon1, const int lat2, const int lon2 ) { static const double DEG_TO_RAD = 0.017453292519943295769236907684886; ///Earth's quatratic mean radius for WGS-84 @@ -472,15 +222,15 @@ double ApproximateDistance( const int lat1, const int lon1, const int lat2, cons /* Get angle of line segment (A,C)->(C,B), atan2 magic, formerly cosine theorem*/ double GetAngleBetweenTwoEdges(const _Coordinate& A, const _Coordinate& C, const _Coordinate& B) { -// double a = ApproximateDistance(A.lat, A.lon, C.lat, C.lon); //first edge segment -// double b = ApproximateDistance(B.lat, B.lon, C.lat, C.lon); //second edge segment -// double c = ApproximateDistance(A.lat, A.lon, B.lat, B.lon); //third edgefrom triangle -// -// double cosAlpha = (a*a + b*b - c*c)/ (2*a*b); -// -// double alpha = ( (acos(cosAlpha) * 180.0 / M_PI) * (cosAlpha > 0 ? -1 : 1) ) + 180; -// return alpha; -// V = + // double a = ApproximateDistance(A.lat, A.lon, C.lat, C.lon); //first edge segment + // double b = ApproximateDistance(B.lat, B.lon, C.lat, C.lon); //second edge segment + // double c = ApproximateDistance(A.lat, A.lon, B.lat, B.lon); //third edgefrom triangle + // + // double cosAlpha = (a*a + b*b - c*c)/ (2*a*b); + // + // double alpha = ( (acos(cosAlpha) * 180.0 / M_PI) * (cosAlpha > 0 ? -1 : 1) ) + 180; + // return alpha; + // V = int v1x = A.lon - C.lon; int v1y = A.lat - C.lat; int v2x = B.lon - C.lon; @@ -495,10 +245,10 @@ double GetAngleBetweenTwoEdges(const _Coordinate& A, const _Coordinate& C, const string GetRandomString() { char s[128]; - static const char alphanum[] = - "0123456789" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz"; + static const char alphanum[] = + "0123456789" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < 128; ++i) { s[i] = alphanum[rand() % (sizeof(alphanum) - 1)]; diff --git a/DataStructures/NNGrid.h b/DataStructures/NNGrid.h index a0f9d8fa0..17747ad7b 100644 --- a/DataStructures/NNGrid.h +++ b/DataStructures/NNGrid.h @@ -181,7 +181,7 @@ public: delete entries; } - for(int i = 0; i< indexFileStreams.size(); i++) { + for(unsigned i = 0; i< indexFileStreams.size(); i++) { delete indexFileStreams[i]; } threadLookup.EraseAll(); @@ -207,7 +207,7 @@ public: std::vector > indexList; getListOfIndexesForEdgeAndGridSize(start, target, indexList); - for(int i = 0; i < indexList.size(); i++) + for(unsigned i = 0; i < indexList.size(); i++) { entries->push_back(GridEdgeData(edge, indexList[i].first, indexList[i].second)); } @@ -381,7 +381,7 @@ private: } } - for(int i = 0; i < entriesWithSameRAMIndex.size() -1; i++) + for(unsigned i = 0; i < entriesWithSameRAMIndex.size() -1; i++) { assert(entriesWithSameRAMIndex[i].ramIndex== entriesWithSameRAMIndex[i+1].ramIndex); } @@ -431,7 +431,7 @@ private: } //write contents of tmpbuffer to disk - for(int i = 0; i < indexIntoTmpBuffer; i++) + for(unsigned i = 0; i < indexIntoTmpBuffer; i++) { indexOutFile.write(&(tmpBuffer->at(i)), sizeof(char)); numberOfWrittenBytes += sizeof(char); @@ -448,7 +448,7 @@ private: unsigned counter = 0; unsigned max = UINT_MAX; - for(int i = 0; i < vectorWithSameFileIndex.size()-1; i++) + for(unsigned i = 0; i < vectorWithSameFileIndex.size()-1; i++) { assert( vectorWithSameFileIndex[i].fileIndex == vectorWithSameFileIndex[i+1].fileIndex ); assert( vectorWithSameFileIndex[i].ramIndex == vectorWithSameFileIndex[i+1].ramIndex ); @@ -457,44 +457,44 @@ private: for(std::vector::const_iterator et = vectorWithSameFileIndex.begin(); et != vectorWithSameFileIndex.end(); et++) { char * start = (char *)&et->edge.start; - for(int i = 0; i < sizeof(NodeID); i++) + for(unsigned i = 0; i < sizeof(NodeID); i++) { tmpBuffer->at(index+counter) = start[i]; counter++; } char * target = (char *)&et->edge.target; - for(int i = 0; i < sizeof(NodeID); i++) + for(unsigned i = 0; i < sizeof(NodeID); i++) { tmpBuffer->at(index+counter) = target[i]; counter++; } char * slat = (char *) &(et->edge.startCoord.lat); - for(int i = 0; i < sizeof(int); i++) + for(unsigned i = 0; i < sizeof(int); i++) { tmpBuffer->at(index+counter) = slat[i]; counter++; } char * slon = (char *) &(et->edge.startCoord.lon); - for(int i = 0; i < sizeof(int); i++) + for(unsigned i = 0; i < sizeof(int); i++) { tmpBuffer->at(index+counter) = slon[i]; counter++; } char * tlat = (char *) &(et->edge.targetCoord.lat); - for(int i = 0; i < sizeof(int); i++) + for(unsigned i = 0; i < sizeof(int); i++) { tmpBuffer->at(index+counter) = tlat[i]; counter++; } char * tlon = (char *) &(et->edge.targetCoord.lon); - for(int i = 0; i < sizeof(int); i++) + for(unsigned i = 0; i < sizeof(int); i++) { tmpBuffer->at(index+counter) = tlon[i]; counter++; } } char * umax = (char *) &max; - for(int i = 0; i < sizeof(unsigned); i++) + for(unsigned i = 0; i < sizeof(unsigned); i++) { tmpBuffer->at(index+counter) = umax[i]; counter++; diff --git a/DataStructures/NodeInformationHelpDesk.h b/DataStructures/NodeInformationHelpDesk.h index 4b082c4e0..478a567d5 100644 --- a/DataStructures/NodeInformationHelpDesk.h +++ b/DataStructures/NodeInformationHelpDesk.h @@ -66,6 +66,7 @@ public: inline bool FindRoutingStarts(const _Coordinate start, const _Coordinate target, PhantomNodes * phantomNodes) { readOnlyGrid->FindRoutingStarts(start, target, phantomNodes); + return true; } inline void RegisterThread(const unsigned k, const unsigned v) { diff --git a/DataStructures/PBFParser.h b/DataStructures/PBFParser.h new file mode 100644 index 000000000..d62df8f05 --- /dev/null +++ b/DataStructures/PBFParser.h @@ -0,0 +1,421 @@ +/* + open source routing machine + Copyright (C) Dennis Luxen, others 2010 + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +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 Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. + */ + +#ifndef PBFPARSER_H_ +#define PBFPARSER_H_ + +#include + +#include "BaseParser.h" + +#include "pbf-proto/fileformat.pb.h" +#include "pbf-proto/osmformat.pb.h" +#include "../typedefs.h" +#include "HashTable.h" +#include "ExtractorStructs.h" + + +class PBFParser : public BaseParser<_Node, _Relation, _Way> { + + enum EntityType { + TypeNode = 1, + TypeWay = 2, + TypeRelation = 4, + TypeDenseNode = 8 + } ; + + enum Endianness { + LittleEndian = 1, + BigEndian = 2 + }; + + short entityTypeIndicator; + +public: + PBFParser(const char * fileName) { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + input.open(fileName, std::ios::in | std::ios::binary); + + if (!input) { + std::cerr << fileName << ": File not found." << std::endl; + } + + blockCount = 0; + groupCount = 0; + } + + bool RegisterCallbacks(bool (*nodeCallbackPointer)(_Node), bool (*relationCallbackPointer)(_Relation), bool (*wayCallbackPointer)(_Way) ) { + nodeCallback = *nodeCallbackPointer; + wayCallback = *wayCallbackPointer; + relationCallback = *relationCallbackPointer; + return true; + } + + ~PBFParser() { + if(input.is_open()) + input.close(); + + google::protobuf::ShutdownProtobufLibrary(); + + std::cout << "[info] blocks: " << blockCount << std::endl; + std::cout << "[info] groups: " << groupCount << std::endl; + } + + bool Init() { + if(!readPBFBlobHeader(input)) { + return false; + } + + if(readBlob(input)) { + char data[charBuffer.size()]; + for(unsigned i = 0; i < charBuffer.size(); i++ ){ + data[i] = charBuffer[i]; + } + if(!PBFHeaderBlock.ParseFromArray(data, charBuffer.size() ) ) { + std::cerr << "[error] Header not parseable!" << std::endl; + return false; + } + + for(int i = 0; i < PBFHeaderBlock.required_features_size(); i++) { + const std::string& feature = PBFHeaderBlock.required_features( i ); + bool supported = false; + if ( feature == "OsmSchema-V0.6" ) + supported = true; + else if ( feature == "DenseNodes" ) + supported = true; + + if ( !supported ) { + std::cerr << "[error] required feature not supported: " << feature.data() << std::endl; + return false; + } + } + } else { + std::cerr << "[error] blob not loaded!" << std::endl; + } + return true; + } + + bool Parse() { + //parse through all Blocks + while(readNextBlock(input)) { + + loadBlock(); + for(int i = 0; i < PBFprimitiveBlock.primitivegroup_size(); i++) { + currentGroupID = i; + loadGroup(); + + if(entityTypeIndicator == TypeNode) + parseNode(); + if(entityTypeIndicator == TypeWay) + parseWay(); + if(entityTypeIndicator == TypeRelation) + parseRelation(); + if(entityTypeIndicator == TypeDenseNode) + parseDenseNode(); + } + } + return true; + } + +private: + + void parseDenseNode() { + const OSMPBF::DenseNodes& dense = PBFprimitiveBlock.primitivegroup( currentGroupID ).dense(); + int denseTagIndex = 0; + int m_lastDenseID = 0; + int m_lastDenseLatitude = 0; + int m_lastDenseLongitude = 0; + + for(int i = 0; i < dense.id_size(); i++) { + m_lastDenseID += dense.id( i ); + m_lastDenseLatitude += dense.lat( i ); + m_lastDenseLongitude += dense.lon( i ); + _Node n; + n.id = m_lastDenseID; + n.lat = 100000*( ( double ) m_lastDenseLatitude * PBFprimitiveBlock.granularity() + PBFprimitiveBlock.lat_offset() ) / NANO; + n.lon = 100000*( ( double ) m_lastDenseLongitude * PBFprimitiveBlock.granularity() + PBFprimitiveBlock.lon_offset() ) / NANO; + while (denseTagIndex < dense.keys_vals_size()) { + int tagValue = dense.keys_vals( denseTagIndex ); + if(tagValue == 0) { + denseTagIndex++; + break; + } + //int keyValue = dense.keys_vals ( denseTagIndex+1 ); + /* Key/Value Pairs are known from here on */ + // std::cout << "[debug] node: " << n.id << std::endl; + // std::cout << "[debug] key = " << PBFprimitiveBlock.stringtable().s(tagValue).data() << ", value: " << PBFprimitiveBlock.stringtable().s(keyValue).data() << std::endl; + + denseTagIndex += 2; + } + + if(!(*nodeCallback)(n)) + std::cerr << "[PBFParser] dense node not parsed" << std::endl; + } + } + + void parseNode() { + _Node n; + if(!(*nodeCallback)(n)) + std::cerr << "[PBFParser] simple node not parsed" << std::endl; + } + + void parseRelation() { + const OSMPBF::PrimitiveGroup& group = PBFprimitiveBlock.primitivegroup( currentGroupID ); + for(int i = 0; i < group.relations_size(); i++ ) { + _Relation r; + r.type = _Relation::unknown; + if(!(*relationCallback)(r)) + std::cerr << "[PBFParser] relation not parsed" << std::endl; + } + } + + void parseWay() { + if( PBFprimitiveBlock.primitivegroup( currentGroupID ).ways_size() > 0) { + for(int i = 0; i < PBFprimitiveBlock.primitivegroup( currentGroupID ).ways_size(); i++) { + const OSMPBF::Way& inputWay = PBFprimitiveBlock.primitivegroup( currentGroupID ).ways( i ); + _Way w; + w.id = inputWay.id(); + unsigned pathNode(0); + for(int i = 0; i < inputWay.refs_size(); i++) { + pathNode += inputWay.refs(i); + w.path.push_back(pathNode); + } + assert(inputWay.keys_size() == inputWay.vals_size()); + for(int i = 0; i < inputWay.keys_size(); i++) { + // std::cout << "[debug] key: " << PBFprimitiveBlock.stringtable().s(inputWay.keys(i)) << ", val: " << PBFprimitiveBlock.stringtable().s(inputWay.vals(i)) << std::endl; + const std::string key = PBFprimitiveBlock.stringtable().s(inputWay.keys(i)); + const std::string val = PBFprimitiveBlock.stringtable().s(inputWay.vals(i)); + w.keyVals.Add(key, val); + } + if(!(*wayCallback)(w)) { + std::cerr << "[PBFParser] way not parsed" << std::endl; + } + } + } + } + + void loadGroup() { + groupCount++; + const OSMPBF::PrimitiveGroup& group = PBFprimitiveBlock.primitivegroup( currentGroupID ); + entityTypeIndicator = 0; + if ( group.nodes_size() != 0 ) { + entityTypeIndicator = TypeNode; + } + if ( group.ways_size() != 0 ) { + entityTypeIndicator = TypeWay; + } + if ( group.relations_size() != 0 ) { + entityTypeIndicator = TypeRelation; + } + if ( group.has_dense() ) { + entityTypeIndicator = TypeDenseNode; + assert( group.dense().id_size() != 0 ); + } + assert( entityTypeIndicator != 0 ); + } + + void loadBlock() { + blockCount++; + currentGroupID = 0; + currentEntityID = 0; +// int stringCount = PBFprimitiveBlock.stringtable().s_size(); + } + + /* Reverses Network Byte Order into something usable */ + inline unsigned swapEndian(unsigned x) { + if(getMachineEndianness() == LittleEndian) + return ( (x>>24) | ((x<<8) & 0x00FF0000) | ((x>>8) & 0x0000FF00) | (x<<24) ); + return x; + } + + bool readPBFBlobHeader(std::fstream& stream) { + int size(0); + stream.read((char *)&size, sizeof(int)); + size = swapEndian(size); + if(stream.eof()) { + return false; + } + if ( size > MAX_BLOB_HEADER_SIZE || size < 0 ) { + return false; + } + char data[size]; + for(int i = 0; i < size; i++) { + stream.read(&data[i], 1); + } + + if ( !PBFBlobHeader.ParseFromArray( data, size ) ) { + return false; + } + return true; + } + + bool unpackZLIB(std::fstream & stream) { + unsigned rawSize = PBFBlob.raw_size(); + char unpackedDataArray[rawSize]; + z_stream compressedDataStream; + compressedDataStream.next_in = ( unsigned char* ) PBFBlob.zlib_data().data(); + compressedDataStream.avail_in = PBFBlob.zlib_data().size(); + compressedDataStream.next_out = ( unsigned char* ) unpackedDataArray; + compressedDataStream.avail_out = rawSize; + compressedDataStream.zalloc = Z_NULL; + compressedDataStream.zfree = Z_NULL; + compressedDataStream.opaque = Z_NULL; + int ret = inflateInit( &compressedDataStream ); + if ( ret != Z_OK ) { + std::cerr << "[error] failed to init zlib stream" << std::endl; + return false; + } + + ret = inflate( &compressedDataStream, Z_FINISH ); + if ( ret != Z_STREAM_END ) { + std::cerr << "[error] failed to inflate zlib stream" << std::endl; + return false; + } + + ret = inflateEnd( &compressedDataStream ); + if ( ret != Z_OK ) { + std::cerr << "[error] failed to deinit zlib stream" << std::endl; + return false; + } + + charBuffer.clear(); charBuffer.resize(rawSize); + for(unsigned i = 0; i < rawSize; i++) { + charBuffer[i] = unpackedDataArray[i]; + } + return true; + } + + bool unpackLZMA(std::fstream & stream) { + return false; + } + + bool readBlob(std::fstream& stream) { + if(stream.eof()) + return false; + + int size = PBFBlobHeader.datasize(); + if ( size < 0 || size > MAX_BLOB_SIZE ) { + std::cerr << "[error] invalid Blob size:" << size << std::endl; + return false; + } + + char data[size]; + for(int i = 0; i < size; i++) { + stream.read(&data[i], 1); + } + + if ( !PBFBlob.ParseFromArray( data, size ) ) { + std::cerr << "[error] failed to parse blob" << std::endl; + return false; + } + + if ( PBFBlob.has_raw() ) { + const std::string& data = PBFBlob.raw(); + charBuffer.clear(); + charBuffer.resize( data.size() ); + for ( unsigned i = 0; i < data.size(); i++ ) { + charBuffer[i] = data[i]; + } + } else if ( PBFBlob.has_zlib_data() ) { + if ( !unpackZLIB(stream) ) { + std::cerr << "[error] zlib data encountered that could not be unpacked" << std::endl; + return false; + } + } else if ( PBFBlob.has_lzma_data() ) { + if ( !unpackLZMA(stream) ) + std::cerr << "[error] lzma data encountered that could not be unpacked" << std::endl; + return false; + } else { + std::cerr << "[error] Blob contains no data" << std::endl; + return false; + } + return true; + } + + bool readNextBlock(std::fstream& stream) { + if(stream.eof()) { + return false; + } + + if ( !readPBFBlobHeader(stream) ) + return false; + + if ( PBFBlobHeader.type() != "OSMData" ) { + std::cerr << "[error] invalid block type, found" << PBFBlobHeader.type().data() << "instead of OSMData" << std::endl; + return false; + } + + if ( !readBlob(stream) ) + return false; + + char data[charBuffer.size()]; + for(unsigned i = 0; i < charBuffer.size(); i++ ){ + data[i] = charBuffer[i]; + } + if ( !PBFprimitiveBlock.ParseFromArray( data, charBuffer.size() ) ) { + std::cerr << "[error] failed to parse PrimitiveBlock" << std::endl; + return false; + } + return true; + } + + Endianness getMachineEndianness() { + int i(1); + char *p = (char *) &i; + if (p[0] == 1) + return LittleEndian; + return BigEndian; + } + + static const int NANO = 1000 * 1000 * 1000; + static const int MAX_BLOB_HEADER_SIZE = 64 * 1024; + static const int MAX_BLOB_SIZE = 32 * 1024 * 1024; + + OSMPBF::BlobHeader PBFBlobHeader; + OSMPBF::Blob PBFBlob; + + OSMPBF::HeaderBlock PBFHeaderBlock; + OSMPBF::PrimitiveBlock PBFprimitiveBlock; + + std::vector charBuffer; + + int currentGroupID; + int currentEntityID; + // bool m_loadBlock; + // long long m_lastDenseID; + // long long m_lastDenseLatitude; + // long long m_lastDenseLongitude; + // int m_lastDenseTag; + + /* counting the number of read blocks and groups */ + unsigned groupCount; + unsigned blockCount; + + /* Function pointer for nodes */ + bool (*nodeCallback)(_Node); + bool (*wayCallback)(_Way); + bool (*relationCallback)(_Relation); + + /* the input stream to parse */ + std::fstream input; +}; + +#endif /* PBFPARSER_H_ */ diff --git a/DataStructures/XMLParser.h b/DataStructures/XMLParser.h new file mode 100644 index 000000000..15a77526f --- /dev/null +++ b/DataStructures/XMLParser.h @@ -0,0 +1,217 @@ +/* + open source routing machine + Copyright (C) Dennis Luxen, others 2010 + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU AFFERO General Public License as published by +the Free Software Foundation; either version 3 of the License, or +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 Affero General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +or see http://www.gnu.org/licenses/agpl.txt. + */ + +#ifndef XMLPARSER_H_ +#define XMLPARSER_H_ + +#include + +#include "../typedefs.h" +#include "BaseParser.h" +#include "HashTable.h" +#include "ExtractorStructs.h" +#include "InputReaderFactory.h" + +class XMLParser : public BaseParser<_Node, _Relation, _Way> { +public: + XMLParser(const char * filename) { + inputReader = inputReaderFactory(filename); + } + ~XMLParser() {} + + bool RegisterCallbacks(bool (*nodeCallbackPointer)(_Node), bool (*relationCallbackPointer)(_Relation), bool (*wayCallbackPointer)(_Way) ) { + nodeCallback = *nodeCallbackPointer; + wayCallback = *wayCallbackPointer; + relationCallback = *relationCallbackPointer; + return true; + } + bool Init() { + return (xmlTextReaderRead( inputReader ) == 1); + } + bool Parse() { + while ( xmlTextReaderRead( inputReader ) == 1 ) { + const int type = xmlTextReaderNodeType( inputReader ); + + //1 is Element + if ( type != 1 ) + continue; + + xmlChar* currentName = xmlTextReaderName( inputReader ); + if ( currentName == NULL ) + continue; + + if ( xmlStrEqual( currentName, ( const xmlChar* ) "node" ) == 1 ) { + _Node n = _ReadXMLNode( ); + if(!(*nodeCallback)(n)) + std::cerr << "[XMLParser] node not parsed" << std::endl; + } + + if ( xmlStrEqual( currentName, ( const xmlChar* ) "way" ) == 1 ) { + string name; + _Way way = _ReadXMLWay( ); + if(!(*wayCallback)(way)) { + std::cerr << "[XMLParser] way not parsed" << std::endl; + } + } + if ( xmlStrEqual( currentName, ( const xmlChar* ) "relation" ) == 1 ) { + _Relation r; + r.type = _Relation::unknown; + if(!(*relationCallback)(r)) + std::cerr << "[error] relation not parsed" << std::endl; + } + xmlFree( currentName ); + } + return true; + } + +private: + _Relation _ReadXMLRelation ( ) { + _Relation relation; + relation.type = _Relation::unknown; + + return relation; + } + + _Way _ReadXMLWay( ) { + _Way way; + way.direction = _Way::notSure; + way.maximumSpeed = -1; + way.type = -1; + way.useful = false; + way.access = true; + // cout << "new way" << endl; + if ( xmlTextReaderIsEmptyElement( inputReader ) != 1 ) { + const int depth = xmlTextReaderDepth( inputReader ); + while ( xmlTextReaderRead( inputReader ) == 1 ) { + const int childType = xmlTextReaderNodeType( inputReader ); + if ( childType != 1 && childType != 15 ) + continue; + const int childDepth = xmlTextReaderDepth( inputReader ); + xmlChar* childName = xmlTextReaderName( inputReader ); + if ( childName == NULL ) + continue; + + if ( depth == childDepth && childType == 15 && xmlStrEqual( childName, ( const xmlChar* ) "way" ) == 1 ) { + xmlFree( childName ); + break; + } + if ( childType != 1 ) { + xmlFree( childName ); + continue; + } + + if ( xmlStrEqual( childName, ( const xmlChar* ) "tag" ) == 1 ) { + xmlChar* k = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "k" ); + xmlChar* value = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "v" ); + // cout << "->k=" << k << ", v=" << value << endl; + if ( k != NULL && value != NULL ) { + + way.keyVals.Add(std::string( (char *) k ), std::string( (char *) value)); + } + if ( k != NULL ) + xmlFree( k ); + if ( value != NULL ) + xmlFree( value ); + } else if ( xmlStrEqual( childName, ( const xmlChar* ) "nd" ) == 1 ) { + xmlChar* ref = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "ref" ); + if ( ref != NULL ) { + way.path.push_back( atoi(( const char* ) ref ) ); + xmlFree( ref ); + } + } + xmlFree( childName ); + } + } + return way; + } + + + _Node _ReadXMLNode( ) { + _Node node; + + xmlChar* attribute = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "lat" ); + if ( attribute != NULL ) { + node.lat = static_cast(100000.*atof(( const char* ) attribute ) ); + xmlFree( attribute ); + } + attribute = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "lon" ); + if ( attribute != NULL ) { + node.lon = static_cast(100000.*atof(( const char* ) attribute )); + xmlFree( attribute ); + } + attribute = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "id" ); + if ( attribute != NULL ) { + node.id = atoi(( const char* ) attribute ); + xmlFree( attribute ); + } + + if ( xmlTextReaderIsEmptyElement( inputReader ) != 1 ) { + const int depth = xmlTextReaderDepth( inputReader ); + while ( xmlTextReaderRead( inputReader ) == 1 ) { + const int childType = xmlTextReaderNodeType( inputReader ); + // 1 = Element, 15 = EndElement + if ( childType != 1 && childType != 15 ) + continue; + const int childDepth = xmlTextReaderDepth( inputReader ); + xmlChar* childName = xmlTextReaderName( inputReader ); + if ( childName == NULL ) + continue; + + if ( depth == childDepth && childType == 15 && xmlStrEqual( childName, ( const xmlChar* ) "node" ) == 1 ) { + xmlFree( childName ); + break; + } + if ( childType != 1 ) { + xmlFree( childName ); + continue; + } + + if ( xmlStrEqual( childName, ( const xmlChar* ) "tag" ) == 1 ) { + xmlChar* k = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "k" ); + xmlChar* value = xmlTextReaderGetAttribute( inputReader, ( const xmlChar* ) "v" ); + if ( k != NULL && value != NULL ) { + if ( xmlStrEqual( k, ( const xmlChar* ) "highway" ) == 1 ) { + if ( xmlStrEqual( value, ( const xmlChar* ) "traffic_signals" ) == 1 ){ + //node.trafficSignal = true; + } + } + } + if ( k != NULL ) + xmlFree( k ); + if ( value != NULL ) + xmlFree( value ); + } + + xmlFree( childName ); + } + } + return node; + } + /* Input Reader */ + xmlTextReaderPtr inputReader; + + /* Function pointer for nodes */ + bool (*nodeCallback)(_Node); + bool (*wayCallback)(_Way); + bool (*relationCallback)(_Relation); + +}; + +#endif /* XMLPARSER_H_ */ diff --git a/DataStructures/pbf-proto/fileformat.pb.cc b/DataStructures/pbf-proto/fileformat.pb.cc new file mode 100644 index 000000000..f551a5962 --- /dev/null +++ b/DataStructures/pbf-proto/fileformat.pb.cc @@ -0,0 +1,848 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "fileformat.pb.h" +#include +#include +#include +#include +#include +#include +// @@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( + &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( + &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) diff --git a/DataStructures/pbf-proto/fileformat.pb.h b/DataStructures/pbf-proto/fileformat.pb.h new file mode 100644 index 000000000..9e4beef78 --- /dev/null +++ b/DataStructures/pbf-proto/fileformat.pb.h @@ -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 + +#include + +#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 +#include +#include +#include +// @@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(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(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(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(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(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(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 diff --git a/DataStructures/pbf-proto/fileformat.proto b/DataStructures/pbf-proto/fileformat.proto new file mode 100644 index 000000000..2322ce098 --- /dev/null +++ b/DataStructures/pbf-proto/fileformat.proto @@ -0,0 +1,53 @@ +/** Copyright (c) 2010 Scott A. Crosby. + + 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 . + +*/ + +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; +} + + diff --git a/DataStructures/pbf-proto/osmformat.pb.cc b/DataStructures/pbf-proto/osmformat.pb.cc new file mode 100644 index 000000000..76e3bb5fc --- /dev/null +++ b/DataStructures/pbf-proto/osmformat.pb.cc @@ -0,0 +1,5239 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include "osmformat.pb.h" +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace OSMPBF { + +namespace { + +const ::google::protobuf::Descriptor* HeaderBlock_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + HeaderBlock_reflection_ = NULL; +const ::google::protobuf::Descriptor* HeaderBBox_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + HeaderBBox_reflection_ = NULL; +const ::google::protobuf::Descriptor* PrimitiveBlock_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PrimitiveBlock_reflection_ = NULL; +const ::google::protobuf::Descriptor* PrimitiveGroup_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + PrimitiveGroup_reflection_ = NULL; +const ::google::protobuf::Descriptor* StringTable_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + StringTable_reflection_ = NULL; +const ::google::protobuf::Descriptor* Info_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Info_reflection_ = NULL; +const ::google::protobuf::Descriptor* DenseInfo_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DenseInfo_reflection_ = NULL; +const ::google::protobuf::Descriptor* ChangeSet_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ChangeSet_reflection_ = NULL; +const ::google::protobuf::Descriptor* Node_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Node_reflection_ = NULL; +const ::google::protobuf::Descriptor* DenseNodes_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DenseNodes_reflection_ = NULL; +const ::google::protobuf::Descriptor* Way_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Way_reflection_ = NULL; +const ::google::protobuf::Descriptor* Relation_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + Relation_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* Relation_MemberType_descriptor_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_osmformat_2eproto() { + protobuf_AddDesc_osmformat_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "osmformat.proto"); + GOOGLE_CHECK(file != NULL); + HeaderBlock_descriptor_ = file->message_type(0); + static const int HeaderBlock_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBlock, bbox_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBlock, required_features_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBlock, optional_features_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBlock, writingprogram_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBlock, source_), + }; + HeaderBlock_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + HeaderBlock_descriptor_, + HeaderBlock::default_instance_, + HeaderBlock_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBlock, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBlock, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(HeaderBlock)); + HeaderBBox_descriptor_ = file->message_type(1); + static const int HeaderBBox_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBBox, left_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBBox, right_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBBox, top_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBBox, bottom_), + }; + HeaderBBox_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + HeaderBBox_descriptor_, + HeaderBBox::default_instance_, + HeaderBBox_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBBox, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(HeaderBBox, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(HeaderBBox)); + PrimitiveBlock_descriptor_ = file->message_type(2); + static const int PrimitiveBlock_offsets_[6] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveBlock, stringtable_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveBlock, primitivegroup_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveBlock, granularity_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveBlock, lat_offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveBlock, lon_offset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveBlock, date_granularity_), + }; + PrimitiveBlock_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + PrimitiveBlock_descriptor_, + PrimitiveBlock::default_instance_, + PrimitiveBlock_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveBlock, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveBlock, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(PrimitiveBlock)); + PrimitiveGroup_descriptor_ = file->message_type(3); + static const int PrimitiveGroup_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveGroup, nodes_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveGroup, dense_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveGroup, ways_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveGroup, relations_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveGroup, changesets_), + }; + PrimitiveGroup_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + PrimitiveGroup_descriptor_, + PrimitiveGroup::default_instance_, + PrimitiveGroup_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveGroup, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(PrimitiveGroup, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(PrimitiveGroup)); + StringTable_descriptor_ = file->message_type(4); + static const int StringTable_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringTable, s_), + }; + StringTable_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + StringTable_descriptor_, + StringTable::default_instance_, + StringTable_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringTable, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(StringTable, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(StringTable)); + Info_descriptor_ = file->message_type(5); + static const int Info_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Info, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Info, timestamp_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Info, changeset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Info, uid_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Info, user_sid_), + }; + Info_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Info_descriptor_, + Info::default_instance_, + Info_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Info, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Info, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Info)); + DenseInfo_descriptor_ = file->message_type(6); + static const int DenseInfo_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseInfo, version_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseInfo, timestamp_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseInfo, changeset_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseInfo, uid_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseInfo, user_sid_), + }; + DenseInfo_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DenseInfo_descriptor_, + DenseInfo::default_instance_, + DenseInfo_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseInfo, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseInfo, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(DenseInfo)); + ChangeSet_descriptor_ = file->message_type(7); + static const int ChangeSet_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ChangeSet, id_), + }; + ChangeSet_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ChangeSet_descriptor_, + ChangeSet::default_instance_, + ChangeSet_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ChangeSet, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ChangeSet, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(ChangeSet)); + Node_descriptor_ = file->message_type(8); + static const int Node_offsets_[6] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, keys_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, vals_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, lat_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, lon_), + }; + Node_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Node_descriptor_, + Node::default_instance_, + Node_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Node, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Node)); + DenseNodes_descriptor_ = file->message_type(9); + static const int DenseNodes_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseNodes, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseNodes, denseinfo_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseNodes, lat_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseNodes, lon_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseNodes, keys_vals_), + }; + DenseNodes_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DenseNodes_descriptor_, + DenseNodes::default_instance_, + DenseNodes_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseNodes, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DenseNodes, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(DenseNodes)); + Way_descriptor_ = file->message_type(10); + static const int Way_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Way, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Way, keys_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Way, vals_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Way, info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Way, refs_), + }; + Way_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Way_descriptor_, + Way::default_instance_, + Way_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Way, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Way, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Way)); + Relation_descriptor_ = file->message_type(11); + static const int Relation_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Relation, id_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Relation, keys_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Relation, vals_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Relation, info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Relation, roles_sid_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Relation, memids_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Relation, types_), + }; + Relation_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + Relation_descriptor_, + Relation::default_instance_, + Relation_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Relation, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Relation, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool(), + ::google::protobuf::MessageFactory::generated_factory(), + sizeof(Relation)); + Relation_MemberType_descriptor_ = Relation_descriptor_->enum_type(0); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +inline void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_osmformat_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HeaderBlock_descriptor_, &HeaderBlock::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + HeaderBBox_descriptor_, &HeaderBBox::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PrimitiveBlock_descriptor_, &PrimitiveBlock::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + PrimitiveGroup_descriptor_, &PrimitiveGroup::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + StringTable_descriptor_, &StringTable::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Info_descriptor_, &Info::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DenseInfo_descriptor_, &DenseInfo::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ChangeSet_descriptor_, &ChangeSet::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Node_descriptor_, &Node::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DenseNodes_descriptor_, &DenseNodes::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Way_descriptor_, &Way::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + Relation_descriptor_, &Relation::default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_osmformat_2eproto() { + delete HeaderBlock::default_instance_; + delete HeaderBlock_reflection_; + delete HeaderBBox::default_instance_; + delete HeaderBBox_reflection_; + delete PrimitiveBlock::default_instance_; + delete PrimitiveBlock_reflection_; + delete PrimitiveGroup::default_instance_; + delete PrimitiveGroup_reflection_; + delete StringTable::default_instance_; + delete StringTable_reflection_; + delete Info::default_instance_; + delete Info_reflection_; + delete DenseInfo::default_instance_; + delete DenseInfo_reflection_; + delete ChangeSet::default_instance_; + delete ChangeSet_reflection_; + delete Node::default_instance_; + delete Node_reflection_; + delete DenseNodes::default_instance_; + delete DenseNodes_reflection_; + delete Way::default_instance_; + delete Way_reflection_; + delete Relation::default_instance_; + delete Relation_reflection_; +} + +void protobuf_AddDesc_osmformat_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n\017osmformat.proto\022\006OSMPBF\"\215\001\n\013HeaderBloc" + "k\022 \n\004bbox\030\001 \001(\0132\022.OSMPBF.HeaderBBox\022\031\n\021r" + "equired_features\030\004 \003(\t\022\031\n\021optional_featu" + "res\030\005 \003(\t\022\026\n\016writingprogram\030\020 \001(\t\022\016\n\006sou" + "rce\030\021 \001(\t\"F\n\nHeaderBBox\022\014\n\004left\030\001 \002(\022\022\r\n" + "\005right\030\002 \002(\022\022\013\n\003top\030\003 \002(\022\022\016\n\006bottom\030\004 \002(" + "\022\"\322\001\n\016PrimitiveBlock\022(\n\013stringtable\030\001 \002(" + "\0132\023.OSMPBF.StringTable\022.\n\016primitivegroup" + "\030\002 \003(\0132\026.OSMPBF.PrimitiveGroup\022\030\n\013granul" + "arity\030\021 \001(\005:\003100\022\025\n\nlat_offset\030\023 \001(\003:\0010\022" + "\025\n\nlon_offset\030\024 \001(\003:\0010\022\036\n\020date_granulari" + "ty\030\022 \001(\005:\0041000\"\267\001\n\016PrimitiveGroup\022\033\n\005nod" + "es\030\001 \003(\0132\014.OSMPBF.Node\022!\n\005dense\030\002 \001(\0132\022." + "OSMPBF.DenseNodes\022\031\n\004ways\030\003 \003(\0132\013.OSMPBF" + ".Way\022#\n\trelations\030\004 \003(\0132\020.OSMPBF.Relatio" + "n\022%\n\nchangesets\030\005 \003(\0132\021.OSMPBF.ChangeSet" + "\"\030\n\013StringTable\022\t\n\001s\030\001 \003(\014\"`\n\004Info\022\023\n\007ve" + "rsion\030\001 \001(\005:\002-1\022\021\n\ttimestamp\030\002 \001(\003\022\021\n\tch" + "angeset\030\003 \001(\003\022\013\n\003uid\030\004 \001(\005\022\020\n\010user_sid\030\005" + " \001(\r\"u\n\tDenseInfo\022\023\n\007version\030\001 \003(\005B\002\020\001\022\025" + "\n\ttimestamp\030\002 \003(\022B\002\020\001\022\025\n\tchangeset\030\003 \003(\022" + "B\002\020\001\022\017\n\003uid\030\004 \003(\021B\002\020\001\022\024\n\010user_sid\030\005 \003(\021B" + "\002\020\001\"\027\n\tChangeSet\022\n\n\002id\030\001 \002(\003\"l\n\004Node\022\n\n\002" + "id\030\001 \002(\022\022\020\n\004keys\030\002 \003(\rB\002\020\001\022\020\n\004vals\030\003 \003(\r" + "B\002\020\001\022\032\n\004info\030\004 \001(\0132\014.OSMPBF.Info\022\013\n\003lat\030" + "\010 \002(\022\022\013\n\003lon\030\t \002(\022\"{\n\nDenseNodes\022\016\n\002id\030\001" + " \003(\022B\002\020\001\022$\n\tdenseinfo\030\005 \001(\0132\021.OSMPBF.Den" + "seInfo\022\017\n\003lat\030\010 \003(\022B\002\020\001\022\017\n\003lon\030\t \003(\022B\002\020\001" + "\022\025\n\tkeys_vals\030\n \003(\005B\002\020\001\"c\n\003Way\022\n\n\002id\030\001 \002" + "(\003\022\020\n\004keys\030\002 \003(\rB\002\020\001\022\020\n\004vals\030\003 \003(\rB\002\020\001\022\032" + "\n\004info\030\004 \001(\0132\014.OSMPBF.Info\022\020\n\004refs\030\010 \003(\022" + "B\002\020\001\"\340\001\n\010Relation\022\n\n\002id\030\001 \002(\003\022\020\n\004keys\030\002 " + "\003(\rB\002\020\001\022\020\n\004vals\030\003 \003(\rB\002\020\001\022\032\n\004info\030\004 \001(\0132" + "\014.OSMPBF.Info\022\025\n\troles_sid\030\010 \003(\005B\002\020\001\022\022\n\006" + "memids\030\t \003(\022B\002\020\001\022.\n\005types\030\n \003(\0162\033.OSMPBF" + ".Relation.MemberTypeB\002\020\001\"-\n\nMemberType\022\010" + "\n\004NODE\020\000\022\007\n\003WAY\020\001\022\014\n\010RELATION\020\002B\017\n\rcrosb" + "y.binary", 1488); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "osmformat.proto", &protobuf_RegisterTypes); + HeaderBlock::default_instance_ = new HeaderBlock(); + HeaderBBox::default_instance_ = new HeaderBBox(); + PrimitiveBlock::default_instance_ = new PrimitiveBlock(); + PrimitiveGroup::default_instance_ = new PrimitiveGroup(); + StringTable::default_instance_ = new StringTable(); + Info::default_instance_ = new Info(); + DenseInfo::default_instance_ = new DenseInfo(); + ChangeSet::default_instance_ = new ChangeSet(); + Node::default_instance_ = new Node(); + DenseNodes::default_instance_ = new DenseNodes(); + Way::default_instance_ = new Way(); + Relation::default_instance_ = new Relation(); + HeaderBlock::default_instance_->InitAsDefaultInstance(); + HeaderBBox::default_instance_->InitAsDefaultInstance(); + PrimitiveBlock::default_instance_->InitAsDefaultInstance(); + PrimitiveGroup::default_instance_->InitAsDefaultInstance(); + StringTable::default_instance_->InitAsDefaultInstance(); + Info::default_instance_->InitAsDefaultInstance(); + DenseInfo::default_instance_->InitAsDefaultInstance(); + ChangeSet::default_instance_->InitAsDefaultInstance(); + Node::default_instance_->InitAsDefaultInstance(); + DenseNodes::default_instance_->InitAsDefaultInstance(); + Way::default_instance_->InitAsDefaultInstance(); + Relation::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_osmformat_2eproto); +} + +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_osmformat_2eproto { + StaticDescriptorInitializer_osmformat_2eproto() { + protobuf_AddDesc_osmformat_2eproto(); + } +} static_descriptor_initializer_osmformat_2eproto_; + + +// =================================================================== + +const ::std::string HeaderBlock::_default_writingprogram_; +const ::std::string HeaderBlock::_default_source_; +#ifndef _MSC_VER +const int HeaderBlock::kBboxFieldNumber; +const int HeaderBlock::kRequiredFeaturesFieldNumber; +const int HeaderBlock::kOptionalFeaturesFieldNumber; +const int HeaderBlock::kWritingprogramFieldNumber; +const int HeaderBlock::kSourceFieldNumber; +#endif // !_MSC_VER + +HeaderBlock::HeaderBlock() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void HeaderBlock::InitAsDefaultInstance() { + bbox_ = const_cast< ::OSMPBF::HeaderBBox*>(&::OSMPBF::HeaderBBox::default_instance()); +} + +HeaderBlock::HeaderBlock(const HeaderBlock& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void HeaderBlock::SharedCtor() { + _cached_size_ = 0; + bbox_ = NULL; + writingprogram_ = const_cast< ::std::string*>(&_default_writingprogram_); + source_ = const_cast< ::std::string*>(&_default_source_); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HeaderBlock::~HeaderBlock() { + SharedDtor(); +} + +void HeaderBlock::SharedDtor() { + if (writingprogram_ != &_default_writingprogram_) { + delete writingprogram_; + } + if (source_ != &_default_source_) { + delete source_; + } + if (this != default_instance_) { + delete bbox_; + } +} + +void HeaderBlock::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* HeaderBlock::descriptor() { + protobuf_AssignDescriptorsOnce(); + return HeaderBlock_descriptor_; +} + +const HeaderBlock& HeaderBlock::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +HeaderBlock* HeaderBlock::default_instance_ = NULL; + +HeaderBlock* HeaderBlock::New() const { + return new HeaderBlock; +} + +void HeaderBlock::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bit(0)) { + if (bbox_ != NULL) bbox_->::OSMPBF::HeaderBBox::Clear(); + } + if (_has_bit(3)) { + if (writingprogram_ != &_default_writingprogram_) { + writingprogram_->clear(); + } + } + if (_has_bit(4)) { + if (source_ != &_default_source_) { + source_->clear(); + } + } + } + required_features_.Clear(); + optional_features_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool HeaderBlock::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 .OSMPBF.HeaderBBox bbox = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_bbox())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_required_features; + break; + } + + // repeated string required_features = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_required_features: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_required_features())); + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->required_features(0).data(), this->required_features(0).length(), + ::google::protobuf::internal::WireFormat::PARSE); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_required_features; + if (input->ExpectTag(42)) goto parse_optional_features; + break; + } + + // repeated string optional_features = 5; + case 5: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_optional_features: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_optional_features())); + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->optional_features(0).data(), this->optional_features(0).length(), + ::google::protobuf::internal::WireFormat::PARSE); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(42)) goto parse_optional_features; + if (input->ExpectTag(130)) goto parse_writingprogram; + break; + } + + // optional string writingprogram = 16; + case 16: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_writingprogram: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_writingprogram())); + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->writingprogram().data(), this->writingprogram().length(), + ::google::protobuf::internal::WireFormat::PARSE); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(138)) goto parse_source; + break; + } + + // optional string source = 17; + case 17: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_source: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_source())); + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::PARSE); + } 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 HeaderBlock::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // optional .OSMPBF.HeaderBBox bbox = 1; + if (_has_bit(0)) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->bbox(), output); + } + + // repeated string required_features = 4; + for (int i = 0; i < this->required_features_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->required_features(i).data(), this->required_features(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormatLite::WriteString( + 4, this->required_features(i), output); + } + + // repeated string optional_features = 5; + for (int i = 0; i < this->optional_features_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->optional_features(i).data(), this->optional_features(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormatLite::WriteString( + 5, this->optional_features(i), output); + } + + // optional string writingprogram = 16; + if (_has_bit(3)) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->writingprogram().data(), this->writingprogram().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormatLite::WriteString( + 16, this->writingprogram(), output); + } + + // optional string source = 17; + if (_has_bit(4)) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + ::google::protobuf::internal::WireFormatLite::WriteString( + 17, this->source(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* HeaderBlock::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // optional .OSMPBF.HeaderBBox bbox = 1; + if (_has_bit(0)) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->bbox(), target); + } + + // repeated string required_features = 4; + for (int i = 0; i < this->required_features_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->required_features(i).data(), this->required_features(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(4, this->required_features(i), target); + } + + // repeated string optional_features = 5; + for (int i = 0; i < this->optional_features_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->optional_features(i).data(), this->optional_features(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(5, this->optional_features(i), target); + } + + // optional string writingprogram = 16; + if (_has_bit(3)) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->writingprogram().data(), this->writingprogram().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 16, this->writingprogram(), target); + } + + // optional string source = 17; + if (_has_bit(4)) { + ::google::protobuf::internal::WireFormat::VerifyUTF8String( + this->source().data(), this->source().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 17, this->source(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int HeaderBlock::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional .OSMPBF.HeaderBBox bbox = 1; + if (has_bbox()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->bbox()); + } + + // optional string writingprogram = 16; + if (has_writingprogram()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->writingprogram()); + } + + // optional string source = 17; + if (has_source()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source()); + } + + } + // repeated string required_features = 4; + total_size += 1 * this->required_features_size(); + for (int i = 0; i < this->required_features_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->required_features(i)); + } + + // repeated string optional_features = 5; + total_size += 1 * this->optional_features_size(); + for (int i = 0; i < this->optional_features_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->optional_features(i)); + } + + 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 HeaderBlock::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const HeaderBlock* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void HeaderBlock::MergeFrom(const HeaderBlock& from) { + GOOGLE_CHECK_NE(&from, this); + required_features_.MergeFrom(from.required_features_); + optional_features_.MergeFrom(from.optional_features_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from._has_bit(0)) { + mutable_bbox()->::OSMPBF::HeaderBBox::MergeFrom(from.bbox()); + } + if (from._has_bit(3)) { + set_writingprogram(from.writingprogram()); + } + if (from._has_bit(4)) { + set_source(from.source()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void HeaderBlock::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HeaderBlock::CopyFrom(const HeaderBlock& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HeaderBlock::IsInitialized() const { + + if (has_bbox()) { + if (!this->bbox().IsInitialized()) return false; + } + return true; +} + +void HeaderBlock::Swap(HeaderBlock* other) { + if (other != this) { + std::swap(bbox_, other->bbox_); + required_features_.Swap(&other->required_features_); + optional_features_.Swap(&other->optional_features_); + std::swap(writingprogram_, other->writingprogram_); + std::swap(source_, other->source_); + 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 HeaderBlock::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = HeaderBlock_descriptor_; + metadata.reflection = HeaderBlock_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int HeaderBBox::kLeftFieldNumber; +const int HeaderBBox::kRightFieldNumber; +const int HeaderBBox::kTopFieldNumber; +const int HeaderBBox::kBottomFieldNumber; +#endif // !_MSC_VER + +HeaderBBox::HeaderBBox() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void HeaderBBox::InitAsDefaultInstance() { +} + +HeaderBBox::HeaderBBox(const HeaderBBox& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void HeaderBBox::SharedCtor() { + _cached_size_ = 0; + left_ = GOOGLE_LONGLONG(0); + right_ = GOOGLE_LONGLONG(0); + top_ = GOOGLE_LONGLONG(0); + bottom_ = GOOGLE_LONGLONG(0); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +HeaderBBox::~HeaderBBox() { + SharedDtor(); +} + +void HeaderBBox::SharedDtor() { + if (this != default_instance_) { + } +} + +void HeaderBBox::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* HeaderBBox::descriptor() { + protobuf_AssignDescriptorsOnce(); + return HeaderBBox_descriptor_; +} + +const HeaderBBox& HeaderBBox::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +HeaderBBox* HeaderBBox::default_instance_ = NULL; + +HeaderBBox* HeaderBBox::New() const { + return new HeaderBBox; +} + +void HeaderBBox::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + left_ = GOOGLE_LONGLONG(0); + right_ = GOOGLE_LONGLONG(0); + top_ = GOOGLE_LONGLONG(0); + bottom_ = GOOGLE_LONGLONG(0); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool HeaderBBox::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 sint64 left = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, &left_))); + _set_bit(0); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(16)) goto parse_right; + break; + } + + // required sint64 right = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_right: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, &right_))); + _set_bit(1); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(24)) goto parse_top; + break; + } + + // required sint64 top = 3; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_top: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, &top_))); + _set_bit(2); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(32)) goto parse_bottom; + break; + } + + // required sint64 bottom = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_bottom: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, &bottom_))); + _set_bit(3); + } 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 HeaderBBox::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required sint64 left = 1; + if (_has_bit(0)) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64(1, this->left(), output); + } + + // required sint64 right = 2; + if (_has_bit(1)) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64(2, this->right(), output); + } + + // required sint64 top = 3; + if (_has_bit(2)) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64(3, this->top(), output); + } + + // required sint64 bottom = 4; + if (_has_bit(3)) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64(4, this->bottom(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* HeaderBBox::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required sint64 left = 1; + if (_has_bit(0)) { + target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(1, this->left(), target); + } + + // required sint64 right = 2; + if (_has_bit(1)) { + target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(2, this->right(), target); + } + + // required sint64 top = 3; + if (_has_bit(2)) { + target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(3, this->top(), target); + } + + // required sint64 bottom = 4; + if (_has_bit(3)) { + target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(4, this->bottom(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int HeaderBBox::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required sint64 left = 1; + if (has_left()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::SInt64Size( + this->left()); + } + + // required sint64 right = 2; + if (has_right()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::SInt64Size( + this->right()); + } + + // required sint64 top = 3; + if (has_top()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::SInt64Size( + this->top()); + } + + // required sint64 bottom = 4; + if (has_bottom()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::SInt64Size( + this->bottom()); + } + + } + 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 HeaderBBox::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const HeaderBBox* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void HeaderBBox::MergeFrom(const HeaderBBox& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from._has_bit(0)) { + set_left(from.left()); + } + if (from._has_bit(1)) { + set_right(from.right()); + } + if (from._has_bit(2)) { + set_top(from.top()); + } + if (from._has_bit(3)) { + set_bottom(from.bottom()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void HeaderBBox::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void HeaderBBox::CopyFrom(const HeaderBBox& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool HeaderBBox::IsInitialized() const { + if ((_has_bits_[0] & 0x0000000f) != 0x0000000f) return false; + + return true; +} + +void HeaderBBox::Swap(HeaderBBox* other) { + if (other != this) { + std::swap(left_, other->left_); + std::swap(right_, other->right_); + std::swap(top_, other->top_); + std::swap(bottom_, other->bottom_); + 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 HeaderBBox::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = HeaderBBox_descriptor_; + metadata.reflection = HeaderBBox_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int PrimitiveBlock::kStringtableFieldNumber; +const int PrimitiveBlock::kPrimitivegroupFieldNumber; +const int PrimitiveBlock::kGranularityFieldNumber; +const int PrimitiveBlock::kLatOffsetFieldNumber; +const int PrimitiveBlock::kLonOffsetFieldNumber; +const int PrimitiveBlock::kDateGranularityFieldNumber; +#endif // !_MSC_VER + +PrimitiveBlock::PrimitiveBlock() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void PrimitiveBlock::InitAsDefaultInstance() { + stringtable_ = const_cast< ::OSMPBF::StringTable*>(&::OSMPBF::StringTable::default_instance()); +} + +PrimitiveBlock::PrimitiveBlock(const PrimitiveBlock& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void PrimitiveBlock::SharedCtor() { + _cached_size_ = 0; + stringtable_ = NULL; + granularity_ = 100; + lat_offset_ = GOOGLE_LONGLONG(0); + lon_offset_ = GOOGLE_LONGLONG(0); + date_granularity_ = 1000; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PrimitiveBlock::~PrimitiveBlock() { + SharedDtor(); +} + +void PrimitiveBlock::SharedDtor() { + if (this != default_instance_) { + delete stringtable_; + } +} + +void PrimitiveBlock::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PrimitiveBlock::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PrimitiveBlock_descriptor_; +} + +const PrimitiveBlock& PrimitiveBlock::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +PrimitiveBlock* PrimitiveBlock::default_instance_ = NULL; + +PrimitiveBlock* PrimitiveBlock::New() const { + return new PrimitiveBlock; +} + +void PrimitiveBlock::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (_has_bit(0)) { + if (stringtable_ != NULL) stringtable_->::OSMPBF::StringTable::Clear(); + } + granularity_ = 100; + lat_offset_ = GOOGLE_LONGLONG(0); + lon_offset_ = GOOGLE_LONGLONG(0); + date_granularity_ = 1000; + } + primitivegroup_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool PrimitiveBlock::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 .OSMPBF.StringTable stringtable = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_stringtable())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_primitivegroup; + break; + } + + // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_primitivegroup: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_primitivegroup())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_primitivegroup; + if (input->ExpectTag(136)) goto parse_granularity; + break; + } + + // optional int32 granularity = 17 [default = 100]; + case 17: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_granularity: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &granularity_))); + _set_bit(2); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(144)) goto parse_date_granularity; + break; + } + + // optional int32 date_granularity = 18 [default = 1000]; + case 18: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_date_granularity: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &date_granularity_))); + _set_bit(5); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(152)) goto parse_lat_offset; + break; + } + + // optional int64 lat_offset = 19 [default = 0]; + case 19: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_lat_offset: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &lat_offset_))); + _set_bit(3); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(160)) goto parse_lon_offset; + break; + } + + // optional int64 lon_offset = 20 [default = 0]; + case 20: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_lon_offset: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &lon_offset_))); + _set_bit(4); + } 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 PrimitiveBlock::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required .OSMPBF.StringTable stringtable = 1; + if (_has_bit(0)) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->stringtable(), output); + } + + // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2; + for (int i = 0; i < this->primitivegroup_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->primitivegroup(i), output); + } + + // optional int32 granularity = 17 [default = 100]; + if (_has_bit(2)) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(17, this->granularity(), output); + } + + // optional int32 date_granularity = 18 [default = 1000]; + if (_has_bit(5)) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(18, this->date_granularity(), output); + } + + // optional int64 lat_offset = 19 [default = 0]; + if (_has_bit(3)) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(19, this->lat_offset(), output); + } + + // optional int64 lon_offset = 20 [default = 0]; + if (_has_bit(4)) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(20, this->lon_offset(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* PrimitiveBlock::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required .OSMPBF.StringTable stringtable = 1; + if (_has_bit(0)) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->stringtable(), target); + } + + // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2; + for (int i = 0; i < this->primitivegroup_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->primitivegroup(i), target); + } + + // optional int32 granularity = 17 [default = 100]; + if (_has_bit(2)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(17, this->granularity(), target); + } + + // optional int32 date_granularity = 18 [default = 1000]; + if (_has_bit(5)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(18, this->date_granularity(), target); + } + + // optional int64 lat_offset = 19 [default = 0]; + if (_has_bit(3)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(19, this->lat_offset(), target); + } + + // optional int64 lon_offset = 20 [default = 0]; + if (_has_bit(4)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(20, this->lon_offset(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int PrimitiveBlock::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required .OSMPBF.StringTable stringtable = 1; + if (has_stringtable()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->stringtable()); + } + + // optional int32 granularity = 17 [default = 100]; + if (has_granularity()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->granularity()); + } + + // optional int64 lat_offset = 19 [default = 0]; + if (has_lat_offset()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->lat_offset()); + } + + // optional int64 lon_offset = 20 [default = 0]; + if (has_lon_offset()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->lon_offset()); + } + + // optional int32 date_granularity = 18 [default = 1000]; + if (has_date_granularity()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->date_granularity()); + } + + } + // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2; + total_size += 1 * this->primitivegroup_size(); + for (int i = 0; i < this->primitivegroup_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->primitivegroup(i)); + } + + 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 PrimitiveBlock::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const PrimitiveBlock* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void PrimitiveBlock::MergeFrom(const PrimitiveBlock& from) { + GOOGLE_CHECK_NE(&from, this); + primitivegroup_.MergeFrom(from.primitivegroup_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from._has_bit(0)) { + mutable_stringtable()->::OSMPBF::StringTable::MergeFrom(from.stringtable()); + } + if (from._has_bit(2)) { + set_granularity(from.granularity()); + } + if (from._has_bit(3)) { + set_lat_offset(from.lat_offset()); + } + if (from._has_bit(4)) { + set_lon_offset(from.lon_offset()); + } + if (from._has_bit(5)) { + set_date_granularity(from.date_granularity()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void PrimitiveBlock::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PrimitiveBlock::CopyFrom(const PrimitiveBlock& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PrimitiveBlock::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + for (int i = 0; i < primitivegroup_size(); i++) { + if (!this->primitivegroup(i).IsInitialized()) return false; + } + return true; +} + +void PrimitiveBlock::Swap(PrimitiveBlock* other) { + if (other != this) { + std::swap(stringtable_, other->stringtable_); + primitivegroup_.Swap(&other->primitivegroup_); + std::swap(granularity_, other->granularity_); + std::swap(lat_offset_, other->lat_offset_); + std::swap(lon_offset_, other->lon_offset_); + std::swap(date_granularity_, other->date_granularity_); + 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 PrimitiveBlock::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PrimitiveBlock_descriptor_; + metadata.reflection = PrimitiveBlock_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int PrimitiveGroup::kNodesFieldNumber; +const int PrimitiveGroup::kDenseFieldNumber; +const int PrimitiveGroup::kWaysFieldNumber; +const int PrimitiveGroup::kRelationsFieldNumber; +const int PrimitiveGroup::kChangesetsFieldNumber; +#endif // !_MSC_VER + +PrimitiveGroup::PrimitiveGroup() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void PrimitiveGroup::InitAsDefaultInstance() { + dense_ = const_cast< ::OSMPBF::DenseNodes*>(&::OSMPBF::DenseNodes::default_instance()); +} + +PrimitiveGroup::PrimitiveGroup(const PrimitiveGroup& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void PrimitiveGroup::SharedCtor() { + _cached_size_ = 0; + dense_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +PrimitiveGroup::~PrimitiveGroup() { + SharedDtor(); +} + +void PrimitiveGroup::SharedDtor() { + if (this != default_instance_) { + delete dense_; + } +} + +void PrimitiveGroup::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* PrimitiveGroup::descriptor() { + protobuf_AssignDescriptorsOnce(); + return PrimitiveGroup_descriptor_; +} + +const PrimitiveGroup& PrimitiveGroup::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +PrimitiveGroup* PrimitiveGroup::default_instance_ = NULL; + +PrimitiveGroup* PrimitiveGroup::New() const { + return new PrimitiveGroup; +} + +void PrimitiveGroup::Clear() { + if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { + if (_has_bit(1)) { + if (dense_ != NULL) dense_->::OSMPBF::DenseNodes::Clear(); + } + } + nodes_.Clear(); + ways_.Clear(); + relations_.Clear(); + changesets_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool PrimitiveGroup::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)) { + // repeated .OSMPBF.Node nodes = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_nodes: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_nodes())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(10)) goto parse_nodes; + if (input->ExpectTag(18)) goto parse_dense; + break; + } + + // optional .OSMPBF.DenseNodes dense = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_dense: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_dense())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(26)) goto parse_ways; + break; + } + + // repeated .OSMPBF.Way ways = 3; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_ways: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_ways())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(26)) goto parse_ways; + if (input->ExpectTag(34)) goto parse_relations; + break; + } + + // repeated .OSMPBF.Relation relations = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_relations: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_relations())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_relations; + if (input->ExpectTag(42)) goto parse_changesets; + break; + } + + // repeated .OSMPBF.ChangeSet changesets = 5; + case 5: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_changesets: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, add_changesets())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(42)) goto parse_changesets; + 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 PrimitiveGroup::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // repeated .OSMPBF.Node nodes = 1; + for (int i = 0; i < this->nodes_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->nodes(i), output); + } + + // optional .OSMPBF.DenseNodes dense = 2; + if (_has_bit(1)) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->dense(), output); + } + + // repeated .OSMPBF.Way ways = 3; + for (int i = 0; i < this->ways_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->ways(i), output); + } + + // repeated .OSMPBF.Relation relations = 4; + for (int i = 0; i < this->relations_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->relations(i), output); + } + + // repeated .OSMPBF.ChangeSet changesets = 5; + for (int i = 0; i < this->changesets_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->changesets(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* PrimitiveGroup::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // repeated .OSMPBF.Node nodes = 1; + for (int i = 0; i < this->nodes_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->nodes(i), target); + } + + // optional .OSMPBF.DenseNodes dense = 2; + if (_has_bit(1)) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->dense(), target); + } + + // repeated .OSMPBF.Way ways = 3; + for (int i = 0; i < this->ways_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->ways(i), target); + } + + // repeated .OSMPBF.Relation relations = 4; + for (int i = 0; i < this->relations_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->relations(i), target); + } + + // repeated .OSMPBF.ChangeSet changesets = 5; + for (int i = 0; i < this->changesets_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->changesets(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int PrimitiveGroup::ByteSize() const { + int total_size = 0; + + if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { + // optional .OSMPBF.DenseNodes dense = 2; + if (has_dense()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->dense()); + } + + } + // repeated .OSMPBF.Node nodes = 1; + total_size += 1 * this->nodes_size(); + for (int i = 0; i < this->nodes_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->nodes(i)); + } + + // repeated .OSMPBF.Way ways = 3; + total_size += 1 * this->ways_size(); + for (int i = 0; i < this->ways_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->ways(i)); + } + + // repeated .OSMPBF.Relation relations = 4; + total_size += 1 * this->relations_size(); + for (int i = 0; i < this->relations_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->relations(i)); + } + + // repeated .OSMPBF.ChangeSet changesets = 5; + total_size += 1 * this->changesets_size(); + for (int i = 0; i < this->changesets_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->changesets(i)); + } + + 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 PrimitiveGroup::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const PrimitiveGroup* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void PrimitiveGroup::MergeFrom(const PrimitiveGroup& from) { + GOOGLE_CHECK_NE(&from, this); + nodes_.MergeFrom(from.nodes_); + ways_.MergeFrom(from.ways_); + relations_.MergeFrom(from.relations_); + changesets_.MergeFrom(from.changesets_); + if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { + if (from._has_bit(1)) { + mutable_dense()->::OSMPBF::DenseNodes::MergeFrom(from.dense()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void PrimitiveGroup::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PrimitiveGroup::CopyFrom(const PrimitiveGroup& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PrimitiveGroup::IsInitialized() const { + + for (int i = 0; i < nodes_size(); i++) { + if (!this->nodes(i).IsInitialized()) return false; + } + for (int i = 0; i < ways_size(); i++) { + if (!this->ways(i).IsInitialized()) return false; + } + for (int i = 0; i < relations_size(); i++) { + if (!this->relations(i).IsInitialized()) return false; + } + for (int i = 0; i < changesets_size(); i++) { + if (!this->changesets(i).IsInitialized()) return false; + } + return true; +} + +void PrimitiveGroup::Swap(PrimitiveGroup* other) { + if (other != this) { + nodes_.Swap(&other->nodes_); + std::swap(dense_, other->dense_); + ways_.Swap(&other->ways_); + relations_.Swap(&other->relations_); + changesets_.Swap(&other->changesets_); + 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 PrimitiveGroup::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = PrimitiveGroup_descriptor_; + metadata.reflection = PrimitiveGroup_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int StringTable::kSFieldNumber; +#endif // !_MSC_VER + +StringTable::StringTable() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void StringTable::InitAsDefaultInstance() { +} + +StringTable::StringTable(const StringTable& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void StringTable::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +StringTable::~StringTable() { + SharedDtor(); +} + +void StringTable::SharedDtor() { + if (this != default_instance_) { + } +} + +void StringTable::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* StringTable::descriptor() { + protobuf_AssignDescriptorsOnce(); + return StringTable_descriptor_; +} + +const StringTable& StringTable::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +StringTable* StringTable::default_instance_ = NULL; + +StringTable* StringTable::New() const { + return new StringTable; +} + +void StringTable::Clear() { + s_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool StringTable::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)) { + // repeated bytes s = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_s: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->add_s())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(10)) goto parse_s; + 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 StringTable::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // repeated bytes s = 1; + for (int i = 0; i < this->s_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteBytes( + 1, this->s(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* StringTable::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // repeated bytes s = 1; + for (int i = 0; i < this->s_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteBytesToArray(1, this->s(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int StringTable::ByteSize() const { + int total_size = 0; + + // repeated bytes s = 1; + total_size += 1 * this->s_size(); + for (int i = 0; i < this->s_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( + this->s(i)); + } + + 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 StringTable::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const StringTable* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void StringTable::MergeFrom(const StringTable& from) { + GOOGLE_CHECK_NE(&from, this); + s_.MergeFrom(from.s_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void StringTable::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void StringTable::CopyFrom(const StringTable& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StringTable::IsInitialized() const { + + return true; +} + +void StringTable::Swap(StringTable* other) { + if (other != this) { + s_.Swap(&other->s_); + 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 StringTable::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = StringTable_descriptor_; + metadata.reflection = StringTable_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int Info::kVersionFieldNumber; +const int Info::kTimestampFieldNumber; +const int Info::kChangesetFieldNumber; +const int Info::kUidFieldNumber; +const int Info::kUserSidFieldNumber; +#endif // !_MSC_VER + +Info::Info() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void Info::InitAsDefaultInstance() { +} + +Info::Info(const Info& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void Info::SharedCtor() { + _cached_size_ = 0; + version_ = -1; + timestamp_ = GOOGLE_LONGLONG(0); + changeset_ = GOOGLE_LONGLONG(0); + uid_ = 0; + user_sid_ = 0u; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Info::~Info() { + SharedDtor(); +} + +void Info::SharedDtor() { + if (this != default_instance_) { + } +} + +void Info::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Info::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Info_descriptor_; +} + +const Info& Info::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +Info* Info::default_instance_ = NULL; + +Info* Info::New() const { + return new Info; +} + +void Info::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + version_ = -1; + timestamp_ = GOOGLE_LONGLONG(0); + changeset_ = GOOGLE_LONGLONG(0); + uid_ = 0; + user_sid_ = 0u; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Info::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 int32 version = 1 [default = -1]; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &version_))); + _set_bit(0); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(16)) goto parse_timestamp; + break; + } + + // optional int64 timestamp = 2; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_timestamp: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, ×tamp_))); + _set_bit(1); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(24)) goto parse_changeset; + break; + } + + // optional int64 changeset = 3; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_changeset: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &changeset_))); + _set_bit(2); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(32)) goto parse_uid; + break; + } + + // optional int32 uid = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_uid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &uid_))); + _set_bit(3); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(40)) goto parse_user_sid; + break; + } + + // optional uint32 user_sid = 5; + case 5: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_user_sid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, &user_sid_))); + _set_bit(4); + } 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 Info::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // optional int32 version = 1 [default = -1]; + if (_has_bit(0)) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->version(), output); + } + + // optional int64 timestamp = 2; + if (_has_bit(1)) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->timestamp(), output); + } + + // optional int64 changeset = 3; + if (_has_bit(2)) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(3, this->changeset(), output); + } + + // optional int32 uid = 4; + if (_has_bit(3)) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->uid(), output); + } + + // optional uint32 user_sid = 5; + if (_has_bit(4)) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->user_sid(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* Info::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // optional int32 version = 1 [default = -1]; + if (_has_bit(0)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->version(), target); + } + + // optional int64 timestamp = 2; + if (_has_bit(1)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->timestamp(), target); + } + + // optional int64 changeset = 3; + if (_has_bit(2)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(3, this->changeset(), target); + } + + // optional int32 uid = 4; + if (_has_bit(3)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->uid(), target); + } + + // optional uint32 user_sid = 5; + if (_has_bit(4)) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->user_sid(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int Info::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // optional int32 version = 1 [default = -1]; + if (has_version()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->version()); + } + + // optional int64 timestamp = 2; + if (has_timestamp()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->timestamp()); + } + + // optional int64 changeset = 3; + if (has_changeset()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->changeset()); + } + + // optional int32 uid = 4; + if (has_uid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->uid()); + } + + // optional uint32 user_sid = 5; + if (has_user_sid()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt32Size( + this->user_sid()); + } + + } + 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 Info::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Info* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Info::MergeFrom(const Info& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from._has_bit(0)) { + set_version(from.version()); + } + if (from._has_bit(1)) { + set_timestamp(from.timestamp()); + } + if (from._has_bit(2)) { + set_changeset(from.changeset()); + } + if (from._has_bit(3)) { + set_uid(from.uid()); + } + if (from._has_bit(4)) { + set_user_sid(from.user_sid()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Info::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Info::CopyFrom(const Info& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Info::IsInitialized() const { + + return true; +} + +void Info::Swap(Info* other) { + if (other != this) { + std::swap(version_, other->version_); + std::swap(timestamp_, other->timestamp_); + std::swap(changeset_, other->changeset_); + std::swap(uid_, other->uid_); + std::swap(user_sid_, other->user_sid_); + 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 Info::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Info_descriptor_; + metadata.reflection = Info_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int DenseInfo::kVersionFieldNumber; +const int DenseInfo::kTimestampFieldNumber; +const int DenseInfo::kChangesetFieldNumber; +const int DenseInfo::kUidFieldNumber; +const int DenseInfo::kUserSidFieldNumber; +#endif // !_MSC_VER + +DenseInfo::DenseInfo() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void DenseInfo::InitAsDefaultInstance() { +} + +DenseInfo::DenseInfo(const DenseInfo& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void DenseInfo::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DenseInfo::~DenseInfo() { + SharedDtor(); +} + +void DenseInfo::SharedDtor() { + if (this != default_instance_) { + } +} + +void DenseInfo::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DenseInfo::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DenseInfo_descriptor_; +} + +const DenseInfo& DenseInfo::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +DenseInfo* DenseInfo::default_instance_ = NULL; + +DenseInfo* DenseInfo::New() const { + return new DenseInfo; +} + +void DenseInfo::Clear() { + version_.Clear(); + timestamp_.Clear(); + changeset_.Clear(); + uid_.Clear(); + user_sid_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool DenseInfo::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)) { + // repeated int32 version = 1 [packed = true]; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_version()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10, input, this->mutable_version()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_timestamp; + break; + } + + // repeated sint64 timestamp = 2 [packed = true]; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_timestamp: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, this->mutable_timestamp()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + 1, 18, input, this->mutable_timestamp()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(26)) goto parse_changeset; + break; + } + + // repeated sint64 changeset = 3 [packed = true]; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_changeset: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, this->mutable_changeset()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + 1, 26, input, this->mutable_changeset()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_uid; + break; + } + + // repeated sint32 uid = 4 [packed = true]; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_uid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>( + input, this->mutable_uid()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>( + 1, 34, input, this->mutable_uid()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(42)) goto parse_user_sid; + break; + } + + // repeated sint32 user_sid = 5 [packed = true]; + case 5: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_user_sid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>( + input, this->mutable_user_sid()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>( + 1, 42, input, this->mutable_user_sid()))); + } 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 DenseInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // repeated int32 version = 1 [packed = true]; + if (this->version_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_version_cached_byte_size_); + } + for (int i = 0; i < this->version_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->version(i), output); + } + + // repeated sint64 timestamp = 2 [packed = true]; + if (this->timestamp_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_timestamp_cached_byte_size_); + } + for (int i = 0; i < this->timestamp_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag( + this->timestamp(i), output); + } + + // repeated sint64 changeset = 3 [packed = true]; + if (this->changeset_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_changeset_cached_byte_size_); + } + for (int i = 0; i < this->changeset_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag( + this->changeset(i), output); + } + + // repeated sint32 uid = 4 [packed = true]; + if (this->uid_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_uid_cached_byte_size_); + } + for (int i = 0; i < this->uid_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteSInt32NoTag( + this->uid(i), output); + } + + // repeated sint32 user_sid = 5 [packed = true]; + if (this->user_sid_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_user_sid_cached_byte_size_); + } + for (int i = 0; i < this->user_sid_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteSInt32NoTag( + this->user_sid(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* DenseInfo::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // repeated int32 version = 1 [packed = true]; + if (this->version_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _version_cached_byte_size_, target); + } + for (int i = 0; i < this->version_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->version(i), target); + } + + // repeated sint64 timestamp = 2 [packed = true]; + if (this->timestamp_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _timestamp_cached_byte_size_, target); + } + for (int i = 0; i < this->timestamp_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteSInt64NoTagToArray(this->timestamp(i), target); + } + + // repeated sint64 changeset = 3 [packed = true]; + if (this->changeset_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _changeset_cached_byte_size_, target); + } + for (int i = 0; i < this->changeset_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteSInt64NoTagToArray(this->changeset(i), target); + } + + // repeated sint32 uid = 4 [packed = true]; + if (this->uid_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 4, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _uid_cached_byte_size_, target); + } + for (int i = 0; i < this->uid_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteSInt32NoTagToArray(this->uid(i), target); + } + + // repeated sint32 user_sid = 5 [packed = true]; + if (this->user_sid_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 5, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _user_sid_cached_byte_size_, target); + } + for (int i = 0; i < this->user_sid_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteSInt32NoTagToArray(this->user_sid(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int DenseInfo::ByteSize() const { + int total_size = 0; + + // repeated int32 version = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->version_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->version(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _version_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated sint64 timestamp = 2 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->timestamp_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + SInt64Size(this->timestamp(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _timestamp_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated sint64 changeset = 3 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->changeset_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + SInt64Size(this->changeset(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _changeset_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated sint32 uid = 4 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->uid_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + SInt32Size(this->uid(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _uid_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated sint32 user_sid = 5 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->user_sid_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + SInt32Size(this->user_sid(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _user_sid_cached_byte_size_ = data_size; + total_size += data_size; + } + + 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 DenseInfo::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const DenseInfo* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void DenseInfo::MergeFrom(const DenseInfo& from) { + GOOGLE_CHECK_NE(&from, this); + version_.MergeFrom(from.version_); + timestamp_.MergeFrom(from.timestamp_); + changeset_.MergeFrom(from.changeset_); + uid_.MergeFrom(from.uid_); + user_sid_.MergeFrom(from.user_sid_); + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void DenseInfo::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DenseInfo::CopyFrom(const DenseInfo& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DenseInfo::IsInitialized() const { + + return true; +} + +void DenseInfo::Swap(DenseInfo* other) { + if (other != this) { + version_.Swap(&other->version_); + timestamp_.Swap(&other->timestamp_); + changeset_.Swap(&other->changeset_); + uid_.Swap(&other->uid_); + user_sid_.Swap(&other->user_sid_); + 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 DenseInfo::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DenseInfo_descriptor_; + metadata.reflection = DenseInfo_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int ChangeSet::kIdFieldNumber; +#endif // !_MSC_VER + +ChangeSet::ChangeSet() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void ChangeSet::InitAsDefaultInstance() { +} + +ChangeSet::ChangeSet(const ChangeSet& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void ChangeSet::SharedCtor() { + _cached_size_ = 0; + id_ = GOOGLE_LONGLONG(0); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ChangeSet::~ChangeSet() { + SharedDtor(); +} + +void ChangeSet::SharedDtor() { + if (this != default_instance_) { + } +} + +void ChangeSet::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ChangeSet::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ChangeSet_descriptor_; +} + +const ChangeSet& ChangeSet::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +ChangeSet* ChangeSet::default_instance_ = NULL; + +ChangeSet* ChangeSet::New() const { + return new ChangeSet; +} + +void ChangeSet::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + id_ = GOOGLE_LONGLONG(0); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool ChangeSet::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 int64 id = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &id_))); + _set_bit(0); + } 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 ChangeSet::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required int64 id = 1; + if (_has_bit(0)) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* ChangeSet::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required int64 id = 1; + if (_has_bit(0)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->id(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int ChangeSet::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int64 id = 1; + if (has_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->id()); + } + + } + 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 ChangeSet::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const ChangeSet* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void ChangeSet::MergeFrom(const ChangeSet& from) { + GOOGLE_CHECK_NE(&from, this); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from._has_bit(0)) { + set_id(from.id()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void ChangeSet::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ChangeSet::CopyFrom(const ChangeSet& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ChangeSet::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void ChangeSet::Swap(ChangeSet* other) { + if (other != this) { + std::swap(id_, other->id_); + 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 ChangeSet::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ChangeSet_descriptor_; + metadata.reflection = ChangeSet_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int Node::kIdFieldNumber; +const int Node::kKeysFieldNumber; +const int Node::kValsFieldNumber; +const int Node::kInfoFieldNumber; +const int Node::kLatFieldNumber; +const int Node::kLonFieldNumber; +#endif // !_MSC_VER + +Node::Node() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void Node::InitAsDefaultInstance() { + info_ = const_cast< ::OSMPBF::Info*>(&::OSMPBF::Info::default_instance()); +} + +Node::Node(const Node& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void Node::SharedCtor() { + _cached_size_ = 0; + id_ = GOOGLE_LONGLONG(0); + info_ = NULL; + lat_ = GOOGLE_LONGLONG(0); + lon_ = GOOGLE_LONGLONG(0); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Node::~Node() { + SharedDtor(); +} + +void Node::SharedDtor() { + if (this != default_instance_) { + delete info_; + } +} + +void Node::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Node::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Node_descriptor_; +} + +const Node& Node::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +Node* Node::default_instance_ = NULL; + +Node* Node::New() const { + return new Node; +} + +void Node::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + id_ = GOOGLE_LONGLONG(0); + if (_has_bit(3)) { + if (info_ != NULL) info_->::OSMPBF::Info::Clear(); + } + lat_ = GOOGLE_LONGLONG(0); + lon_ = GOOGLE_LONGLONG(0); + } + keys_.Clear(); + vals_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Node::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 sint64 id = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, &id_))); + _set_bit(0); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_keys; + break; + } + + // repeated uint32 keys = 2 [packed = true]; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_keys: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_keys()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 18, input, this->mutable_keys()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(26)) goto parse_vals; + break; + } + + // repeated uint32 vals = 3 [packed = true]; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_vals: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_vals()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 26, input, this->mutable_vals()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_info; + break; + } + + // optional .OSMPBF.Info info = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_info: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_info())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(64)) goto parse_lat; + break; + } + + // required sint64 lat = 8; + case 8: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_lat: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, &lat_))); + _set_bit(4); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(72)) goto parse_lon; + break; + } + + // required sint64 lon = 9; + case 9: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + parse_lon: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, &lon_))); + _set_bit(5); + } 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 Node::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required sint64 id = 1; + if (_has_bit(0)) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64(1, this->id(), output); + } + + // repeated uint32 keys = 2 [packed = true]; + if (this->keys_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_keys_cached_byte_size_); + } + for (int i = 0; i < this->keys_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->keys(i), output); + } + + // repeated uint32 vals = 3 [packed = true]; + if (this->vals_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_vals_cached_byte_size_); + } + for (int i = 0; i < this->vals_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->vals(i), output); + } + + // optional .OSMPBF.Info info = 4; + if (_has_bit(3)) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->info(), output); + } + + // required sint64 lat = 8; + if (_has_bit(4)) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64(8, this->lat(), output); + } + + // required sint64 lon = 9; + if (_has_bit(5)) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64(9, this->lon(), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* Node::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required sint64 id = 1; + if (_has_bit(0)) { + target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(1, this->id(), target); + } + + // repeated uint32 keys = 2 [packed = true]; + if (this->keys_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _keys_cached_byte_size_, target); + } + for (int i = 0; i < this->keys_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->keys(i), target); + } + + // repeated uint32 vals = 3 [packed = true]; + if (this->vals_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _vals_cached_byte_size_, target); + } + for (int i = 0; i < this->vals_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->vals(i), target); + } + + // optional .OSMPBF.Info info = 4; + if (_has_bit(3)) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->info(), target); + } + + // required sint64 lat = 8; + if (_has_bit(4)) { + target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(8, this->lat(), target); + } + + // required sint64 lon = 9; + if (_has_bit(5)) { + target = ::google::protobuf::internal::WireFormatLite::WriteSInt64ToArray(9, this->lon(), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int Node::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required sint64 id = 1; + if (has_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::SInt64Size( + this->id()); + } + + // optional .OSMPBF.Info info = 4; + if (has_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->info()); + } + + // required sint64 lat = 8; + if (has_lat()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::SInt64Size( + this->lat()); + } + + // required sint64 lon = 9; + if (has_lon()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::SInt64Size( + this->lon()); + } + + } + // repeated uint32 keys = 2 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->keys_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->keys(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _keys_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated uint32 vals = 3 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->vals_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->vals(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _vals_cached_byte_size_ = data_size; + total_size += data_size; + } + + 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 Node::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Node* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Node::MergeFrom(const Node& from) { + GOOGLE_CHECK_NE(&from, this); + keys_.MergeFrom(from.keys_); + vals_.MergeFrom(from.vals_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from._has_bit(0)) { + set_id(from.id()); + } + if (from._has_bit(3)) { + mutable_info()->::OSMPBF::Info::MergeFrom(from.info()); + } + if (from._has_bit(4)) { + set_lat(from.lat()); + } + if (from._has_bit(5)) { + set_lon(from.lon()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Node::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Node::CopyFrom(const Node& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Node::IsInitialized() const { + if ((_has_bits_[0] & 0x00000031) != 0x00000031) return false; + + return true; +} + +void Node::Swap(Node* other) { + if (other != this) { + std::swap(id_, other->id_); + keys_.Swap(&other->keys_); + vals_.Swap(&other->vals_); + std::swap(info_, other->info_); + std::swap(lat_, other->lat_); + std::swap(lon_, other->lon_); + 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 Node::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Node_descriptor_; + metadata.reflection = Node_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int DenseNodes::kIdFieldNumber; +const int DenseNodes::kDenseinfoFieldNumber; +const int DenseNodes::kLatFieldNumber; +const int DenseNodes::kLonFieldNumber; +const int DenseNodes::kKeysValsFieldNumber; +#endif // !_MSC_VER + +DenseNodes::DenseNodes() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void DenseNodes::InitAsDefaultInstance() { + denseinfo_ = const_cast< ::OSMPBF::DenseInfo*>(&::OSMPBF::DenseInfo::default_instance()); +} + +DenseNodes::DenseNodes(const DenseNodes& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void DenseNodes::SharedCtor() { + _cached_size_ = 0; + denseinfo_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DenseNodes::~DenseNodes() { + SharedDtor(); +} + +void DenseNodes::SharedDtor() { + if (this != default_instance_) { + delete denseinfo_; + } +} + +void DenseNodes::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DenseNodes::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DenseNodes_descriptor_; +} + +const DenseNodes& DenseNodes::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +DenseNodes* DenseNodes::default_instance_ = NULL; + +DenseNodes* DenseNodes::New() const { + return new DenseNodes; +} + +void DenseNodes::Clear() { + if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { + if (_has_bit(1)) { + if (denseinfo_ != NULL) denseinfo_->::OSMPBF::DenseInfo::Clear(); + } + } + id_.Clear(); + lat_.Clear(); + lon_.Clear(); + keys_vals_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool DenseNodes::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)) { + // repeated sint64 id = 1 [packed = true]; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, this->mutable_id()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + 1, 10, input, this->mutable_id()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(42)) goto parse_denseinfo; + break; + } + + // optional .OSMPBF.DenseInfo denseinfo = 5; + case 5: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_denseinfo: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_denseinfo())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(66)) goto parse_lat; + break; + } + + // repeated sint64 lat = 8 [packed = true]; + case 8: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_lat: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, this->mutable_lat()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + 1, 66, input, this->mutable_lat()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(74)) goto parse_lon; + break; + } + + // repeated sint64 lon = 9 [packed = true]; + case 9: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_lon: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, this->mutable_lon()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + 1, 74, input, this->mutable_lon()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(82)) goto parse_keys_vals; + break; + } + + // repeated int32 keys_vals = 10 [packed = true]; + case 10: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_keys_vals: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_keys_vals()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 82, input, this->mutable_keys_vals()))); + } 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 DenseNodes::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // repeated sint64 id = 1 [packed = true]; + if (this->id_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_id_cached_byte_size_); + } + for (int i = 0; i < this->id_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag( + this->id(i), output); + } + + // optional .OSMPBF.DenseInfo denseinfo = 5; + if (_has_bit(1)) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->denseinfo(), output); + } + + // repeated sint64 lat = 8 [packed = true]; + if (this->lat_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_lat_cached_byte_size_); + } + for (int i = 0; i < this->lat_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag( + this->lat(i), output); + } + + // repeated sint64 lon = 9 [packed = true]; + if (this->lon_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_lon_cached_byte_size_); + } + for (int i = 0; i < this->lon_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag( + this->lon(i), output); + } + + // repeated int32 keys_vals = 10 [packed = true]; + if (this->keys_vals_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(10, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_keys_vals_cached_byte_size_); + } + for (int i = 0; i < this->keys_vals_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->keys_vals(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* DenseNodes::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // repeated sint64 id = 1 [packed = true]; + if (this->id_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _id_cached_byte_size_, target); + } + for (int i = 0; i < this->id_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteSInt64NoTagToArray(this->id(i), target); + } + + // optional .OSMPBF.DenseInfo denseinfo = 5; + if (_has_bit(1)) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->denseinfo(), target); + } + + // repeated sint64 lat = 8 [packed = true]; + if (this->lat_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 8, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _lat_cached_byte_size_, target); + } + for (int i = 0; i < this->lat_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteSInt64NoTagToArray(this->lat(i), target); + } + + // repeated sint64 lon = 9 [packed = true]; + if (this->lon_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 9, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _lon_cached_byte_size_, target); + } + for (int i = 0; i < this->lon_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteSInt64NoTagToArray(this->lon(i), target); + } + + // repeated int32 keys_vals = 10 [packed = true]; + if (this->keys_vals_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 10, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _keys_vals_cached_byte_size_, target); + } + for (int i = 0; i < this->keys_vals_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->keys_vals(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int DenseNodes::ByteSize() const { + int total_size = 0; + + if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) { + // optional .OSMPBF.DenseInfo denseinfo = 5; + if (has_denseinfo()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->denseinfo()); + } + + } + // repeated sint64 id = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->id_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + SInt64Size(this->id(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _id_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated sint64 lat = 8 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->lat_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + SInt64Size(this->lat(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _lat_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated sint64 lon = 9 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->lon_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + SInt64Size(this->lon(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _lon_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated int32 keys_vals = 10 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->keys_vals_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->keys_vals(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _keys_vals_cached_byte_size_ = data_size; + total_size += data_size; + } + + 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 DenseNodes::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const DenseNodes* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void DenseNodes::MergeFrom(const DenseNodes& from) { + GOOGLE_CHECK_NE(&from, this); + id_.MergeFrom(from.id_); + lat_.MergeFrom(from.lat_); + lon_.MergeFrom(from.lon_); + keys_vals_.MergeFrom(from.keys_vals_); + if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { + if (from._has_bit(1)) { + mutable_denseinfo()->::OSMPBF::DenseInfo::MergeFrom(from.denseinfo()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void DenseNodes::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DenseNodes::CopyFrom(const DenseNodes& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DenseNodes::IsInitialized() const { + + return true; +} + +void DenseNodes::Swap(DenseNodes* other) { + if (other != this) { + id_.Swap(&other->id_); + std::swap(denseinfo_, other->denseinfo_); + lat_.Swap(&other->lat_); + lon_.Swap(&other->lon_); + keys_vals_.Swap(&other->keys_vals_); + 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 DenseNodes::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DenseNodes_descriptor_; + metadata.reflection = DenseNodes_reflection_; + return metadata; +} + + +// =================================================================== + +#ifndef _MSC_VER +const int Way::kIdFieldNumber; +const int Way::kKeysFieldNumber; +const int Way::kValsFieldNumber; +const int Way::kInfoFieldNumber; +const int Way::kRefsFieldNumber; +#endif // !_MSC_VER + +Way::Way() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void Way::InitAsDefaultInstance() { + info_ = const_cast< ::OSMPBF::Info*>(&::OSMPBF::Info::default_instance()); +} + +Way::Way(const Way& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void Way::SharedCtor() { + _cached_size_ = 0; + id_ = GOOGLE_LONGLONG(0); + info_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Way::~Way() { + SharedDtor(); +} + +void Way::SharedDtor() { + if (this != default_instance_) { + delete info_; + } +} + +void Way::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Way::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Way_descriptor_; +} + +const Way& Way::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +Way* Way::default_instance_ = NULL; + +Way* Way::New() const { + return new Way; +} + +void Way::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + id_ = GOOGLE_LONGLONG(0); + if (_has_bit(3)) { + if (info_ != NULL) info_->::OSMPBF::Info::Clear(); + } + } + keys_.Clear(); + vals_.Clear(); + refs_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Way::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 int64 id = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &id_))); + _set_bit(0); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_keys; + break; + } + + // repeated uint32 keys = 2 [packed = true]; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_keys: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_keys()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 18, input, this->mutable_keys()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(26)) goto parse_vals; + break; + } + + // repeated uint32 vals = 3 [packed = true]; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_vals: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_vals()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 26, input, this->mutable_vals()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_info; + break; + } + + // optional .OSMPBF.Info info = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_info: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_info())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(66)) goto parse_refs; + break; + } + + // repeated sint64 refs = 8 [packed = true]; + case 8: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_refs: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, this->mutable_refs()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + 1, 66, input, this->mutable_refs()))); + } 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 Way::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required int64 id = 1; + if (_has_bit(0)) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output); + } + + // repeated uint32 keys = 2 [packed = true]; + if (this->keys_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_keys_cached_byte_size_); + } + for (int i = 0; i < this->keys_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->keys(i), output); + } + + // repeated uint32 vals = 3 [packed = true]; + if (this->vals_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_vals_cached_byte_size_); + } + for (int i = 0; i < this->vals_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->vals(i), output); + } + + // optional .OSMPBF.Info info = 4; + if (_has_bit(3)) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->info(), output); + } + + // repeated sint64 refs = 8 [packed = true]; + if (this->refs_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_refs_cached_byte_size_); + } + for (int i = 0; i < this->refs_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag( + this->refs(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* Way::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required int64 id = 1; + if (_has_bit(0)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->id(), target); + } + + // repeated uint32 keys = 2 [packed = true]; + if (this->keys_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _keys_cached_byte_size_, target); + } + for (int i = 0; i < this->keys_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->keys(i), target); + } + + // repeated uint32 vals = 3 [packed = true]; + if (this->vals_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _vals_cached_byte_size_, target); + } + for (int i = 0; i < this->vals_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->vals(i), target); + } + + // optional .OSMPBF.Info info = 4; + if (_has_bit(3)) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->info(), target); + } + + // repeated sint64 refs = 8 [packed = true]; + if (this->refs_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 8, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _refs_cached_byte_size_, target); + } + for (int i = 0; i < this->refs_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteSInt64NoTagToArray(this->refs(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int Way::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int64 id = 1; + if (has_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->id()); + } + + // optional .OSMPBF.Info info = 4; + if (has_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->info()); + } + + } + // repeated uint32 keys = 2 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->keys_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->keys(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _keys_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated uint32 vals = 3 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->vals_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->vals(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _vals_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated sint64 refs = 8 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->refs_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + SInt64Size(this->refs(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _refs_cached_byte_size_ = data_size; + total_size += data_size; + } + + 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 Way::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Way* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Way::MergeFrom(const Way& from) { + GOOGLE_CHECK_NE(&from, this); + keys_.MergeFrom(from.keys_); + vals_.MergeFrom(from.vals_); + refs_.MergeFrom(from.refs_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from._has_bit(0)) { + set_id(from.id()); + } + if (from._has_bit(3)) { + mutable_info()->::OSMPBF::Info::MergeFrom(from.info()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Way::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Way::CopyFrom(const Way& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Way::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void Way::Swap(Way* other) { + if (other != this) { + std::swap(id_, other->id_); + keys_.Swap(&other->keys_); + vals_.Swap(&other->vals_); + std::swap(info_, other->info_); + refs_.Swap(&other->refs_); + 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 Way::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Way_descriptor_; + metadata.reflection = Way_reflection_; + return metadata; +} + + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* Relation_MemberType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return Relation_MemberType_descriptor_; +} +bool Relation_MemberType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#ifndef _MSC_VER +const Relation_MemberType Relation::NODE; +const Relation_MemberType Relation::WAY; +const Relation_MemberType Relation::RELATION; +const Relation_MemberType Relation::MemberType_MIN; +const Relation_MemberType Relation::MemberType_MAX; +const int Relation::MemberType_ARRAYSIZE; +#endif // _MSC_VER +#ifndef _MSC_VER +const int Relation::kIdFieldNumber; +const int Relation::kKeysFieldNumber; +const int Relation::kValsFieldNumber; +const int Relation::kInfoFieldNumber; +const int Relation::kRolesSidFieldNumber; +const int Relation::kMemidsFieldNumber; +const int Relation::kTypesFieldNumber; +#endif // !_MSC_VER + +Relation::Relation() + : ::google::protobuf::Message() { + SharedCtor(); +} + +void Relation::InitAsDefaultInstance() { + info_ = const_cast< ::OSMPBF::Info*>(&::OSMPBF::Info::default_instance()); +} + +Relation::Relation(const Relation& from) + : ::google::protobuf::Message() { + SharedCtor(); + MergeFrom(from); +} + +void Relation::SharedCtor() { + _cached_size_ = 0; + id_ = GOOGLE_LONGLONG(0); + info_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +Relation::~Relation() { + SharedDtor(); +} + +void Relation::SharedDtor() { + if (this != default_instance_) { + delete info_; + } +} + +void Relation::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* Relation::descriptor() { + protobuf_AssignDescriptorsOnce(); + return Relation_descriptor_; +} + +const Relation& Relation::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_osmformat_2eproto(); return *default_instance_; +} + +Relation* Relation::default_instance_ = NULL; + +Relation* Relation::New() const { + return new Relation; +} + +void Relation::Clear() { + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + id_ = GOOGLE_LONGLONG(0); + if (_has_bit(3)) { + if (info_ != NULL) info_->::OSMPBF::Info::Clear(); + } + } + keys_.Clear(); + vals_.Clear(); + roles_sid_.Clear(); + memids_.Clear(); + types_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + mutable_unknown_fields()->Clear(); +} + +bool Relation::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 int64 id = 1; + case 1: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &id_))); + _set_bit(0); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(18)) goto parse_keys; + break; + } + + // repeated uint32 keys = 2 [packed = true]; + case 2: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_keys: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_keys()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 18, input, this->mutable_keys()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(26)) goto parse_vals; + break; + } + + // repeated uint32 vals = 3 [packed = true]; + case 3: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_vals: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + input, this->mutable_vals()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( + 1, 26, input, this->mutable_vals()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(34)) goto parse_info; + break; + } + + // optional .OSMPBF.Info info = 4; + case 4: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_info: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_info())); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(66)) goto parse_roles_sid; + break; + } + + // repeated int32 roles_sid = 8 [packed = true]; + case 8: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_roles_sid: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_roles_sid()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 66, input, this->mutable_roles_sid()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(74)) goto parse_memids; + break; + } + + // repeated sint64 memids = 9 [packed = true]; + case 9: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_memids: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + input, this->mutable_memids()))); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_SINT64>( + 1, 74, input, this->mutable_memids()))); + } else { + goto handle_uninterpreted; + } + if (input->ExpectTag(82)) goto parse_types; + break; + } + + // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true]; + case 10: { + if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { + parse_types: + ::google::protobuf::uint32 length; + DO_(input->ReadVarint32(&length)); + ::google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(length); + while (input->BytesUntilLimit() > 0) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::OSMPBF::Relation_MemberType_IsValid(value)) { + add_types(static_cast< ::OSMPBF::Relation_MemberType >(value)); + } + } + input->PopLimit(limit); + } else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) + == ::google::protobuf::internal::WireFormatLite:: + WIRETYPE_VARINT) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::OSMPBF::Relation_MemberType_IsValid(value)) { + add_types(static_cast< ::OSMPBF::Relation_MemberType >(value)); + } else { + mutable_unknown_fields()->AddVarint(10, value); + } + } 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 Relation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // required int64 id = 1; + if (_has_bit(0)) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(1, this->id(), output); + } + + // repeated uint32 keys = 2 [packed = true]; + if (this->keys_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_keys_cached_byte_size_); + } + for (int i = 0; i < this->keys_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->keys(i), output); + } + + // repeated uint32 vals = 3 [packed = true]; + if (this->vals_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_vals_cached_byte_size_); + } + for (int i = 0; i < this->vals_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag( + this->vals(i), output); + } + + // optional .OSMPBF.Info info = 4; + if (_has_bit(3)) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->info(), output); + } + + // repeated int32 roles_sid = 8 [packed = true]; + if (this->roles_sid_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_roles_sid_cached_byte_size_); + } + for (int i = 0; i < this->roles_sid_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->roles_sid(i), output); + } + + // repeated sint64 memids = 9 [packed = true]; + if (this->memids_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(9, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_memids_cached_byte_size_); + } + for (int i = 0; i < this->memids_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteSInt64NoTag( + this->memids(i), output); + } + + // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true]; + if (this->types_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag( + 10, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + output); + output->WriteVarint32(_types_cached_byte_size_); + } + for (int i = 0; i < this->types_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteEnumNoTag( + this->types(i), output); + } + + if (!unknown_fields().empty()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } +} + +::google::protobuf::uint8* Relation::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // required int64 id = 1; + if (_has_bit(0)) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(1, this->id(), target); + } + + // repeated uint32 keys = 2 [packed = true]; + if (this->keys_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _keys_cached_byte_size_, target); + } + for (int i = 0; i < this->keys_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->keys(i), target); + } + + // repeated uint32 vals = 3 [packed = true]; + if (this->vals_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 3, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _vals_cached_byte_size_, target); + } + for (int i = 0; i < this->vals_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteUInt32NoTagToArray(this->vals(i), target); + } + + // optional .OSMPBF.Info info = 4; + if (_has_bit(3)) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->info(), target); + } + + // repeated int32 roles_sid = 8 [packed = true]; + if (this->roles_sid_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 8, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _roles_sid_cached_byte_size_, target); + } + for (int i = 0; i < this->roles_sid_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->roles_sid(i), target); + } + + // repeated sint64 memids = 9 [packed = true]; + if (this->memids_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 9, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _memids_cached_byte_size_, target); + } + for (int i = 0; i < this->memids_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteSInt64NoTagToArray(this->memids(i), target); + } + + // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true]; + if (this->types_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 10, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( _types_cached_byte_size_, target); + } + for (int i = 0; i < this->types_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumNoTagToArray( + this->types(i), target); + } + + if (!unknown_fields().empty()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + return target; +} + +int Relation::ByteSize() const { + int total_size = 0; + + if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) { + // required int64 id = 1; + if (has_id()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->id()); + } + + // optional .OSMPBF.Info info = 4; + if (has_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->info()); + } + + } + // repeated uint32 keys = 2 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->keys_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->keys(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _keys_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated uint32 vals = 3 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->vals_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + UInt32Size(this->vals(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _vals_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated int32 roles_sid = 8 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->roles_sid_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->roles_sid(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _roles_sid_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated sint64 memids = 9 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->memids_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + SInt64Size(this->memids(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _memids_cached_byte_size_ = data_size; + total_size += data_size; + } + + // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->types_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite::EnumSize( + this->types(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + _types_cached_byte_size_ = data_size; + total_size += data_size; + } + + 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 Relation::MergeFrom(const ::google::protobuf::Message& from) { + GOOGLE_CHECK_NE(&from, this); + const Relation* source = + ::google::protobuf::internal::dynamic_cast_if_available( + &from); + if (source == NULL) { + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + MergeFrom(*source); + } +} + +void Relation::MergeFrom(const Relation& from) { + GOOGLE_CHECK_NE(&from, this); + keys_.MergeFrom(from.keys_); + vals_.MergeFrom(from.vals_); + roles_sid_.MergeFrom(from.roles_sid_); + memids_.MergeFrom(from.memids_); + types_.MergeFrom(from.types_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from._has_bit(0)) { + set_id(from.id()); + } + if (from._has_bit(3)) { + mutable_info()->::OSMPBF::Info::MergeFrom(from.info()); + } + } + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); +} + +void Relation::CopyFrom(const ::google::protobuf::Message& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void Relation::CopyFrom(const Relation& from) { + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Relation::IsInitialized() const { + if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false; + + return true; +} + +void Relation::Swap(Relation* other) { + if (other != this) { + std::swap(id_, other->id_); + keys_.Swap(&other->keys_); + vals_.Swap(&other->vals_); + std::swap(info_, other->info_); + roles_sid_.Swap(&other->roles_sid_); + memids_.Swap(&other->memids_); + types_.Swap(&other->types_); + 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 Relation::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = Relation_descriptor_; + metadata.reflection = Relation_reflection_; + return metadata; +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace OSMPBF + +// @@protoc_insertion_point(global_scope) diff --git a/DataStructures/pbf-proto/osmformat.pb.h b/DataStructures/pbf-proto/osmformat.pb.h new file mode 100644 index 000000000..34cc2e84f --- /dev/null +++ b/DataStructures/pbf-proto/osmformat.pb.h @@ -0,0 +1,2989 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: osmformat.proto + +#ifndef PROTOBUF_osmformat_2eproto__INCLUDED +#define PROTOBUF_osmformat_2eproto__INCLUDED + +#include + +#include + +#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 +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace OSMPBF { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_osmformat_2eproto(); +void protobuf_AssignDesc_osmformat_2eproto(); +void protobuf_ShutdownFile_osmformat_2eproto(); + +class HeaderBlock; +class HeaderBBox; +class PrimitiveBlock; +class PrimitiveGroup; +class StringTable; +class Info; +class DenseInfo; +class ChangeSet; +class Node; +class DenseNodes; +class Way; +class Relation; + +enum Relation_MemberType { + Relation_MemberType_NODE = 0, + Relation_MemberType_WAY = 1, + Relation_MemberType_RELATION = 2 +}; +bool Relation_MemberType_IsValid(int value); +const Relation_MemberType Relation_MemberType_MemberType_MIN = Relation_MemberType_NODE; +const Relation_MemberType Relation_MemberType_MemberType_MAX = Relation_MemberType_RELATION; +const int Relation_MemberType_MemberType_ARRAYSIZE = Relation_MemberType_MemberType_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Relation_MemberType_descriptor(); +inline const ::std::string& Relation_MemberType_Name(Relation_MemberType value) { + return ::google::protobuf::internal::NameOfEnum( + Relation_MemberType_descriptor(), value); +} +inline bool Relation_MemberType_Parse( + const ::std::string& name, Relation_MemberType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Relation_MemberType_descriptor(), name, value); +} +// =================================================================== + +class HeaderBlock : public ::google::protobuf::Message { + public: + HeaderBlock(); + virtual ~HeaderBlock(); + + HeaderBlock(const HeaderBlock& from); + + inline HeaderBlock& operator=(const HeaderBlock& 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 HeaderBlock& default_instance(); + + void Swap(HeaderBlock* other); + + // implements Message ---------------------------------------------- + + HeaderBlock* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const HeaderBlock& from); + void MergeFrom(const HeaderBlock& 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 .OSMPBF.HeaderBBox bbox = 1; + inline bool has_bbox() const; + inline void clear_bbox(); + static const int kBboxFieldNumber = 1; + inline const ::OSMPBF::HeaderBBox& bbox() const; + inline ::OSMPBF::HeaderBBox* mutable_bbox(); + + // repeated string required_features = 4; + inline int required_features_size() const; + inline void clear_required_features(); + static const int kRequiredFeaturesFieldNumber = 4; + inline const ::std::string& required_features(int index) const; + inline ::std::string* mutable_required_features(int index); + inline void set_required_features(int index, const ::std::string& value); + inline void set_required_features(int index, const char* value); + inline void set_required_features(int index, const char* value, size_t size); + inline ::std::string* add_required_features(); + inline void add_required_features(const ::std::string& value); + inline void add_required_features(const char* value); + inline void add_required_features(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& required_features() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_required_features(); + + // repeated string optional_features = 5; + inline int optional_features_size() const; + inline void clear_optional_features(); + static const int kOptionalFeaturesFieldNumber = 5; + inline const ::std::string& optional_features(int index) const; + inline ::std::string* mutable_optional_features(int index); + inline void set_optional_features(int index, const ::std::string& value); + inline void set_optional_features(int index, const char* value); + inline void set_optional_features(int index, const char* value, size_t size); + inline ::std::string* add_optional_features(); + inline void add_optional_features(const ::std::string& value); + inline void add_optional_features(const char* value); + inline void add_optional_features(const char* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& optional_features() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_optional_features(); + + // optional string writingprogram = 16; + inline bool has_writingprogram() const; + inline void clear_writingprogram(); + static const int kWritingprogramFieldNumber = 16; + inline const ::std::string& writingprogram() const; + inline void set_writingprogram(const ::std::string& value); + inline void set_writingprogram(const char* value); + inline void set_writingprogram(const char* value, size_t size); + inline ::std::string* mutable_writingprogram(); + + // optional string source = 17; + inline bool has_source() const; + inline void clear_source(); + static const int kSourceFieldNumber = 17; + inline const ::std::string& source() const; + inline void set_source(const ::std::string& value); + inline void set_source(const char* value); + inline void set_source(const char* value, size_t size); + inline ::std::string* mutable_source(); + + // @@protoc_insertion_point(class_scope:OSMPBF.HeaderBlock) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::OSMPBF::HeaderBBox* bbox_; + ::google::protobuf::RepeatedPtrField< ::std::string> required_features_; + ::google::protobuf::RepeatedPtrField< ::std::string> optional_features_; + ::std::string* writingprogram_; + static const ::std::string _default_writingprogram_; + ::std::string* source_; + static const ::std::string _default_source_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_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 HeaderBlock* default_instance_; +}; +// ------------------------------------------------------------------- + +class HeaderBBox : public ::google::protobuf::Message { + public: + HeaderBBox(); + virtual ~HeaderBBox(); + + HeaderBBox(const HeaderBBox& from); + + inline HeaderBBox& operator=(const HeaderBBox& 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 HeaderBBox& default_instance(); + + void Swap(HeaderBBox* other); + + // implements Message ---------------------------------------------- + + HeaderBBox* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const HeaderBBox& from); + void MergeFrom(const HeaderBBox& 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 sint64 left = 1; + inline bool has_left() const; + inline void clear_left(); + static const int kLeftFieldNumber = 1; + inline ::google::protobuf::int64 left() const; + inline void set_left(::google::protobuf::int64 value); + + // required sint64 right = 2; + inline bool has_right() const; + inline void clear_right(); + static const int kRightFieldNumber = 2; + inline ::google::protobuf::int64 right() const; + inline void set_right(::google::protobuf::int64 value); + + // required sint64 top = 3; + inline bool has_top() const; + inline void clear_top(); + static const int kTopFieldNumber = 3; + inline ::google::protobuf::int64 top() const; + inline void set_top(::google::protobuf::int64 value); + + // required sint64 bottom = 4; + inline bool has_bottom() const; + inline void clear_bottom(); + static const int kBottomFieldNumber = 4; + inline ::google::protobuf::int64 bottom() const; + inline void set_bottom(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:OSMPBF.HeaderBBox) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::int64 left_; + ::google::protobuf::int64 right_; + ::google::protobuf::int64 top_; + ::google::protobuf::int64 bottom_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_2eproto(); + + ::google::protobuf::uint32 _has_bits_[(4 + 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 HeaderBBox* default_instance_; +}; +// ------------------------------------------------------------------- + +class PrimitiveBlock : public ::google::protobuf::Message { + public: + PrimitiveBlock(); + virtual ~PrimitiveBlock(); + + PrimitiveBlock(const PrimitiveBlock& from); + + inline PrimitiveBlock& operator=(const PrimitiveBlock& 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 PrimitiveBlock& default_instance(); + + void Swap(PrimitiveBlock* other); + + // implements Message ---------------------------------------------- + + PrimitiveBlock* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PrimitiveBlock& from); + void MergeFrom(const PrimitiveBlock& 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 .OSMPBF.StringTable stringtable = 1; + inline bool has_stringtable() const; + inline void clear_stringtable(); + static const int kStringtableFieldNumber = 1; + inline const ::OSMPBF::StringTable& stringtable() const; + inline ::OSMPBF::StringTable* mutable_stringtable(); + + // repeated .OSMPBF.PrimitiveGroup primitivegroup = 2; + inline int primitivegroup_size() const; + inline void clear_primitivegroup(); + static const int kPrimitivegroupFieldNumber = 2; + inline const ::OSMPBF::PrimitiveGroup& primitivegroup(int index) const; + inline ::OSMPBF::PrimitiveGroup* mutable_primitivegroup(int index); + inline ::OSMPBF::PrimitiveGroup* add_primitivegroup(); + inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::PrimitiveGroup >& + primitivegroup() const; + inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::PrimitiveGroup >* + mutable_primitivegroup(); + + // optional int32 granularity = 17 [default = 100]; + inline bool has_granularity() const; + inline void clear_granularity(); + static const int kGranularityFieldNumber = 17; + inline ::google::protobuf::int32 granularity() const; + inline void set_granularity(::google::protobuf::int32 value); + + // optional int64 lat_offset = 19 [default = 0]; + inline bool has_lat_offset() const; + inline void clear_lat_offset(); + static const int kLatOffsetFieldNumber = 19; + inline ::google::protobuf::int64 lat_offset() const; + inline void set_lat_offset(::google::protobuf::int64 value); + + // optional int64 lon_offset = 20 [default = 0]; + inline bool has_lon_offset() const; + inline void clear_lon_offset(); + static const int kLonOffsetFieldNumber = 20; + inline ::google::protobuf::int64 lon_offset() const; + inline void set_lon_offset(::google::protobuf::int64 value); + + // optional int32 date_granularity = 18 [default = 1000]; + inline bool has_date_granularity() const; + inline void clear_date_granularity(); + static const int kDateGranularityFieldNumber = 18; + inline ::google::protobuf::int32 date_granularity() const; + inline void set_date_granularity(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:OSMPBF.PrimitiveBlock) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::OSMPBF::StringTable* stringtable_; + ::google::protobuf::RepeatedPtrField< ::OSMPBF::PrimitiveGroup > primitivegroup_; + ::google::protobuf::int32 granularity_; + ::google::protobuf::int64 lat_offset_; + ::google::protobuf::int64 lon_offset_; + ::google::protobuf::int32 date_granularity_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_2eproto(); + + ::google::protobuf::uint32 _has_bits_[(6 + 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 PrimitiveBlock* default_instance_; +}; +// ------------------------------------------------------------------- + +class PrimitiveGroup : public ::google::protobuf::Message { + public: + PrimitiveGroup(); + virtual ~PrimitiveGroup(); + + PrimitiveGroup(const PrimitiveGroup& from); + + inline PrimitiveGroup& operator=(const PrimitiveGroup& 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 PrimitiveGroup& default_instance(); + + void Swap(PrimitiveGroup* other); + + // implements Message ---------------------------------------------- + + PrimitiveGroup* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const PrimitiveGroup& from); + void MergeFrom(const PrimitiveGroup& 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 ------------------------------------------------------- + + // repeated .OSMPBF.Node nodes = 1; + inline int nodes_size() const; + inline void clear_nodes(); + static const int kNodesFieldNumber = 1; + inline const ::OSMPBF::Node& nodes(int index) const; + inline ::OSMPBF::Node* mutable_nodes(int index); + inline ::OSMPBF::Node* add_nodes(); + inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::Node >& + nodes() const; + inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::Node >* + mutable_nodes(); + + // optional .OSMPBF.DenseNodes dense = 2; + inline bool has_dense() const; + inline void clear_dense(); + static const int kDenseFieldNumber = 2; + inline const ::OSMPBF::DenseNodes& dense() const; + inline ::OSMPBF::DenseNodes* mutable_dense(); + + // repeated .OSMPBF.Way ways = 3; + inline int ways_size() const; + inline void clear_ways(); + static const int kWaysFieldNumber = 3; + inline const ::OSMPBF::Way& ways(int index) const; + inline ::OSMPBF::Way* mutable_ways(int index); + inline ::OSMPBF::Way* add_ways(); + inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::Way >& + ways() const; + inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::Way >* + mutable_ways(); + + // repeated .OSMPBF.Relation relations = 4; + inline int relations_size() const; + inline void clear_relations(); + static const int kRelationsFieldNumber = 4; + inline const ::OSMPBF::Relation& relations(int index) const; + inline ::OSMPBF::Relation* mutable_relations(int index); + inline ::OSMPBF::Relation* add_relations(); + inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::Relation >& + relations() const; + inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::Relation >* + mutable_relations(); + + // repeated .OSMPBF.ChangeSet changesets = 5; + inline int changesets_size() const; + inline void clear_changesets(); + static const int kChangesetsFieldNumber = 5; + inline const ::OSMPBF::ChangeSet& changesets(int index) const; + inline ::OSMPBF::ChangeSet* mutable_changesets(int index); + inline ::OSMPBF::ChangeSet* add_changesets(); + inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::ChangeSet >& + changesets() const; + inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::ChangeSet >* + mutable_changesets(); + + // @@protoc_insertion_point(class_scope:OSMPBF.PrimitiveGroup) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::RepeatedPtrField< ::OSMPBF::Node > nodes_; + ::OSMPBF::DenseNodes* dense_; + ::google::protobuf::RepeatedPtrField< ::OSMPBF::Way > ways_; + ::google::protobuf::RepeatedPtrField< ::OSMPBF::Relation > relations_; + ::google::protobuf::RepeatedPtrField< ::OSMPBF::ChangeSet > changesets_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_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 PrimitiveGroup* default_instance_; +}; +// ------------------------------------------------------------------- + +class StringTable : public ::google::protobuf::Message { + public: + StringTable(); + virtual ~StringTable(); + + StringTable(const StringTable& from); + + inline StringTable& operator=(const StringTable& 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 StringTable& default_instance(); + + void Swap(StringTable* other); + + // implements Message ---------------------------------------------- + + StringTable* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const StringTable& from); + void MergeFrom(const StringTable& 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 ------------------------------------------------------- + + // repeated bytes s = 1; + inline int s_size() const; + inline void clear_s(); + static const int kSFieldNumber = 1; + inline const ::std::string& s(int index) const; + inline ::std::string* mutable_s(int index); + inline void set_s(int index, const ::std::string& value); + inline void set_s(int index, const char* value); + inline void set_s(int index, const void* value, size_t size); + inline ::std::string* add_s(); + inline void add_s(const ::std::string& value); + inline void add_s(const char* value); + inline void add_s(const void* value, size_t size); + inline const ::google::protobuf::RepeatedPtrField< ::std::string>& s() const; + inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_s(); + + // @@protoc_insertion_point(class_scope:OSMPBF.StringTable) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::RepeatedPtrField< ::std::string> s_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_2eproto(); + + ::google::protobuf::uint32 _has_bits_[(1 + 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 StringTable* default_instance_; +}; +// ------------------------------------------------------------------- + +class Info : public ::google::protobuf::Message { + public: + Info(); + virtual ~Info(); + + Info(const Info& from); + + inline Info& operator=(const Info& 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 Info& default_instance(); + + void Swap(Info* other); + + // implements Message ---------------------------------------------- + + Info* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Info& from); + void MergeFrom(const Info& 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 int32 version = 1 [default = -1]; + inline bool has_version() const; + inline void clear_version(); + static const int kVersionFieldNumber = 1; + inline ::google::protobuf::int32 version() const; + inline void set_version(::google::protobuf::int32 value); + + // optional int64 timestamp = 2; + inline bool has_timestamp() const; + inline void clear_timestamp(); + static const int kTimestampFieldNumber = 2; + inline ::google::protobuf::int64 timestamp() const; + inline void set_timestamp(::google::protobuf::int64 value); + + // optional int64 changeset = 3; + inline bool has_changeset() const; + inline void clear_changeset(); + static const int kChangesetFieldNumber = 3; + inline ::google::protobuf::int64 changeset() const; + inline void set_changeset(::google::protobuf::int64 value); + + // optional int32 uid = 4; + inline bool has_uid() const; + inline void clear_uid(); + static const int kUidFieldNumber = 4; + inline ::google::protobuf::int32 uid() const; + inline void set_uid(::google::protobuf::int32 value); + + // optional uint32 user_sid = 5; + inline bool has_user_sid() const; + inline void clear_user_sid(); + static const int kUserSidFieldNumber = 5; + inline ::google::protobuf::uint32 user_sid() const; + inline void set_user_sid(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:OSMPBF.Info) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::int32 version_; + ::google::protobuf::int64 timestamp_; + ::google::protobuf::int64 changeset_; + ::google::protobuf::int32 uid_; + ::google::protobuf::uint32 user_sid_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_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 Info* default_instance_; +}; +// ------------------------------------------------------------------- + +class DenseInfo : public ::google::protobuf::Message { + public: + DenseInfo(); + virtual ~DenseInfo(); + + DenseInfo(const DenseInfo& from); + + inline DenseInfo& operator=(const DenseInfo& 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 DenseInfo& default_instance(); + + void Swap(DenseInfo* other); + + // implements Message ---------------------------------------------- + + DenseInfo* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DenseInfo& from); + void MergeFrom(const DenseInfo& 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 ------------------------------------------------------- + + // repeated int32 version = 1 [packed = true]; + inline int version_size() const; + inline void clear_version(); + static const int kVersionFieldNumber = 1; + inline ::google::protobuf::int32 version(int index) const; + inline void set_version(int index, ::google::protobuf::int32 value); + inline void add_version(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + version() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_version(); + + // repeated sint64 timestamp = 2 [packed = true]; + inline int timestamp_size() const; + inline void clear_timestamp(); + static const int kTimestampFieldNumber = 2; + inline ::google::protobuf::int64 timestamp(int index) const; + inline void set_timestamp(int index, ::google::protobuf::int64 value); + inline void add_timestamp(::google::protobuf::int64 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + timestamp() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_timestamp(); + + // repeated sint64 changeset = 3 [packed = true]; + inline int changeset_size() const; + inline void clear_changeset(); + static const int kChangesetFieldNumber = 3; + inline ::google::protobuf::int64 changeset(int index) const; + inline void set_changeset(int index, ::google::protobuf::int64 value); + inline void add_changeset(::google::protobuf::int64 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + changeset() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_changeset(); + + // repeated sint32 uid = 4 [packed = true]; + inline int uid_size() const; + inline void clear_uid(); + static const int kUidFieldNumber = 4; + inline ::google::protobuf::int32 uid(int index) const; + inline void set_uid(int index, ::google::protobuf::int32 value); + inline void add_uid(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + uid() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_uid(); + + // repeated sint32 user_sid = 5 [packed = true]; + inline int user_sid_size() const; + inline void clear_user_sid(); + static const int kUserSidFieldNumber = 5; + inline ::google::protobuf::int32 user_sid(int index) const; + inline void set_user_sid(int index, ::google::protobuf::int32 value); + inline void add_user_sid(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + user_sid() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_user_sid(); + + // @@protoc_insertion_point(class_scope:OSMPBF.DenseInfo) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > version_; + mutable int _version_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > timestamp_; + mutable int _timestamp_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > changeset_; + mutable int _changeset_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > uid_; + mutable int _uid_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > user_sid_; + mutable int _user_sid_cached_byte_size_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_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 DenseInfo* default_instance_; +}; +// ------------------------------------------------------------------- + +class ChangeSet : public ::google::protobuf::Message { + public: + ChangeSet(); + virtual ~ChangeSet(); + + ChangeSet(const ChangeSet& from); + + inline ChangeSet& operator=(const ChangeSet& 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 ChangeSet& default_instance(); + + void Swap(ChangeSet* other); + + // implements Message ---------------------------------------------- + + ChangeSet* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ChangeSet& from); + void MergeFrom(const ChangeSet& 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 int64 id = 1; + inline bool has_id() const; + inline void clear_id(); + static const int kIdFieldNumber = 1; + inline ::google::protobuf::int64 id() const; + inline void set_id(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:OSMPBF.ChangeSet) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::int64 id_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_2eproto(); + + ::google::protobuf::uint32 _has_bits_[(1 + 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 ChangeSet* default_instance_; +}; +// ------------------------------------------------------------------- + +class Node : public ::google::protobuf::Message { + public: + Node(); + virtual ~Node(); + + Node(const Node& from); + + inline Node& operator=(const Node& 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 Node& default_instance(); + + void Swap(Node* other); + + // implements Message ---------------------------------------------- + + Node* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Node& from); + void MergeFrom(const Node& 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 sint64 id = 1; + inline bool has_id() const; + inline void clear_id(); + static const int kIdFieldNumber = 1; + inline ::google::protobuf::int64 id() const; + inline void set_id(::google::protobuf::int64 value); + + // repeated uint32 keys = 2 [packed = true]; + inline int keys_size() const; + inline void clear_keys(); + static const int kKeysFieldNumber = 2; + inline ::google::protobuf::uint32 keys(int index) const; + inline void set_keys(int index, ::google::protobuf::uint32 value); + inline void add_keys(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + keys() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_keys(); + + // repeated uint32 vals = 3 [packed = true]; + inline int vals_size() const; + inline void clear_vals(); + static const int kValsFieldNumber = 3; + inline ::google::protobuf::uint32 vals(int index) const; + inline void set_vals(int index, ::google::protobuf::uint32 value); + inline void add_vals(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + vals() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_vals(); + + // optional .OSMPBF.Info info = 4; + inline bool has_info() const; + inline void clear_info(); + static const int kInfoFieldNumber = 4; + inline const ::OSMPBF::Info& info() const; + inline ::OSMPBF::Info* mutable_info(); + + // required sint64 lat = 8; + inline bool has_lat() const; + inline void clear_lat(); + static const int kLatFieldNumber = 8; + inline ::google::protobuf::int64 lat() const; + inline void set_lat(::google::protobuf::int64 value); + + // required sint64 lon = 9; + inline bool has_lon() const; + inline void clear_lon(); + static const int kLonFieldNumber = 9; + inline ::google::protobuf::int64 lon() const; + inline void set_lon(::google::protobuf::int64 value); + + // @@protoc_insertion_point(class_scope:OSMPBF.Node) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::int64 id_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > keys_; + mutable int _keys_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > vals_; + mutable int _vals_cached_byte_size_; + ::OSMPBF::Info* info_; + ::google::protobuf::int64 lat_; + ::google::protobuf::int64 lon_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_2eproto(); + + ::google::protobuf::uint32 _has_bits_[(6 + 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 Node* default_instance_; +}; +// ------------------------------------------------------------------- + +class DenseNodes : public ::google::protobuf::Message { + public: + DenseNodes(); + virtual ~DenseNodes(); + + DenseNodes(const DenseNodes& from); + + inline DenseNodes& operator=(const DenseNodes& 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 DenseNodes& default_instance(); + + void Swap(DenseNodes* other); + + // implements Message ---------------------------------------------- + + DenseNodes* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DenseNodes& from); + void MergeFrom(const DenseNodes& 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 ------------------------------------------------------- + + // repeated sint64 id = 1 [packed = true]; + inline int id_size() const; + inline void clear_id(); + static const int kIdFieldNumber = 1; + inline ::google::protobuf::int64 id(int index) const; + inline void set_id(int index, ::google::protobuf::int64 value); + inline void add_id(::google::protobuf::int64 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + id() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_id(); + + // optional .OSMPBF.DenseInfo denseinfo = 5; + inline bool has_denseinfo() const; + inline void clear_denseinfo(); + static const int kDenseinfoFieldNumber = 5; + inline const ::OSMPBF::DenseInfo& denseinfo() const; + inline ::OSMPBF::DenseInfo* mutable_denseinfo(); + + // repeated sint64 lat = 8 [packed = true]; + inline int lat_size() const; + inline void clear_lat(); + static const int kLatFieldNumber = 8; + inline ::google::protobuf::int64 lat(int index) const; + inline void set_lat(int index, ::google::protobuf::int64 value); + inline void add_lat(::google::protobuf::int64 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + lat() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_lat(); + + // repeated sint64 lon = 9 [packed = true]; + inline int lon_size() const; + inline void clear_lon(); + static const int kLonFieldNumber = 9; + inline ::google::protobuf::int64 lon(int index) const; + inline void set_lon(int index, ::google::protobuf::int64 value); + inline void add_lon(::google::protobuf::int64 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + lon() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_lon(); + + // repeated int32 keys_vals = 10 [packed = true]; + inline int keys_vals_size() const; + inline void clear_keys_vals(); + static const int kKeysValsFieldNumber = 10; + inline ::google::protobuf::int32 keys_vals(int index) const; + inline void set_keys_vals(int index, ::google::protobuf::int32 value); + inline void add_keys_vals(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + keys_vals() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_keys_vals(); + + // @@protoc_insertion_point(class_scope:OSMPBF.DenseNodes) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > id_; + mutable int _id_cached_byte_size_; + ::OSMPBF::DenseInfo* denseinfo_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > lat_; + mutable int _lat_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > lon_; + mutable int _lon_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > keys_vals_; + mutable int _keys_vals_cached_byte_size_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_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 DenseNodes* default_instance_; +}; +// ------------------------------------------------------------------- + +class Way : public ::google::protobuf::Message { + public: + Way(); + virtual ~Way(); + + Way(const Way& from); + + inline Way& operator=(const Way& 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 Way& default_instance(); + + void Swap(Way* other); + + // implements Message ---------------------------------------------- + + Way* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Way& from); + void MergeFrom(const Way& 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 int64 id = 1; + inline bool has_id() const; + inline void clear_id(); + static const int kIdFieldNumber = 1; + inline ::google::protobuf::int64 id() const; + inline void set_id(::google::protobuf::int64 value); + + // repeated uint32 keys = 2 [packed = true]; + inline int keys_size() const; + inline void clear_keys(); + static const int kKeysFieldNumber = 2; + inline ::google::protobuf::uint32 keys(int index) const; + inline void set_keys(int index, ::google::protobuf::uint32 value); + inline void add_keys(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + keys() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_keys(); + + // repeated uint32 vals = 3 [packed = true]; + inline int vals_size() const; + inline void clear_vals(); + static const int kValsFieldNumber = 3; + inline ::google::protobuf::uint32 vals(int index) const; + inline void set_vals(int index, ::google::protobuf::uint32 value); + inline void add_vals(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + vals() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_vals(); + + // optional .OSMPBF.Info info = 4; + inline bool has_info() const; + inline void clear_info(); + static const int kInfoFieldNumber = 4; + inline const ::OSMPBF::Info& info() const; + inline ::OSMPBF::Info* mutable_info(); + + // repeated sint64 refs = 8 [packed = true]; + inline int refs_size() const; + inline void clear_refs(); + static const int kRefsFieldNumber = 8; + inline ::google::protobuf::int64 refs(int index) const; + inline void set_refs(int index, ::google::protobuf::int64 value); + inline void add_refs(::google::protobuf::int64 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + refs() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_refs(); + + // @@protoc_insertion_point(class_scope:OSMPBF.Way) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::int64 id_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > keys_; + mutable int _keys_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > vals_; + mutable int _vals_cached_byte_size_; + ::OSMPBF::Info* info_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > refs_; + mutable int _refs_cached_byte_size_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_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 Way* default_instance_; +}; +// ------------------------------------------------------------------- + +class Relation : public ::google::protobuf::Message { + public: + Relation(); + virtual ~Relation(); + + Relation(const Relation& from); + + inline Relation& operator=(const Relation& 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 Relation& default_instance(); + + void Swap(Relation* other); + + // implements Message ---------------------------------------------- + + Relation* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Relation& from); + void MergeFrom(const Relation& 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 ---------------------------------------------------- + + typedef Relation_MemberType MemberType; + static const MemberType NODE = Relation_MemberType_NODE; + static const MemberType WAY = Relation_MemberType_WAY; + static const MemberType RELATION = Relation_MemberType_RELATION; + static inline bool MemberType_IsValid(int value) { + return Relation_MemberType_IsValid(value); + } + static const MemberType MemberType_MIN = + Relation_MemberType_MemberType_MIN; + static const MemberType MemberType_MAX = + Relation_MemberType_MemberType_MAX; + static const int MemberType_ARRAYSIZE = + Relation_MemberType_MemberType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + MemberType_descriptor() { + return Relation_MemberType_descriptor(); + } + static inline const ::std::string& MemberType_Name(MemberType value) { + return Relation_MemberType_Name(value); + } + static inline bool MemberType_Parse(const ::std::string& name, + MemberType* value) { + return Relation_MemberType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // required int64 id = 1; + inline bool has_id() const; + inline void clear_id(); + static const int kIdFieldNumber = 1; + inline ::google::protobuf::int64 id() const; + inline void set_id(::google::protobuf::int64 value); + + // repeated uint32 keys = 2 [packed = true]; + inline int keys_size() const; + inline void clear_keys(); + static const int kKeysFieldNumber = 2; + inline ::google::protobuf::uint32 keys(int index) const; + inline void set_keys(int index, ::google::protobuf::uint32 value); + inline void add_keys(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + keys() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_keys(); + + // repeated uint32 vals = 3 [packed = true]; + inline int vals_size() const; + inline void clear_vals(); + static const int kValsFieldNumber = 3; + inline ::google::protobuf::uint32 vals(int index) const; + inline void set_vals(int index, ::google::protobuf::uint32 value); + inline void add_vals(::google::protobuf::uint32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& + vals() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* + mutable_vals(); + + // optional .OSMPBF.Info info = 4; + inline bool has_info() const; + inline void clear_info(); + static const int kInfoFieldNumber = 4; + inline const ::OSMPBF::Info& info() const; + inline ::OSMPBF::Info* mutable_info(); + + // repeated int32 roles_sid = 8 [packed = true]; + inline int roles_sid_size() const; + inline void clear_roles_sid(); + static const int kRolesSidFieldNumber = 8; + inline ::google::protobuf::int32 roles_sid(int index) const; + inline void set_roles_sid(int index, ::google::protobuf::int32 value); + inline void add_roles_sid(::google::protobuf::int32 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + roles_sid() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_roles_sid(); + + // repeated sint64 memids = 9 [packed = true]; + inline int memids_size() const; + inline void clear_memids(); + static const int kMemidsFieldNumber = 9; + inline ::google::protobuf::int64 memids(int index) const; + inline void set_memids(int index, ::google::protobuf::int64 value); + inline void add_memids(::google::protobuf::int64 value); + inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& + memids() const; + inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* + mutable_memids(); + + // repeated .OSMPBF.Relation.MemberType types = 10 [packed = true]; + inline int types_size() const; + inline void clear_types(); + static const int kTypesFieldNumber = 10; + inline ::OSMPBF::Relation_MemberType types(int index) const; + inline void set_types(int index, ::OSMPBF::Relation_MemberType value); + inline void add_types(::OSMPBF::Relation_MemberType value); + inline const ::google::protobuf::RepeatedField& types() const; + inline ::google::protobuf::RepeatedField* mutable_types(); + + // @@protoc_insertion_point(class_scope:OSMPBF.Relation) + private: + ::google::protobuf::UnknownFieldSet _unknown_fields_; + mutable int _cached_size_; + + ::google::protobuf::int64 id_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > keys_; + mutable int _keys_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > vals_; + mutable int _vals_cached_byte_size_; + ::OSMPBF::Info* info_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > roles_sid_; + mutable int _roles_sid_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int64 > memids_; + mutable int _memids_cached_byte_size_; + ::google::protobuf::RepeatedField types_; + mutable int _types_cached_byte_size_; + friend void protobuf_AddDesc_osmformat_2eproto(); + friend void protobuf_AssignDesc_osmformat_2eproto(); + friend void protobuf_ShutdownFile_osmformat_2eproto(); + + ::google::protobuf::uint32 _has_bits_[(7 + 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 Relation* default_instance_; +}; +// =================================================================== + + +// =================================================================== + +// HeaderBlock + +// optional .OSMPBF.HeaderBBox bbox = 1; +inline bool HeaderBlock::has_bbox() const { + return _has_bit(0); +} +inline void HeaderBlock::clear_bbox() { + if (bbox_ != NULL) bbox_->::OSMPBF::HeaderBBox::Clear(); + _clear_bit(0); +} +inline const ::OSMPBF::HeaderBBox& HeaderBlock::bbox() const { + return bbox_ != NULL ? *bbox_ : *default_instance_->bbox_; +} +inline ::OSMPBF::HeaderBBox* HeaderBlock::mutable_bbox() { + _set_bit(0); + if (bbox_ == NULL) bbox_ = new ::OSMPBF::HeaderBBox; + return bbox_; +} + +// repeated string required_features = 4; +inline int HeaderBlock::required_features_size() const { + return required_features_.size(); +} +inline void HeaderBlock::clear_required_features() { + required_features_.Clear(); +} +inline const ::std::string& HeaderBlock::required_features(int index) const { + return required_features_.Get(index); +} +inline ::std::string* HeaderBlock::mutable_required_features(int index) { + return required_features_.Mutable(index); +} +inline void HeaderBlock::set_required_features(int index, const ::std::string& value) { + required_features_.Mutable(index)->assign(value); +} +inline void HeaderBlock::set_required_features(int index, const char* value) { + required_features_.Mutable(index)->assign(value); +} +inline void HeaderBlock::set_required_features(int index, const char* value, size_t size) { + required_features_.Mutable(index)->assign( + reinterpret_cast(value), size); +} +inline ::std::string* HeaderBlock::add_required_features() { + return required_features_.Add(); +} +inline void HeaderBlock::add_required_features(const ::std::string& value) { + required_features_.Add()->assign(value); +} +inline void HeaderBlock::add_required_features(const char* value) { + required_features_.Add()->assign(value); +} +inline void HeaderBlock::add_required_features(const char* value, size_t size) { + required_features_.Add()->assign(reinterpret_cast(value), size); +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +HeaderBlock::required_features() const { + return required_features_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +HeaderBlock::mutable_required_features() { + return &required_features_; +} + +// repeated string optional_features = 5; +inline int HeaderBlock::optional_features_size() const { + return optional_features_.size(); +} +inline void HeaderBlock::clear_optional_features() { + optional_features_.Clear(); +} +inline const ::std::string& HeaderBlock::optional_features(int index) const { + return optional_features_.Get(index); +} +inline ::std::string* HeaderBlock::mutable_optional_features(int index) { + return optional_features_.Mutable(index); +} +inline void HeaderBlock::set_optional_features(int index, const ::std::string& value) { + optional_features_.Mutable(index)->assign(value); +} +inline void HeaderBlock::set_optional_features(int index, const char* value) { + optional_features_.Mutable(index)->assign(value); +} +inline void HeaderBlock::set_optional_features(int index, const char* value, size_t size) { + optional_features_.Mutable(index)->assign( + reinterpret_cast(value), size); +} +inline ::std::string* HeaderBlock::add_optional_features() { + return optional_features_.Add(); +} +inline void HeaderBlock::add_optional_features(const ::std::string& value) { + optional_features_.Add()->assign(value); +} +inline void HeaderBlock::add_optional_features(const char* value) { + optional_features_.Add()->assign(value); +} +inline void HeaderBlock::add_optional_features(const char* value, size_t size) { + optional_features_.Add()->assign(reinterpret_cast(value), size); +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +HeaderBlock::optional_features() const { + return optional_features_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +HeaderBlock::mutable_optional_features() { + return &optional_features_; +} + +// optional string writingprogram = 16; +inline bool HeaderBlock::has_writingprogram() const { + return _has_bit(3); +} +inline void HeaderBlock::clear_writingprogram() { + if (writingprogram_ != &_default_writingprogram_) { + writingprogram_->clear(); + } + _clear_bit(3); +} +inline const ::std::string& HeaderBlock::writingprogram() const { + return *writingprogram_; +} +inline void HeaderBlock::set_writingprogram(const ::std::string& value) { + _set_bit(3); + if (writingprogram_ == &_default_writingprogram_) { + writingprogram_ = new ::std::string; + } + writingprogram_->assign(value); +} +inline void HeaderBlock::set_writingprogram(const char* value) { + _set_bit(3); + if (writingprogram_ == &_default_writingprogram_) { + writingprogram_ = new ::std::string; + } + writingprogram_->assign(value); +} +inline void HeaderBlock::set_writingprogram(const char* value, size_t size) { + _set_bit(3); + if (writingprogram_ == &_default_writingprogram_) { + writingprogram_ = new ::std::string; + } + writingprogram_->assign(reinterpret_cast(value), size); +} +inline ::std::string* HeaderBlock::mutable_writingprogram() { + _set_bit(3); + if (writingprogram_ == &_default_writingprogram_) { + writingprogram_ = new ::std::string; + } + return writingprogram_; +} + +// optional string source = 17; +inline bool HeaderBlock::has_source() const { + return _has_bit(4); +} +inline void HeaderBlock::clear_source() { + if (source_ != &_default_source_) { + source_->clear(); + } + _clear_bit(4); +} +inline const ::std::string& HeaderBlock::source() const { + return *source_; +} +inline void HeaderBlock::set_source(const ::std::string& value) { + _set_bit(4); + if (source_ == &_default_source_) { + source_ = new ::std::string; + } + source_->assign(value); +} +inline void HeaderBlock::set_source(const char* value) { + _set_bit(4); + if (source_ == &_default_source_) { + source_ = new ::std::string; + } + source_->assign(value); +} +inline void HeaderBlock::set_source(const char* value, size_t size) { + _set_bit(4); + if (source_ == &_default_source_) { + source_ = new ::std::string; + } + source_->assign(reinterpret_cast(value), size); +} +inline ::std::string* HeaderBlock::mutable_source() { + _set_bit(4); + if (source_ == &_default_source_) { + source_ = new ::std::string; + } + return source_; +} + +// ------------------------------------------------------------------- + +// HeaderBBox + +// required sint64 left = 1; +inline bool HeaderBBox::has_left() const { + return _has_bit(0); +} +inline void HeaderBBox::clear_left() { + left_ = GOOGLE_LONGLONG(0); + _clear_bit(0); +} +inline ::google::protobuf::int64 HeaderBBox::left() const { + return left_; +} +inline void HeaderBBox::set_left(::google::protobuf::int64 value) { + _set_bit(0); + left_ = value; +} + +// required sint64 right = 2; +inline bool HeaderBBox::has_right() const { + return _has_bit(1); +} +inline void HeaderBBox::clear_right() { + right_ = GOOGLE_LONGLONG(0); + _clear_bit(1); +} +inline ::google::protobuf::int64 HeaderBBox::right() const { + return right_; +} +inline void HeaderBBox::set_right(::google::protobuf::int64 value) { + _set_bit(1); + right_ = value; +} + +// required sint64 top = 3; +inline bool HeaderBBox::has_top() const { + return _has_bit(2); +} +inline void HeaderBBox::clear_top() { + top_ = GOOGLE_LONGLONG(0); + _clear_bit(2); +} +inline ::google::protobuf::int64 HeaderBBox::top() const { + return top_; +} +inline void HeaderBBox::set_top(::google::protobuf::int64 value) { + _set_bit(2); + top_ = value; +} + +// required sint64 bottom = 4; +inline bool HeaderBBox::has_bottom() const { + return _has_bit(3); +} +inline void HeaderBBox::clear_bottom() { + bottom_ = GOOGLE_LONGLONG(0); + _clear_bit(3); +} +inline ::google::protobuf::int64 HeaderBBox::bottom() const { + return bottom_; +} +inline void HeaderBBox::set_bottom(::google::protobuf::int64 value) { + _set_bit(3); + bottom_ = value; +} + +// ------------------------------------------------------------------- + +// PrimitiveBlock + +// required .OSMPBF.StringTable stringtable = 1; +inline bool PrimitiveBlock::has_stringtable() const { + return _has_bit(0); +} +inline void PrimitiveBlock::clear_stringtable() { + if (stringtable_ != NULL) stringtable_->::OSMPBF::StringTable::Clear(); + _clear_bit(0); +} +inline const ::OSMPBF::StringTable& PrimitiveBlock::stringtable() const { + return stringtable_ != NULL ? *stringtable_ : *default_instance_->stringtable_; +} +inline ::OSMPBF::StringTable* PrimitiveBlock::mutable_stringtable() { + _set_bit(0); + if (stringtable_ == NULL) stringtable_ = new ::OSMPBF::StringTable; + return stringtable_; +} + +// repeated .OSMPBF.PrimitiveGroup primitivegroup = 2; +inline int PrimitiveBlock::primitivegroup_size() const { + return primitivegroup_.size(); +} +inline void PrimitiveBlock::clear_primitivegroup() { + primitivegroup_.Clear(); +} +inline const ::OSMPBF::PrimitiveGroup& PrimitiveBlock::primitivegroup(int index) const { + return primitivegroup_.Get(index); +} +inline ::OSMPBF::PrimitiveGroup* PrimitiveBlock::mutable_primitivegroup(int index) { + return primitivegroup_.Mutable(index); +} +inline ::OSMPBF::PrimitiveGroup* PrimitiveBlock::add_primitivegroup() { + return primitivegroup_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::PrimitiveGroup >& +PrimitiveBlock::primitivegroup() const { + return primitivegroup_; +} +inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::PrimitiveGroup >* +PrimitiveBlock::mutable_primitivegroup() { + return &primitivegroup_; +} + +// optional int32 granularity = 17 [default = 100]; +inline bool PrimitiveBlock::has_granularity() const { + return _has_bit(2); +} +inline void PrimitiveBlock::clear_granularity() { + granularity_ = 100; + _clear_bit(2); +} +inline ::google::protobuf::int32 PrimitiveBlock::granularity() const { + return granularity_; +} +inline void PrimitiveBlock::set_granularity(::google::protobuf::int32 value) { + _set_bit(2); + granularity_ = value; +} + +// optional int64 lat_offset = 19 [default = 0]; +inline bool PrimitiveBlock::has_lat_offset() const { + return _has_bit(3); +} +inline void PrimitiveBlock::clear_lat_offset() { + lat_offset_ = GOOGLE_LONGLONG(0); + _clear_bit(3); +} +inline ::google::protobuf::int64 PrimitiveBlock::lat_offset() const { + return lat_offset_; +} +inline void PrimitiveBlock::set_lat_offset(::google::protobuf::int64 value) { + _set_bit(3); + lat_offset_ = value; +} + +// optional int64 lon_offset = 20 [default = 0]; +inline bool PrimitiveBlock::has_lon_offset() const { + return _has_bit(4); +} +inline void PrimitiveBlock::clear_lon_offset() { + lon_offset_ = GOOGLE_LONGLONG(0); + _clear_bit(4); +} +inline ::google::protobuf::int64 PrimitiveBlock::lon_offset() const { + return lon_offset_; +} +inline void PrimitiveBlock::set_lon_offset(::google::protobuf::int64 value) { + _set_bit(4); + lon_offset_ = value; +} + +// optional int32 date_granularity = 18 [default = 1000]; +inline bool PrimitiveBlock::has_date_granularity() const { + return _has_bit(5); +} +inline void PrimitiveBlock::clear_date_granularity() { + date_granularity_ = 1000; + _clear_bit(5); +} +inline ::google::protobuf::int32 PrimitiveBlock::date_granularity() const { + return date_granularity_; +} +inline void PrimitiveBlock::set_date_granularity(::google::protobuf::int32 value) { + _set_bit(5); + date_granularity_ = value; +} + +// ------------------------------------------------------------------- + +// PrimitiveGroup + +// repeated .OSMPBF.Node nodes = 1; +inline int PrimitiveGroup::nodes_size() const { + return nodes_.size(); +} +inline void PrimitiveGroup::clear_nodes() { + nodes_.Clear(); +} +inline const ::OSMPBF::Node& PrimitiveGroup::nodes(int index) const { + return nodes_.Get(index); +} +inline ::OSMPBF::Node* PrimitiveGroup::mutable_nodes(int index) { + return nodes_.Mutable(index); +} +inline ::OSMPBF::Node* PrimitiveGroup::add_nodes() { + return nodes_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::Node >& +PrimitiveGroup::nodes() const { + return nodes_; +} +inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::Node >* +PrimitiveGroup::mutable_nodes() { + return &nodes_; +} + +// optional .OSMPBF.DenseNodes dense = 2; +inline bool PrimitiveGroup::has_dense() const { + return _has_bit(1); +} +inline void PrimitiveGroup::clear_dense() { + if (dense_ != NULL) dense_->::OSMPBF::DenseNodes::Clear(); + _clear_bit(1); +} +inline const ::OSMPBF::DenseNodes& PrimitiveGroup::dense() const { + return dense_ != NULL ? *dense_ : *default_instance_->dense_; +} +inline ::OSMPBF::DenseNodes* PrimitiveGroup::mutable_dense() { + _set_bit(1); + if (dense_ == NULL) dense_ = new ::OSMPBF::DenseNodes; + return dense_; +} + +// repeated .OSMPBF.Way ways = 3; +inline int PrimitiveGroup::ways_size() const { + return ways_.size(); +} +inline void PrimitiveGroup::clear_ways() { + ways_.Clear(); +} +inline const ::OSMPBF::Way& PrimitiveGroup::ways(int index) const { + return ways_.Get(index); +} +inline ::OSMPBF::Way* PrimitiveGroup::mutable_ways(int index) { + return ways_.Mutable(index); +} +inline ::OSMPBF::Way* PrimitiveGroup::add_ways() { + return ways_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::Way >& +PrimitiveGroup::ways() const { + return ways_; +} +inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::Way >* +PrimitiveGroup::mutable_ways() { + return &ways_; +} + +// repeated .OSMPBF.Relation relations = 4; +inline int PrimitiveGroup::relations_size() const { + return relations_.size(); +} +inline void PrimitiveGroup::clear_relations() { + relations_.Clear(); +} +inline const ::OSMPBF::Relation& PrimitiveGroup::relations(int index) const { + return relations_.Get(index); +} +inline ::OSMPBF::Relation* PrimitiveGroup::mutable_relations(int index) { + return relations_.Mutable(index); +} +inline ::OSMPBF::Relation* PrimitiveGroup::add_relations() { + return relations_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::Relation >& +PrimitiveGroup::relations() const { + return relations_; +} +inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::Relation >* +PrimitiveGroup::mutable_relations() { + return &relations_; +} + +// repeated .OSMPBF.ChangeSet changesets = 5; +inline int PrimitiveGroup::changesets_size() const { + return changesets_.size(); +} +inline void PrimitiveGroup::clear_changesets() { + changesets_.Clear(); +} +inline const ::OSMPBF::ChangeSet& PrimitiveGroup::changesets(int index) const { + return changesets_.Get(index); +} +inline ::OSMPBF::ChangeSet* PrimitiveGroup::mutable_changesets(int index) { + return changesets_.Mutable(index); +} +inline ::OSMPBF::ChangeSet* PrimitiveGroup::add_changesets() { + return changesets_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::OSMPBF::ChangeSet >& +PrimitiveGroup::changesets() const { + return changesets_; +} +inline ::google::protobuf::RepeatedPtrField< ::OSMPBF::ChangeSet >* +PrimitiveGroup::mutable_changesets() { + return &changesets_; +} + +// ------------------------------------------------------------------- + +// StringTable + +// repeated bytes s = 1; +inline int StringTable::s_size() const { + return s_.size(); +} +inline void StringTable::clear_s() { + s_.Clear(); +} +inline const ::std::string& StringTable::s(int index) const { + return s_.Get(index); +} +inline ::std::string* StringTable::mutable_s(int index) { + return s_.Mutable(index); +} +inline void StringTable::set_s(int index, const ::std::string& value) { + s_.Mutable(index)->assign(value); +} +inline void StringTable::set_s(int index, const char* value) { + s_.Mutable(index)->assign(value); +} +inline void StringTable::set_s(int index, const void* value, size_t size) { + s_.Mutable(index)->assign( + reinterpret_cast(value), size); +} +inline ::std::string* StringTable::add_s() { + return s_.Add(); +} +inline void StringTable::add_s(const ::std::string& value) { + s_.Add()->assign(value); +} +inline void StringTable::add_s(const char* value) { + s_.Add()->assign(value); +} +inline void StringTable::add_s(const void* value, size_t size) { + s_.Add()->assign(reinterpret_cast(value), size); +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +StringTable::s() const { + return s_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +StringTable::mutable_s() { + return &s_; +} + +// ------------------------------------------------------------------- + +// Info + +// optional int32 version = 1 [default = -1]; +inline bool Info::has_version() const { + return _has_bit(0); +} +inline void Info::clear_version() { + version_ = -1; + _clear_bit(0); +} +inline ::google::protobuf::int32 Info::version() const { + return version_; +} +inline void Info::set_version(::google::protobuf::int32 value) { + _set_bit(0); + version_ = value; +} + +// optional int64 timestamp = 2; +inline bool Info::has_timestamp() const { + return _has_bit(1); +} +inline void Info::clear_timestamp() { + timestamp_ = GOOGLE_LONGLONG(0); + _clear_bit(1); +} +inline ::google::protobuf::int64 Info::timestamp() const { + return timestamp_; +} +inline void Info::set_timestamp(::google::protobuf::int64 value) { + _set_bit(1); + timestamp_ = value; +} + +// optional int64 changeset = 3; +inline bool Info::has_changeset() const { + return _has_bit(2); +} +inline void Info::clear_changeset() { + changeset_ = GOOGLE_LONGLONG(0); + _clear_bit(2); +} +inline ::google::protobuf::int64 Info::changeset() const { + return changeset_; +} +inline void Info::set_changeset(::google::protobuf::int64 value) { + _set_bit(2); + changeset_ = value; +} + +// optional int32 uid = 4; +inline bool Info::has_uid() const { + return _has_bit(3); +} +inline void Info::clear_uid() { + uid_ = 0; + _clear_bit(3); +} +inline ::google::protobuf::int32 Info::uid() const { + return uid_; +} +inline void Info::set_uid(::google::protobuf::int32 value) { + _set_bit(3); + uid_ = value; +} + +// optional uint32 user_sid = 5; +inline bool Info::has_user_sid() const { + return _has_bit(4); +} +inline void Info::clear_user_sid() { + user_sid_ = 0u; + _clear_bit(4); +} +inline ::google::protobuf::uint32 Info::user_sid() const { + return user_sid_; +} +inline void Info::set_user_sid(::google::protobuf::uint32 value) { + _set_bit(4); + user_sid_ = value; +} + +// ------------------------------------------------------------------- + +// DenseInfo + +// repeated int32 version = 1 [packed = true]; +inline int DenseInfo::version_size() const { + return version_.size(); +} +inline void DenseInfo::clear_version() { + version_.Clear(); +} +inline ::google::protobuf::int32 DenseInfo::version(int index) const { + return version_.Get(index); +} +inline void DenseInfo::set_version(int index, ::google::protobuf::int32 value) { + version_.Set(index, value); +} +inline void DenseInfo::add_version(::google::protobuf::int32 value) { + version_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +DenseInfo::version() const { + return version_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +DenseInfo::mutable_version() { + return &version_; +} + +// repeated sint64 timestamp = 2 [packed = true]; +inline int DenseInfo::timestamp_size() const { + return timestamp_.size(); +} +inline void DenseInfo::clear_timestamp() { + timestamp_.Clear(); +} +inline ::google::protobuf::int64 DenseInfo::timestamp(int index) const { + return timestamp_.Get(index); +} +inline void DenseInfo::set_timestamp(int index, ::google::protobuf::int64 value) { + timestamp_.Set(index, value); +} +inline void DenseInfo::add_timestamp(::google::protobuf::int64 value) { + timestamp_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DenseInfo::timestamp() const { + return timestamp_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DenseInfo::mutable_timestamp() { + return ×tamp_; +} + +// repeated sint64 changeset = 3 [packed = true]; +inline int DenseInfo::changeset_size() const { + return changeset_.size(); +} +inline void DenseInfo::clear_changeset() { + changeset_.Clear(); +} +inline ::google::protobuf::int64 DenseInfo::changeset(int index) const { + return changeset_.Get(index); +} +inline void DenseInfo::set_changeset(int index, ::google::protobuf::int64 value) { + changeset_.Set(index, value); +} +inline void DenseInfo::add_changeset(::google::protobuf::int64 value) { + changeset_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DenseInfo::changeset() const { + return changeset_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DenseInfo::mutable_changeset() { + return &changeset_; +} + +// repeated sint32 uid = 4 [packed = true]; +inline int DenseInfo::uid_size() const { + return uid_.size(); +} +inline void DenseInfo::clear_uid() { + uid_.Clear(); +} +inline ::google::protobuf::int32 DenseInfo::uid(int index) const { + return uid_.Get(index); +} +inline void DenseInfo::set_uid(int index, ::google::protobuf::int32 value) { + uid_.Set(index, value); +} +inline void DenseInfo::add_uid(::google::protobuf::int32 value) { + uid_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +DenseInfo::uid() const { + return uid_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +DenseInfo::mutable_uid() { + return &uid_; +} + +// repeated sint32 user_sid = 5 [packed = true]; +inline int DenseInfo::user_sid_size() const { + return user_sid_.size(); +} +inline void DenseInfo::clear_user_sid() { + user_sid_.Clear(); +} +inline ::google::protobuf::int32 DenseInfo::user_sid(int index) const { + return user_sid_.Get(index); +} +inline void DenseInfo::set_user_sid(int index, ::google::protobuf::int32 value) { + user_sid_.Set(index, value); +} +inline void DenseInfo::add_user_sid(::google::protobuf::int32 value) { + user_sid_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +DenseInfo::user_sid() const { + return user_sid_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +DenseInfo::mutable_user_sid() { + return &user_sid_; +} + +// ------------------------------------------------------------------- + +// ChangeSet + +// required int64 id = 1; +inline bool ChangeSet::has_id() const { + return _has_bit(0); +} +inline void ChangeSet::clear_id() { + id_ = GOOGLE_LONGLONG(0); + _clear_bit(0); +} +inline ::google::protobuf::int64 ChangeSet::id() const { + return id_; +} +inline void ChangeSet::set_id(::google::protobuf::int64 value) { + _set_bit(0); + id_ = value; +} + +// ------------------------------------------------------------------- + +// Node + +// required sint64 id = 1; +inline bool Node::has_id() const { + return _has_bit(0); +} +inline void Node::clear_id() { + id_ = GOOGLE_LONGLONG(0); + _clear_bit(0); +} +inline ::google::protobuf::int64 Node::id() const { + return id_; +} +inline void Node::set_id(::google::protobuf::int64 value) { + _set_bit(0); + id_ = value; +} + +// repeated uint32 keys = 2 [packed = true]; +inline int Node::keys_size() const { + return keys_.size(); +} +inline void Node::clear_keys() { + keys_.Clear(); +} +inline ::google::protobuf::uint32 Node::keys(int index) const { + return keys_.Get(index); +} +inline void Node::set_keys(int index, ::google::protobuf::uint32 value) { + keys_.Set(index, value); +} +inline void Node::add_keys(::google::protobuf::uint32 value) { + keys_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +Node::keys() const { + return keys_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +Node::mutable_keys() { + return &keys_; +} + +// repeated uint32 vals = 3 [packed = true]; +inline int Node::vals_size() const { + return vals_.size(); +} +inline void Node::clear_vals() { + vals_.Clear(); +} +inline ::google::protobuf::uint32 Node::vals(int index) const { + return vals_.Get(index); +} +inline void Node::set_vals(int index, ::google::protobuf::uint32 value) { + vals_.Set(index, value); +} +inline void Node::add_vals(::google::protobuf::uint32 value) { + vals_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +Node::vals() const { + return vals_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +Node::mutable_vals() { + return &vals_; +} + +// optional .OSMPBF.Info info = 4; +inline bool Node::has_info() const { + return _has_bit(3); +} +inline void Node::clear_info() { + if (info_ != NULL) info_->::OSMPBF::Info::Clear(); + _clear_bit(3); +} +inline const ::OSMPBF::Info& Node::info() const { + return info_ != NULL ? *info_ : *default_instance_->info_; +} +inline ::OSMPBF::Info* Node::mutable_info() { + _set_bit(3); + if (info_ == NULL) info_ = new ::OSMPBF::Info; + return info_; +} + +// required sint64 lat = 8; +inline bool Node::has_lat() const { + return _has_bit(4); +} +inline void Node::clear_lat() { + lat_ = GOOGLE_LONGLONG(0); + _clear_bit(4); +} +inline ::google::protobuf::int64 Node::lat() const { + return lat_; +} +inline void Node::set_lat(::google::protobuf::int64 value) { + _set_bit(4); + lat_ = value; +} + +// required sint64 lon = 9; +inline bool Node::has_lon() const { + return _has_bit(5); +} +inline void Node::clear_lon() { + lon_ = GOOGLE_LONGLONG(0); + _clear_bit(5); +} +inline ::google::protobuf::int64 Node::lon() const { + return lon_; +} +inline void Node::set_lon(::google::protobuf::int64 value) { + _set_bit(5); + lon_ = value; +} + +// ------------------------------------------------------------------- + +// DenseNodes + +// repeated sint64 id = 1 [packed = true]; +inline int DenseNodes::id_size() const { + return id_.size(); +} +inline void DenseNodes::clear_id() { + id_.Clear(); +} +inline ::google::protobuf::int64 DenseNodes::id(int index) const { + return id_.Get(index); +} +inline void DenseNodes::set_id(int index, ::google::protobuf::int64 value) { + id_.Set(index, value); +} +inline void DenseNodes::add_id(::google::protobuf::int64 value) { + id_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DenseNodes::id() const { + return id_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DenseNodes::mutable_id() { + return &id_; +} + +// optional .OSMPBF.DenseInfo denseinfo = 5; +inline bool DenseNodes::has_denseinfo() const { + return _has_bit(1); +} +inline void DenseNodes::clear_denseinfo() { + if (denseinfo_ != NULL) denseinfo_->::OSMPBF::DenseInfo::Clear(); + _clear_bit(1); +} +inline const ::OSMPBF::DenseInfo& DenseNodes::denseinfo() const { + return denseinfo_ != NULL ? *denseinfo_ : *default_instance_->denseinfo_; +} +inline ::OSMPBF::DenseInfo* DenseNodes::mutable_denseinfo() { + _set_bit(1); + if (denseinfo_ == NULL) denseinfo_ = new ::OSMPBF::DenseInfo; + return denseinfo_; +} + +// repeated sint64 lat = 8 [packed = true]; +inline int DenseNodes::lat_size() const { + return lat_.size(); +} +inline void DenseNodes::clear_lat() { + lat_.Clear(); +} +inline ::google::protobuf::int64 DenseNodes::lat(int index) const { + return lat_.Get(index); +} +inline void DenseNodes::set_lat(int index, ::google::protobuf::int64 value) { + lat_.Set(index, value); +} +inline void DenseNodes::add_lat(::google::protobuf::int64 value) { + lat_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DenseNodes::lat() const { + return lat_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DenseNodes::mutable_lat() { + return &lat_; +} + +// repeated sint64 lon = 9 [packed = true]; +inline int DenseNodes::lon_size() const { + return lon_.size(); +} +inline void DenseNodes::clear_lon() { + lon_.Clear(); +} +inline ::google::protobuf::int64 DenseNodes::lon(int index) const { + return lon_.Get(index); +} +inline void DenseNodes::set_lon(int index, ::google::protobuf::int64 value) { + lon_.Set(index, value); +} +inline void DenseNodes::add_lon(::google::protobuf::int64 value) { + lon_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +DenseNodes::lon() const { + return lon_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +DenseNodes::mutable_lon() { + return &lon_; +} + +// repeated int32 keys_vals = 10 [packed = true]; +inline int DenseNodes::keys_vals_size() const { + return keys_vals_.size(); +} +inline void DenseNodes::clear_keys_vals() { + keys_vals_.Clear(); +} +inline ::google::protobuf::int32 DenseNodes::keys_vals(int index) const { + return keys_vals_.Get(index); +} +inline void DenseNodes::set_keys_vals(int index, ::google::protobuf::int32 value) { + keys_vals_.Set(index, value); +} +inline void DenseNodes::add_keys_vals(::google::protobuf::int32 value) { + keys_vals_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +DenseNodes::keys_vals() const { + return keys_vals_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +DenseNodes::mutable_keys_vals() { + return &keys_vals_; +} + +// ------------------------------------------------------------------- + +// Way + +// required int64 id = 1; +inline bool Way::has_id() const { + return _has_bit(0); +} +inline void Way::clear_id() { + id_ = GOOGLE_LONGLONG(0); + _clear_bit(0); +} +inline ::google::protobuf::int64 Way::id() const { + return id_; +} +inline void Way::set_id(::google::protobuf::int64 value) { + _set_bit(0); + id_ = value; +} + +// repeated uint32 keys = 2 [packed = true]; +inline int Way::keys_size() const { + return keys_.size(); +} +inline void Way::clear_keys() { + keys_.Clear(); +} +inline ::google::protobuf::uint32 Way::keys(int index) const { + return keys_.Get(index); +} +inline void Way::set_keys(int index, ::google::protobuf::uint32 value) { + keys_.Set(index, value); +} +inline void Way::add_keys(::google::protobuf::uint32 value) { + keys_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +Way::keys() const { + return keys_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +Way::mutable_keys() { + return &keys_; +} + +// repeated uint32 vals = 3 [packed = true]; +inline int Way::vals_size() const { + return vals_.size(); +} +inline void Way::clear_vals() { + vals_.Clear(); +} +inline ::google::protobuf::uint32 Way::vals(int index) const { + return vals_.Get(index); +} +inline void Way::set_vals(int index, ::google::protobuf::uint32 value) { + vals_.Set(index, value); +} +inline void Way::add_vals(::google::protobuf::uint32 value) { + vals_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +Way::vals() const { + return vals_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +Way::mutable_vals() { + return &vals_; +} + +// optional .OSMPBF.Info info = 4; +inline bool Way::has_info() const { + return _has_bit(3); +} +inline void Way::clear_info() { + if (info_ != NULL) info_->::OSMPBF::Info::Clear(); + _clear_bit(3); +} +inline const ::OSMPBF::Info& Way::info() const { + return info_ != NULL ? *info_ : *default_instance_->info_; +} +inline ::OSMPBF::Info* Way::mutable_info() { + _set_bit(3); + if (info_ == NULL) info_ = new ::OSMPBF::Info; + return info_; +} + +// repeated sint64 refs = 8 [packed = true]; +inline int Way::refs_size() const { + return refs_.size(); +} +inline void Way::clear_refs() { + refs_.Clear(); +} +inline ::google::protobuf::int64 Way::refs(int index) const { + return refs_.Get(index); +} +inline void Way::set_refs(int index, ::google::protobuf::int64 value) { + refs_.Set(index, value); +} +inline void Way::add_refs(::google::protobuf::int64 value) { + refs_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +Way::refs() const { + return refs_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +Way::mutable_refs() { + return &refs_; +} + +// ------------------------------------------------------------------- + +// Relation + +// required int64 id = 1; +inline bool Relation::has_id() const { + return _has_bit(0); +} +inline void Relation::clear_id() { + id_ = GOOGLE_LONGLONG(0); + _clear_bit(0); +} +inline ::google::protobuf::int64 Relation::id() const { + return id_; +} +inline void Relation::set_id(::google::protobuf::int64 value) { + _set_bit(0); + id_ = value; +} + +// repeated uint32 keys = 2 [packed = true]; +inline int Relation::keys_size() const { + return keys_.size(); +} +inline void Relation::clear_keys() { + keys_.Clear(); +} +inline ::google::protobuf::uint32 Relation::keys(int index) const { + return keys_.Get(index); +} +inline void Relation::set_keys(int index, ::google::protobuf::uint32 value) { + keys_.Set(index, value); +} +inline void Relation::add_keys(::google::protobuf::uint32 value) { + keys_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +Relation::keys() const { + return keys_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +Relation::mutable_keys() { + return &keys_; +} + +// repeated uint32 vals = 3 [packed = true]; +inline int Relation::vals_size() const { + return vals_.size(); +} +inline void Relation::clear_vals() { + vals_.Clear(); +} +inline ::google::protobuf::uint32 Relation::vals(int index) const { + return vals_.Get(index); +} +inline void Relation::set_vals(int index, ::google::protobuf::uint32 value) { + vals_.Set(index, value); +} +inline void Relation::add_vals(::google::protobuf::uint32 value) { + vals_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >& +Relation::vals() const { + return vals_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >* +Relation::mutable_vals() { + return &vals_; +} + +// optional .OSMPBF.Info info = 4; +inline bool Relation::has_info() const { + return _has_bit(3); +} +inline void Relation::clear_info() { + if (info_ != NULL) info_->::OSMPBF::Info::Clear(); + _clear_bit(3); +} +inline const ::OSMPBF::Info& Relation::info() const { + return info_ != NULL ? *info_ : *default_instance_->info_; +} +inline ::OSMPBF::Info* Relation::mutable_info() { + _set_bit(3); + if (info_ == NULL) info_ = new ::OSMPBF::Info; + return info_; +} + +// repeated int32 roles_sid = 8 [packed = true]; +inline int Relation::roles_sid_size() const { + return roles_sid_.size(); +} +inline void Relation::clear_roles_sid() { + roles_sid_.Clear(); +} +inline ::google::protobuf::int32 Relation::roles_sid(int index) const { + return roles_sid_.Get(index); +} +inline void Relation::set_roles_sid(int index, ::google::protobuf::int32 value) { + roles_sid_.Set(index, value); +} +inline void Relation::add_roles_sid(::google::protobuf::int32 value) { + roles_sid_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +Relation::roles_sid() const { + return roles_sid_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +Relation::mutable_roles_sid() { + return &roles_sid_; +} + +// repeated sint64 memids = 9 [packed = true]; +inline int Relation::memids_size() const { + return memids_.size(); +} +inline void Relation::clear_memids() { + memids_.Clear(); +} +inline ::google::protobuf::int64 Relation::memids(int index) const { + return memids_.Get(index); +} +inline void Relation::set_memids(int index, ::google::protobuf::int64 value) { + memids_.Set(index, value); +} +inline void Relation::add_memids(::google::protobuf::int64 value) { + memids_.Add(value); +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >& +Relation::memids() const { + return memids_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >* +Relation::mutable_memids() { + return &memids_; +} + +// repeated .OSMPBF.Relation.MemberType types = 10 [packed = true]; +inline int Relation::types_size() const { + return types_.size(); +} +inline void Relation::clear_types() { + types_.Clear(); +} +inline ::OSMPBF::Relation_MemberType Relation::types(int index) const { + return static_cast< ::OSMPBF::Relation_MemberType >(types_.Get(index)); +} +inline void Relation::set_types(int index, ::OSMPBF::Relation_MemberType value) { + GOOGLE_DCHECK(::OSMPBF::Relation_MemberType_IsValid(value)); + types_.Set(index, value); +} +inline void Relation::add_types(::OSMPBF::Relation_MemberType value) { + GOOGLE_DCHECK(::OSMPBF::Relation_MemberType_IsValid(value)); + types_.Add(value); +} +inline const ::google::protobuf::RepeatedField& +Relation::types() const { + return types_; +} +inline ::google::protobuf::RepeatedField* +Relation::mutable_types() { + return &types_; +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace OSMPBF + +#ifndef SWIG +namespace google { +namespace protobuf { + +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::OSMPBF::Relation_MemberType>() { + return ::OSMPBF::Relation_MemberType_descriptor(); +} + +} // namespace google +} // namespace protobuf +#endif // SWIG + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_osmformat_2eproto__INCLUDED diff --git a/DataStructures/pbf-proto/osmformat.proto b/DataStructures/pbf-proto/osmformat.proto new file mode 100644 index 000000000..44e24f7f7 --- /dev/null +++ b/DataStructures/pbf-proto/osmformat.proto @@ -0,0 +1,226 @@ +/** Copyright (c) 2010 Scott A. Crosby. + + 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 . + +*/ + +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 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. + + ( ( )* '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]; +} + diff --git a/Plugins/HelloWorldPlugin.h b/Plugins/HelloWorldPlugin.h index d9ca34cfd..730ce98b1 100644 --- a/Plugins/HelloWorldPlugin.h +++ b/Plugins/HelloWorldPlugin.h @@ -15,7 +15,7 @@ class HelloWorldPlugin : public BasePlugin { public: HelloWorldPlugin() {} - ~HelloWorldPlugin() { std::cout << GetDescriptor() << " destructor" << std::endl; } + ~HelloWorldPlugin() { /*std::cout << GetDescriptor() << " destructor" << std::endl;*/ } std::string GetDescriptor() { return std::string("hello"); } void HandleRequest(std::vector parameters, http::Reply& reply) { std::cout << "[hello world]: runnning handler" << std::endl; @@ -23,7 +23,7 @@ public: reply.content.append("Hello World Demonstration Document

Hello, World!

"); std::stringstream content; content << "Number of parameters: " << parameters.size() << "
"; - for(int i = 0; i < parameters.size(); i++) { + for(unsigned i = 0; i < parameters.size(); i++) { content << parameters[i] << "
"; } reply.content.append(content.str()); diff --git a/SConstruct b/SConstruct index 31735f9c1..d2cadc29e 100644 --- a/SConstruct +++ b/SConstruct @@ -31,7 +31,7 @@ else: #Mac OS X else: env.Append(CPPPATH = ['/usr/include', '/usr/include/include', '/usr/include/libxml2/']) if GetOption('buildconfiguration') == 'debug': - env.Append(CCFLAGS = ' -g3') + env.Append(CCFLAGS = ' -Wall -g3') else: env.Append(CCFLAGS = ' -O3 -DNDEBUG') #print "Compiling with: ", env['CXX'] @@ -86,13 +86,16 @@ if not conf.CheckLibWithHeader('stxxl', 'stxxl.h', 'CXX'): env.Append(CCFLAGS = ' -fopenmp') env.Append(LINKFLAGS = ' -fopenmp') +env.StaticObject("DataStructures/pbf-proto/fileformat.pb.cc") +env.StaticObject("DataStructures/pbf-proto/osmformat.pb.cc") env.Program("extractNetwork.cpp") env.Program("extractLargeNetwork.cpp") env.Program("createHierarchy.cpp") if os.path.exists("many-to-many.cpp"): env.Program("many-to-many.cpp") -env.Append(CCFLAGS = ' -lboost_regex -lboost_iostreams -lboost_system -lbz2') -env.Append(LINKFLAGS = ' -lboost_regex -lboost_iostreams -lboost_system -lbz2 -lboost_program_options') +env.Append(CCFLAGS = ' -lboost_regex -lboost_iostreams -lboost_system -lbz2 -lz -lprotobuf') +env.Append(LINKFLAGS = ' -lboost_regex -lboost_iostreams -lboost_system -lbz2 -lz -lboost_program_options') +env.Append(LINKFLAGS = ' -lprotobuf DataStructures/pbf-proto/fileformat.pb.o DataStructures/pbf-proto/osmformat.pb.o') env.Program("routed.cpp") env = conf.Finish() diff --git a/extractLargeNetwork.cpp b/extractLargeNetwork.cpp index aea4f6280..c6189c1bf 100644 --- a/extractLargeNetwork.cpp +++ b/extractLargeNetwork.cpp @@ -39,16 +39,20 @@ or see http://www.gnu.org/licenses/agpl.txt. #include "typedefs.h" #include "DataStructures/InputReaderFactory.h" #include "DataStructures/ExtractorStructs.h" +#include "DataStructures/PBFParser.h" +#include "DataStructures/XMLParser.h" -using namespace std; typedef google::dense_hash_map NodeMap; typedef stxxl::vector STXXLNodeIDVector; typedef stxxl::vector<_Node> STXXLNodeVector; typedef stxxl::vector<_Edge> STXXLEdgeVector; typedef stxxl::vector STXXLStringVector; +NodeMap * nodeMap = new NodeMap(); +StringMap * stringMap = new StringMap(); +unsigned globalRelationCounter = 0; Settings settings; -vector SignalNodes; + STXXLNodeIDVector usedNodes; STXXLNodeVector allNodes; STXXLNodeVector confirmedNodes; @@ -56,287 +60,362 @@ STXXLEdgeVector allEdges; STXXLEdgeVector confirmedEdges; STXXLStringVector nameVector; -NodeMap * nodeMap = new NodeMap(); -StringMap * stringMap = new StringMap(); +bool nodeFunction(_Node n) { + allNodes.push_back(n); + return true; +} +bool relationFunction(_Relation r) { + globalRelationCounter++; + return true; +} +bool wayFunction(_Way w) { + std::string highway( w.keyVals.Find("highway") ); + std::string name( w.keyVals.Find("name") ); + std::string ref( w.keyVals.Find("ref")); + std::string oneway( w.keyVals.Find("oneway")); + std::string junction( w.keyVals.Find("junction") ); + std::string route( w.keyVals.Find("route") ); + std::string maxspeed( w.keyVals.Find("maxspeed") ); + std::string access( w.keyVals.Find("access") ); + std::string motorcar( w.keyVals.Find("motorcar") ); + if ( name != "" ) { + w.name = name; + } else if ( ref != "" ) { + w.name = ref; + } + + if ( oneway != "" ) { + if ( oneway == "no" || oneway == "false" || oneway == "0" ) { + w.direction = _Way::bidirectional; + } else { + if ( oneway == "yes" || oneway == "true" || oneway == "1" ) { + w.direction = _Way::oneway; + } else { + if (oneway == "-1" ) + w.direction = _Way::opposite; + } + } + } + if ( junction == "roundabout" ) { + if ( w.direction == _Way::notSure ) { + w.direction = _Way::oneway; + } + w.useful = true; + if(w.type == -1) + w.type = 9; + } + if ( route == "ferry") { + for ( unsigned i = 0; i < settings.speedProfile.names.size(); i++ ) { + if ( route == settings.speedProfile.names[i] ) { + w.type = i; + w.maximumSpeed = settings.speedProfile.speed[i]; + w.useful = true; + w.direction = _Way::bidirectional; + break; + } + } + } + if ( highway != "" ) { + for ( unsigned i = 0; i < settings.speedProfile.names.size(); i++ ) { + if ( highway == settings.speedProfile.names[i] ) { + w.maximumSpeed = settings.speedProfile.speed[i]; + w.type = i; + w.useful = true; + break; + } + } + if ( highway == "motorway" ) { + if ( w.direction == _Way::notSure ) { + w.direction = _Way::oneway; + } + } else if ( highway == "motorway_link" ) { + if ( w.direction == _Way::notSure ) { + w.direction = _Way::oneway; + } + } + } + if ( maxspeed != "" ) { + double maxspeedNumber = atof( maxspeed.c_str() ); + if(maxspeedNumber != 0) { + w.maximumSpeed = maxspeedNumber; + } + } + + if ( access != "" ) { + if ( access == "private" || access == "no" || access == "agricultural" || access == "forestry" || access == "delivery") { + w.access = false; + } + if ( access == "yes" || access == "designated" || access == "official" || access == "permissive") { + w.access = true; + } + } + if ( motorcar == "yes" ) { + w.access = true; + } else if ( motorcar == "no" ) { + w.access = false; + } + + if ( w.useful && w.access && w.path.size() ) { + // std::cout << "[debug] looking for name: " << w.name << std::endl; + StringMap::iterator strit = stringMap->find(w.name); + if(strit == stringMap->end()) + { + w.nameID = nameVector.size(); + nameVector.push_back(w.name); + stringMap->insert(std::make_pair(w.name, w.nameID) ); + // if(w.name != "") + // cout << "[debug] found new name ID: " << w.nameID << " (" << w.name << ")" << endl; + } else { + w.nameID = strit->second; + // std::cout << "[debug] name with ID " << w.nameID << " already existing (" << w.name << ")" << endl; + } + for ( unsigned i = 0; i < w.path.size(); ++i ) { + // std::cout << "[debug] using node " << w.path[i] << std::endl; + usedNodes.push_back(w.path[i]); + } + + if ( w.direction == _Way::opposite ){ + std::reverse( w.path.begin(), w.path.end() ); + } + vector< NodeID > & path = w.path; + assert(w.type > -1 || w.maximumSpeed != -1); + assert(path.size()>0); + + if(w.maximumSpeed == -1) + w.maximumSpeed = settings.speedProfile.speed[w.type]; + for(vector< NodeID >::size_type n = 0; n < path.size()-1; n++) { + _Edge e; + e.start = w.path[n]; + e.target = w.path[n+1]; + e.type = w.type; + e.direction = w.direction; + e.speed = w.maximumSpeed; + e.nameID = w.nameID; + allEdges.push_back(e); + } + } + return true; +} int main (int argc, char *argv[]) { - if(argc <= 1) { - cerr << "usage: " << endl << argv[0] << " " << endl; - exit(-1); - } + if(argc <= 1) { + std::cerr << "usage: " << endl << argv[0] << " " << std::endl; + exit(-1); + } - cout << "extracting data from input file " << argv[1] << endl; - cout << "reading input file. This may take some time ..." << flush; - xmlTextReaderPtr inputReader = inputReaderFactory(argv[1]); + std::cout << "[extractor] extracting data from input file " << argv[1] << std::endl; + bool isPBF = false; + std::string outputFileName(argv[1]); + std::string::size_type pos = outputFileName.find(".osm.bz2"); + if(pos==string::npos) { + pos = outputFileName.find(".osm.pbf"); + if(pos!=string::npos) { +// std::cout << "[debug] found pbf file" << std::endl; + isPBF = true; + } + } + if(pos!=string::npos) { + outputFileName.replace(pos, 8, ".osrm"); + } else { + pos=outputFileName.find(".osm"); + if(pos!=string::npos) { + outputFileName.replace(pos, 5, ".osrm"); + } else { + outputFileName.append(".osrm"); + } + } - double time = get_timestamp(); - settings.speedProfile.names.insert(settings.speedProfile.names.begin(), names, names+14); - settings.speedProfile.speed.insert(settings.speedProfile.speed.begin(), speeds, speeds+14); + settings.speedProfile.names.insert(settings.speedProfile.names.begin(), names, names+14); + settings.speedProfile.speed.insert(settings.speedProfile.speed.begin(), speeds, speeds+14); - nodeMap->set_empty_key(UINT_MAX); - stringMap->set_empty_key(GetRandomString()); - stringMap->insert(std::make_pair("", 0)); - try { - while ( xmlTextReaderRead( inputReader ) == 1 ) { - const int type = xmlTextReaderNodeType( inputReader ); + double time = get_timestamp(); - //1 is Element - if ( type != 1 ) - continue; + nodeMap->set_empty_key(UINT_MAX); + stringMap->set_empty_key(GetRandomString()); + stringMap->insert(std::make_pair("", 0)); + BaseParser<_Node, _Relation, _Way> * parser; + if(isPBF) + parser = new PBFParser(argv[1]); + else + parser = new XMLParser(argv[1]); + parser->RegisterCallbacks(&nodeFunction, &relationFunction, &wayFunction); + if(parser->Init()) { + parser->Parse(); + } else { + std::cerr << "[error] parser not initialized!" << std::endl; + exit(-1); + } - xmlChar* currentName = xmlTextReaderName( inputReader ); - if ( currentName == NULL ) - continue; + try { + std::cout << "[info] raw no. of names: " << nameVector.size() << std::endl; + std::cout << "[info] raw no. of nodes: " << allNodes.size() << std::endl; + std::cout << "[info] no. of used nodes: " << usedNodes.size() << std::endl; + std::cout << "[info] raw no. of edges: " << allEdges.size() << std::endl; + std::cout << "[info] raw no. of relations: " << globalRelationCounter << std::endl; - if ( xmlStrEqual( currentName, ( const xmlChar* ) "node" ) == 1 ) { - _Node node = _ReadXMLNode( inputReader ); - allNodes.push_back(node); - if ( node.trafficSignal ) - SignalNodes.push_back( node.id ); + std::cout << "[info] parsing throug input file took " << get_timestamp() - time << "seconds" << std::endl; + time = get_timestamp(); + unsigned memory_to_use = 1024 * 1024 * 1024; - } - if ( xmlStrEqual( currentName, ( const xmlChar* ) "way" ) == 1 ) { - string name; - _Way way = _ReadXMLWay( inputReader, settings, name ); + std::cout << "[extractor] Sorting used nodes ... " << std::flush; + stxxl::sort(usedNodes.begin(), usedNodes.end(), Cmp(), memory_to_use); + std::cout << "ok, after " << get_timestamp() - time << "s" << std::endl; + time = get_timestamp(); + std::cout << "[extractor] Erasing duplicate entries ... " << std::flush; + stxxl::vector::iterator NewEnd = unique ( usedNodes.begin(),usedNodes.end() ) ; + usedNodes.resize ( NewEnd - usedNodes.begin() ); + cout << "ok, after " << get_timestamp() - time << "s" << endl; + time = get_timestamp(); - if ( way.usefull && way.access && way.path.size() ) { - StringMap::iterator strit = stringMap->find(name); - if(strit == stringMap->end()) - { - way.nameID = nameVector.size(); - nameVector.push_back(name); - stringMap->insert(std::make_pair(name, way.nameID) ); - // cout << "found name ID: " << way.nameID << " (" << name << ")" << endl; - } else { - way.nameID = strit->second; - // cout << "name with ID " << way.nameID << " already existing (" << name << ")" << endl; - } - for ( unsigned i = 0; i < way.path.size(); ++i ) { - usedNodes.push_back(way.path[i]); - } + std::cout << "[extractor] Sorting all nodes ... " << std::flush; + stxxl::sort(allNodes.begin(), allNodes.end(), CmpNodeByID(), memory_to_use); + std::cout << "ok, after " << get_timestamp() - time << "s" << std::endl; + time = get_timestamp(); - if ( way.direction == _Way::opposite ){ - std::reverse( way.path.begin(), way.path.end() ); - } - vector< NodeID > & path = way.path; - assert(way.type > -1 || way.maximumSpeed != -1); - assert(path.size()>0); + ofstream fout; + fout.open(outputFileName.c_str()); - if(way.maximumSpeed == -1) - way.maximumSpeed = settings.speedProfile.speed[way.type]; + cout << "[extractor] Confirming used nodes ... " << flush; + STXXLNodeVector::iterator nvit = allNodes.begin(); + STXXLNodeIDVector::iterator niit = usedNodes.begin(); + while(niit != usedNodes.end() && nvit != allNodes.end()) { + if(*niit < nvit->id){ + niit++; + continue; + } + if(*niit > nvit->id) { + nvit++; + continue; + } + if(*niit == nvit->id) { + confirmedNodes.push_back(*nvit); + nodeMap->insert(std::make_pair(nvit->id, *nvit)); + niit++; + nvit++; + } + } + cout << "ok, after " << get_timestamp() - time << "s" << endl; + time = get_timestamp(); - for(vector< NodeID >::size_type n = 0; n < path.size()-1; n++) - { - _Edge e; - e.start = way.path[n]; - e.target = way.path[n+1]; - e.type = way.type; - e.direction = way.direction; - e.speed = way.maximumSpeed; - e.nameID = way.nameID; - allEdges.push_back(e); - } - } - } - if ( xmlStrEqual( currentName, ( const xmlChar* ) "relation" ) == 1 ) { + cout << "[extractor] Writing used nodes ... " << flush; + fout << confirmedNodes.size() << endl; + for(STXXLNodeVector::iterator ut = confirmedNodes.begin(); ut != confirmedNodes.end(); ut++) { + fout << ut->id<< " " << ut->lon << " " << ut->lat << "\n"; + } - } - xmlFree( currentName ); - } - cout << "raw no. of names: " << nameVector.size() << endl; - cout << "raw no. of nodes: " << allNodes.size() << endl; - cout << "raw no. of edges: " << allEdges.size() << endl; + cout << "ok, after " << get_timestamp() - time << "s" << endl; + time = get_timestamp(); - cout << "ok, after " << get_timestamp() - time << "s" << endl; - time = get_timestamp(); - unsigned memory_to_use = 1024 * 1024 * 1024; + cout << "[extractor] confirming used ways ... " << flush; + for(STXXLEdgeVector::iterator eit = allEdges.begin(); eit != allEdges.end(); eit++) { + assert(eit->type > -1 || eit->speed != -1); - cout << "Sorting used nodes ..." << flush; - stxxl::sort(usedNodes.begin(), usedNodes.end(), Cmp(), memory_to_use); - cout << "ok, after " << get_timestamp() - time << "s" << endl; - time = get_timestamp(); - cout << "Erasing duplicate entries ..." << flush; - stxxl::vector::iterator NewEnd = unique ( usedNodes.begin(),usedNodes.end() ) ; - usedNodes.resize ( NewEnd - usedNodes.begin() ); - cout << "ok, after " << get_timestamp() - time << "s" << endl; - time = get_timestamp(); + NodeMap::iterator startit = nodeMap->find(eit->start); + if(startit == nodeMap->end()) + { + continue; + } + NodeMap::iterator targetit = nodeMap->find(eit->target); - cout << "Sorting all nodes ..." << flush; - stxxl::sort(allNodes.begin(), allNodes.end(), CmpNodeByID(), memory_to_use); - cout << "ok, after " << get_timestamp() - time << "s" << endl; - time = get_timestamp(); + if(targetit == nodeMap->end()) + { + continue; + } + confirmedEdges.push_back(*eit); + } + fout << confirmedEdges.size() << "\n"; + cout << "ok, after " << get_timestamp() - time << "s" << endl; + time = get_timestamp(); - string name(argv[1]); - int pos; - pos = name.find(".osm.bz2"); - if(pos!=string::npos) - { - name.replace(pos, 8, ".osrm"); - } else { - pos=name.find(".osm"); - if(pos!=string::npos) - { - name.replace(pos, 5, ".osrm"); - } else { - name.append(".osrm"); - } - } + cout << "[extractor] writing confirmed ways ... " << flush; + for(STXXLEdgeVector::iterator eit = confirmedEdges.begin(); eit != confirmedEdges.end(); eit++) { + NodeMap::iterator startit = nodeMap->find(eit->start); + if(startit == nodeMap->end()) { + continue; + } + NodeMap::iterator targetit = nodeMap->find(eit->target); - ofstream fout; - fout.open(name.c_str()); + if(targetit == nodeMap->end()) { + continue; + } + double distance = ApproximateDistance(startit->second.lat, startit->second.lon, targetit->second.lat, targetit->second.lon); + if(eit->speed == -1) + eit->speed = settings.speedProfile.speed[eit->type]; + double weight = ( distance * 10. ) / (eit->speed / 3.6); + int intWeight = max(1, (int) weight); + int intDist = max(1, (int)distance); + int ferryIndex = settings.indexInAccessListOf("ferry"); + assert(ferryIndex != -1); - cout << "Confirming used nodes ..." << flush; - NodeID counter = 0; - NodeID notfound = 0; - STXXLNodeVector::iterator nvit = allNodes.begin(); - STXXLNodeIDVector::iterator niit = usedNodes.begin(); - while(niit != usedNodes.end() && nvit != allNodes.end()) - { - if(*niit < nvit->id){ - niit++; - continue; - } - if(*niit > nvit->id) - { - nvit++; - continue; - } - if(*niit == nvit->id) - { - confirmedNodes.push_back(*nvit); - nodeMap->insert(std::make_pair(nvit->id, *nvit)); - niit++; - nvit++; - } - } - cout << "ok, after " << get_timestamp() - time << "s" << endl; - time = get_timestamp(); + switch(eit->direction) { + case _Way::notSure: + fout << startit->first << " " << targetit->first << " " << intDist << " " << 0 << " " << intWeight << " " << eit->type << " " << eit->nameID << "\n"; + break; + case _Way::oneway: + fout << startit->first << " " << targetit->first << " " << intDist << " " << 1 << " " << intWeight << " " << eit->type << " " << eit->nameID << "\n"; + break; + case _Way::bidirectional: + fout << startit->first << " " << targetit->first << " " << intDist << " " << 0 << " " << intWeight << " " << eit->type << " " << eit->nameID << "\n"; + break; + case _Way::opposite: + fout << startit->first << " " << targetit->first << " " << intDist << " " << 1 << " " << intWeight << " " << eit->type << " " << eit->nameID << "\n"; + break; + default: + std::cerr << "[error] edge with no direction: " << eit->direction << std::endl; + assert(false); + break; + } + } + fout.close(); - cout << "Writing used nodes ..." << flush; - fout << confirmedNodes.size() << endl; - for(STXXLNodeVector::iterator ut = confirmedNodes.begin(); ut != confirmedNodes.end(); ut++) - { - fout << ut->id<< " " << ut->lon << " " << ut->lat << "\n"; - } + outputFileName.append(".names"); + std::cout << "ok, after " << get_timestamp() - time << "s" << std::endl; +// std::cout << "[debug] written edges: " << testCounter << std::endl; + time = get_timestamp(); + std::cout << "[extractor] writing street name index ... " << std::flush; - cout << "ok, after " << get_timestamp() - time << "s" << endl; - time = get_timestamp(); + std::vector * nameIndex = new std::vector(nameVector.size()+1, 0); + unsigned currentNameIndex = 0; + for(unsigned i = 0; i < nameVector.size(); i++) { + nameIndex->at(i) = currentNameIndex; + currentNameIndex += nameVector[i].length(); + } + nameIndex->at(nameVector.size()) = currentNameIndex; + ofstream nameOutFile(outputFileName.c_str(), ios::binary); + unsigned sizeOfNameIndex = nameIndex->size(); + nameOutFile.write((char *)&(sizeOfNameIndex), sizeof(unsigned)); - cout << "confirming used ways ..." << flush; - for(STXXLEdgeVector::iterator eit = allEdges.begin(); eit != allEdges.end(); eit++) - { - assert(eit->type > -1 || eit->speed != -1); + for(unsigned i = 0; i < nameIndex->size(); i++) { + nameOutFile.write((char *)&(nameIndex->at(i)), sizeof(unsigned)); + } + for(unsigned i = 0; i < nameVector.size(); i++){ + nameOutFile << nameVector[i]; + } - NodeMap::iterator startit = nodeMap->find(eit->start); - if(startit == nodeMap->end()) - { - continue; - } - NodeMap::iterator targetit = nodeMap->find(eit->target); + nameOutFile.close(); + delete nameIndex; + std::cout << "ok, after " << get_timestamp() - time << "s" << std::endl; - if(targetit == nodeMap->end()) - { - continue; - } - confirmedEdges.push_back(*eit); - } - fout << confirmedEdges.size() << "\n"; - cout << "ok, after " << get_timestamp() - time << "s" << endl; - time = get_timestamp(); + } catch ( const std::exception& e ) { + std::cerr << "Caught Execption:" << e.what() << std::endl; + return false; + } - cout << "writing confirmed ways ..." << flush; + std::cout << "[info] Statistics:" << std::endl; + std::cout << "[info] -----------" << std::endl; + std::cout << "[info] Usable Nodes: " << confirmedNodes.size() << std::endl; + std::cout << "[info] Usable Edges: " << confirmedEdges.size() << std::endl; - for(STXXLEdgeVector::iterator eit = confirmedEdges.begin(); eit != confirmedEdges.end(); eit++) - { - NodeMap::iterator startit = nodeMap->find(eit->start); - if(startit == nodeMap->end()) - { - continue; - } - NodeMap::iterator targetit = nodeMap->find(eit->target); - - if(targetit == nodeMap->end()) - { - continue; - } - double distance = ApproximateDistance(startit->second.lat, startit->second.lon, targetit->second.lat, targetit->second.lon); - if(eit->speed == -1) - eit->speed = settings.speedProfile.speed[eit->type]; - double weight = ( distance * 10. ) / (eit->speed / 3.6); - int intWeight = max(1, (int) weight); - int intDist = max(1, (int)distance); - int ferryIndex = settings.indexInAccessListOf("ferry"); - assert(ferryIndex != -1); - - switch(eit->direction) - { - case _Way::notSure: - fout << startit->first << " " << targetit->first << " " << intDist << " " << 0 << " " << intWeight << " " << eit->type << " " << eit->nameID << "\n"; - break; - case _Way::oneway: - fout << startit->first << " " << targetit->first << " " << intDist << " " << 1 << " " << intWeight << " " << eit->type << " " << eit->nameID << "\n"; - break; - case _Way::bidirectional: - fout << startit->first << " " << targetit->first << " " << intDist << " " << 0 << " " << intWeight << " " << eit->type << " " << eit->nameID << "\n"; - break; - case _Way::opposite: - fout << startit->first << " " << targetit->first << " " << intDist << " " << 1 << " " << intWeight << " " << eit->type << " " << eit->nameID << "\n"; - break; - default: - assert(false); - break; - } - } - fout.close(); - - name.append(".names"); - cout << "ok, after " << get_timestamp() - time << "s" << endl; - time = get_timestamp(); - cout << "writing street name index ..." << flush; - - vector * nameIndex = new vector(nameVector.size()+1, 0); - unsigned currentNameIndex = 0; - for(int i = 0; i < nameVector.size(); i++) { - nameIndex->at(i) = currentNameIndex; - currentNameIndex += nameVector[i].length(); - } - nameIndex->at(nameVector.size()) = currentNameIndex; - ofstream nameOutFile(name.c_str(), ios::binary); - unsigned sizeOfNameIndex = nameIndex->size(); - nameOutFile.write((char *)&(sizeOfNameIndex), sizeof(unsigned)); - - for(int i = 0; i < nameIndex->size(); i++) { - nameOutFile.write((char *)&(nameIndex->at(i)), sizeof(unsigned)); - } - for(int i = 0; i < nameVector.size(); i++){ - nameOutFile << nameVector[i]; - } - - nameOutFile.close(); - delete nameIndex; - cout << "ok, after " << get_timestamp() - time << "s" << endl; - - } catch ( const std::exception& e ) { - cerr << "Caught Execption:" << e.what() << endl; - return false; - } - - cout << endl << "Statistics:" << endl; - cout << "-----------" << endl; - cout << "Usable Nodes: " << confirmedNodes.size() << endl; - cout << "Usable Ways : " << confirmedEdges.size() << endl; - - SignalNodes.clear(); - usedNodes.clear(); - allNodes.clear(); - confirmedNodes.clear(); - allEdges.clear(); - confirmedEdges.clear(); - nameVector.clear(); - xmlFreeTextReader(inputReader); - delete nodeMap; - delete stringMap; - cout << "finished." << endl; - return 0; + usedNodes.clear(); + allNodes.clear(); + confirmedNodes.clear(); + allEdges.clear(); + confirmedEdges.clear(); + nameVector.clear(); + delete nodeMap; + delete stringMap; + delete parser; + cout << "[extractor] finished." << endl; + return 0; }