예제 #1
0
 public void UnPackTo(HeaderT _o)
 {
     _o.Name     = this.Name;
     _o.Envelope = new List <double>();
     for (var _j = 0; _j < this.EnvelopeLength; ++_j)
     {
         _o.Envelope.Add(this.Envelope(_j));
     }
     _o.GeometryType = this.GeometryType;
     _o.HasZ         = this.HasZ;
     _o.HasM         = this.HasM;
     _o.HasT         = this.HasT;
     _o.HasTm        = this.HasTm;
     _o.Columns      = new List <FlatGeobuf.ColumnT>();
     for (var _j = 0; _j < this.ColumnsLength; ++_j)
     {
         _o.Columns.Add(this.Columns(_j).HasValue ? this.Columns(_j).Value.UnPack() : null);
     }
     _o.FeaturesCount = this.FeaturesCount;
     _o.IndexNodeSize = this.IndexNodeSize;
     _o.Crs           = this.Crs.HasValue ? this.Crs.Value.UnPack() : null;
     _o.Title         = this.Title;
     _o.Description   = this.Description;
     _o.Metadata      = this.Metadata;
 }
예제 #2
0
        public HeaderT UnPack()
        {
            var _o = new HeaderT();

            this.UnPackTo(_o);
            return(_o);
        }
예제 #3
0
        public static Offset <FlatGeobuf.Header> Pack(FlatBufferBuilder builder, HeaderT _o)
        {
            if (_o == null)
            {
                return(default(Offset <FlatGeobuf.Header>));
            }
            var _name     = _o.Name == null ? default(StringOffset) : builder.CreateString(_o.Name);
            var _envelope = default(VectorOffset);

            if (_o.Envelope != null)
            {
                var __envelope = _o.Envelope.ToArray();
                _envelope = CreateEnvelopeVector(builder, __envelope);
            }
            var _columns = default(VectorOffset);

            if (_o.Columns != null)
            {
                var __columns = new Offset <FlatGeobuf.Column> [_o.Columns.Count];
                for (var _j = 0; _j < __columns.Length; ++_j)
                {
                    __columns[_j] = FlatGeobuf.Column.Pack(builder, _o.Columns[_j]);
                }
                _columns = CreateColumnsVector(builder, __columns);
            }
            var _crs         = _o.Crs == null ? default(Offset <FlatGeobuf.Crs>) : FlatGeobuf.Crs.Pack(builder, _o.Crs);
            var _title       = _o.Title == null ? default(StringOffset) : builder.CreateString(_o.Title);
            var _description = _o.Description == null ? default(StringOffset) : builder.CreateString(_o.Description);
            var _metadata    = _o.Metadata == null ? default(StringOffset) : builder.CreateString(_o.Metadata);

            return(CreateHeader(
                       builder,
                       _name,
                       _envelope,
                       _o.GeometryType,
                       _o.HasZ,
                       _o.HasM,
                       _o.HasT,
                       _o.HasTm,
                       _columns,
                       _o.FeaturesCount,
                       _o.IndexNodeSize,
                       _crs,
                       _title,
                       _description,
                       _metadata));
        }