Example #1
0
        public List <int> keys_vals = new List <int>();  // 10, packed

        internal static DenseNodes Read(Stream stream)
        {
            DenseNodes obj           = new DenseNodes();
            long       lengthInBytes = OSMReader.ReadVarInt(stream);
            long       end           = stream.Position + lengthInBytes;
            int        b             = stream.ReadByte();

            if (b == 10)
            {
                obj.id = OSMReader.ReadPackedDeltaCodedVarInts(stream);
                b      = stream.ReadByte();
            }
            if (b == 42)
            {
                //obj.denseinfo = DenseInfo.Read(stream);
                OSMReader.SkipBytes(stream);
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 66)
            {
                obj.lat = OSMReader.ReadPackedDeltaCodedVarInts(stream);
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 74)
            {
                obj.lon = OSMReader.ReadPackedDeltaCodedVarInts(stream);
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 82)
            {
                //obj.keys_vals = OSM.ReadPackedVarInts(stream).ConvertAll(x => (int)x).ToList();
                OSMReader.SkipBytes(stream);
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            throw new NotImplementedException();
        }
Example #2
0
        public List <long> refs = new List <long>(); // 8, packed, signed, delta coded

        internal static Way Read(Stream stream)
        {
            Way  obj           = new Way();
            long lengthInBytes = OSMReader.ReadVarInt(stream);
            long end           = stream.Position + lengthInBytes;
            int  b             = stream.ReadByte();

            if (b != 8)
            {
                throw new NotImplementedException();
            }
            obj.id = OSMReader.ReadVarInt(stream);
            b      = stream.ReadByte();
            if (b == 18)
            {
                obj.keys = OSMReader.ReadPackedVarInts(stream).ConvertAll(x => (int)x).ToList();
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 26)
            {
                obj.vals = OSMReader.ReadPackedVarInts(stream).ConvertAll(x => (int)x).ToList();
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 34)
            {
                //obj.info = Info.Read(stream);
                OSMReader.SkipBytes(stream);
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 66)
            {
                obj.refs = OSMReader.ReadPackedDeltaCodedVarInts(stream);
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            throw new NotImplementedException();
        }
Example #3
0
        public List <bool> visible;   // 6, packed

        internal static DenseInfo Read(Stream stream)
        {
            DenseInfo obj           = new DenseInfo();
            long      lengthInBytes = OSMReader.ReadVarInt(stream);
            long      end           = stream.Position + lengthInBytes;
            int       b             = stream.ReadByte();

            if (b == 10)
            {
                obj.version = OSMReader.ReadPackedVarInts(stream).ConvertAll(x => (int)x).ToList();
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 18)
            {
                obj.timestamp = OSMReader.ReadPackedDeltaCodedVarInts(stream);
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 26)
            {
                obj.changeset = OSMReader.ReadPackedDeltaCodedVarInts(stream);
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 34)
            {
                obj.uid = OSMReader.ReadPackedDeltaCodedVarInts(stream).ConvertAll(x => (int)x).ToList();
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 42)
            {
                obj.user_sid = OSMReader.ReadPackedDeltaCodedVarInts(stream).ConvertAll(x => (int)x).ToList();
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            if (b == 50)
            {
                OSMReader.SkipBytes(stream);
                if (stream.Position > end)
                {
                    throw new NotImplementedException();
                }
                if (stream.Position == end)
                {
                    return(obj);
                }
                b = stream.ReadByte();
            }
            throw new NotImplementedException();
        }