Exemplo n.º 1
0
        private OSMNode ParseNodeData(
            byte[] data
#if DEBUG
            , ElementDebugInfos debugInfos
#endif
            )
        {
            var bufferOffset = 0;

            var nodeId  = VarInt.ParseInt64(data, ref bufferOffset) + this._lastNodeId;
            var o5mNode = new OSMNode((ulong)nodeId);

            this._lastNodeId = (long)o5mNode.Id;

#if DEBUG
            this.ParseVersionData(data, o5mNode, ref bufferOffset, debugInfos);
#else
            this.ParseVersionData(data, o5mNode, ref bufferOffset);
#endif

            var parsedInt     = VarInt.ParseInt32(data, ref bufferOffset);
            var longLongitude = parsedInt + this._lastLongitude;
            var longLatitude  = VarInt.ParseInt32(data, ref bufferOffset) + this._lastLatitude;
            this._lastLongitude = longLongitude;
            this._lastLatitude  = longLatitude;
            o5mNode.Longitude   = longLongitude / POINT_DIVIDER;
            o5mNode.Latitude    = longLatitude / POINT_DIVIDER;

#if DEBUG
            this.ParseTagsData(data, o5mNode, ref bufferOffset, debugInfos);
#else
            this.ParseTagsData(data, o5mNode, ref bufferOffset);
#endif

            return(o5mNode);
        }