@loaders.gl/flatgeobuf
Advanced tools
Comparing version 2.3.0-alpha.8 to 2.3.0-alpha.9
@@ -106,3 +106,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
!function(t,e){ true?e(exports):undefined}(this,(function(t){"use strict";var e,r={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(t,e){this.low=0|t,this.high=0|e},r.Long.create=function(t,e){return 0==t&&0==e?r.Long.ZERO:new r.Long(t,e)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t){if(t)e=t;else var e=1024;this.bb=r.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var i=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<i+t+e;){var s=this.bb.capacity();this.bb=r.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(i)},r.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},r.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},r.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},r.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},r.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},r.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},r.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},r.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},r.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},r.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},r.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},r.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},r.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},r.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},r.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},r.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},r.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},r.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},r.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},r.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},r.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},r.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},r.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},r.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},r.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},r.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=e<<1,s=r.ByteBuffer.allocate(i);return s.setPosition(i-e),s.bytes().set(t.bytes(),i-e),s},r.Builder.prototype.addOffset=function(t){this.prep(r.SIZEOF_INT,0),this.writeInt32(this.offset()-t+r.SIZEOF_INT)},r.Builder.prototype.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},r.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var i=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var s=(i+2)*r.SIZEOF_SHORT;this.addInt16(s);var n=0,o=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(a)){for(var b=r.SIZEOF_SHORT;b<s;b+=r.SIZEOF_SHORT)if(this.bb.readInt16(o+b)!=this.bb.readInt16(a+b))continue t;n=this.vtables[e];break}}return n?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,n-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},r.Builder.prototype.finish=function(t,e){if(e){var i=e;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH),i.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var s=r.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(i.charCodeAt(s))}this.prep(this.minalign,r.SIZEOF_INT),this.addOffset(t),this.bb.setPosition(this.space)},r.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(0!=this.bb.readInt16(i+e)))throw new Error("FlatBuffers: field "+e+" must be set")},r.Builder.prototype.startVector=function(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(r.SIZEOF_INT,t*e),this.prep(i,t*e)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var i,s=t.charCodeAt(r++);if(s<55296||s>=56320)i=s;else i=(s<<10)+t.charCodeAt(r++)+-56613888;i<128?e.push(i):(i<2048?e.push(i>>6&31|192):(i<65536?e.push(i>>12&15|224):e.push(i>>18&7|240,i>>12&63|128),e.push(i>>6&63|128)),e.push(63&i|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);r=0;for(var n=this.space,o=this.bb.bytes();r<e.length;r++)o[n++]=e[r];return this.endVector()},r.Builder.prototype.createLong=function(t,e){return r.Long.create(t,e)},r.ByteBuffer=function(t){this.bytes_=t,this.position_=0},r.ByteBuffer.allocate=function(t){return new r.ByteBuffer(new Uint8Array(t))},r.ByteBuffer.prototype.clear=function(){this.position_=0},r.ByteBuffer.prototype.bytes=function(){return this.bytes_},r.ByteBuffer.prototype.position=function(){return this.position_},r.ByteBuffer.prototype.setPosition=function(t){this.position_=t},r.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},r.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},r.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},r.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},r.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},r.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},r.ByteBuffer.prototype.readInt64=function(t){return new r.Long(this.readInt32(t),this.readInt32(t+4))},r.ByteBuffer.prototype.readUint64=function(t){return new r.Long(this.readUint32(t),this.readUint32(t+4))},r.ByteBuffer.prototype.readFloat32=function(t){return r.int32[0]=this.readInt32(t),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t),r.int32[r.isLittleEndian?1:0]=this.readInt32(t+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},r.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},r.ByteBuffer.prototype.writeFloat32=function(t,e){r.float32[0]=e,this.writeInt32(t,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t,e){r.float64[0]=e,this.writeInt32(t,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<r.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+r.SIZEOF_INT+e));return t},r.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},r.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},r.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var i=this.readInt32(t),s="",n=0;if(t+=r.SIZEOF_INT,e===r.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;n<i;){var o,a=this.readUint8(t+n++);if(a<192)o=a;else{var b=this.readUint8(t+n++);if(a<224)o=(31&a)<<6|63&b;else{var h=this.readUint8(t+n++);if(a<240)o=(15&a)<<12|(63&b)<<6|63&h;else o=(7&a)<<18|(63&b)<<12|(63&h)<<6|63&this.readUint8(t+n++)}}o<65536?s+=String.fromCharCode(o):(o-=65536,s+=String.fromCharCode(55296+(o>>10),56320+(1023&o)))}return s},r.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},r.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},r.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var e=0;e<r.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+r.SIZEOF_INT+e))return!1;return!0},r.ByteBuffer.prototype.createLong=function(t,e){return r.Long.create(t,e)};class i{constructor(t,e){this.name=t,this.type=e}}!function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(e||(e={}));var s,n,o,a,b=e;class h{constructor(t,e,r){this.geometryType=t,this.columns=e,this.featuresCount=r}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(s||(s={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(n||(n={}));class u{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new u).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new u).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):n.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,n.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return u.start(t),u.addName(t,e),u.addType(t,r),u.end(t)}}class f{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new f).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new f).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):s.Unknown}parts(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new f).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}partsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,s.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,r,i,s,n,o,a,b){return f.start(t),f.addEnds(t,e),f.addXy(t,r),f.addZ(t,i),f.addM(t,s),f.addT(t,n),f.addTm(t,o),f.addType(t,a),f.addParts(t,b),f.end(t)}}class c{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new c).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new c).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}properties(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}propertiesLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}propertiesArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}columns(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new u).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(3)}static addGeometry(t,e){t.addFieldOffset(0,e,0)}static addProperties(t,e){t.addFieldOffset(1,e,0)}static createPropertiesVector(t,e){t.startVector(1,e.length,1);for(var r=e.length-1;r>=0;r--)t.addInt8(e[r]);return t.endVector()}static startPropertiesVector(t,e){t.startVector(1,e,1)}static addColumns(t,e){t.addFieldOffset(2,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,i){return c.start(t),c.addGeometry(t,e),c.addProperties(t,r),c.addColumns(t,i),c.end(t)}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(o||(o={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(a||(a={}));class d{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):a.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,a.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return d.start(t),d.addName(t,e),d.addType(t,r),d.end(t)}}class l{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new l).__init(t.readInt32(t.position())+t.position(),t)}org(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}code(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}name(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}wkt(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(5)}static addOrg(t,e){t.addFieldOffset(0,e,0)}static addCode(t,e){t.addFieldInt32(1,e,0)}static addName(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWkt(t,e){t.addFieldOffset(4,e,0)}static end(t){return t.endObject()}static create(t,e,r,i,s,n){return l.start(t),l.addOrg(t,e),l.addCode(t,r),l.addName(t,i),l.addDescription(t,s),l.addWkt(t,n),l.end(t)}}class _{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new _).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new _).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}envelope(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}envelopeLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}envelopeArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}geometryType(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):o.Unknown}hasZ(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasM(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasT(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasTM(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}columns(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new d).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}featuresCount(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):this.bb.createLong(0,0)}indexNodeSize(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}crs(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new l).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addEnvelope(t,e){t.addFieldOffset(1,e,0)}static createEnvelopeVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,o.Unknown)}static addHasZ(t,e){t.addFieldInt8(3,+e,0)}static addHasM(t,e){t.addFieldInt8(4,+e,0)}static addHasT(t,e){t.addFieldInt8(5,+e,0)}static addHasTM(t,e){t.addFieldInt8(6,+e,0)}static addColumns(t,e){t.addFieldOffset(7,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static addFeaturesCount(t,e){t.addFieldInt64(8,e,t.createLong(0,0))}static addIndexNodeSize(t,e){t.addFieldInt16(9,e,16)}static addCrs(t,e){t.addFieldOffset(10,e,0)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,i,s,n,o,a,b,h,u,f){return _.start(t),_.addName(t,e),_.addEnvelope(t,r),_.addGeometryType(t,i),_.addHasZ(t,s),_.addHasM(t,n),_.addHasT(t,o),_.addHasTM(t,a),_.addColumns(t,b),_.addFeaturesCount(t,h),_.addIndexNodeSize(t,u),_.addCrs(t,f),_.end(t)}}function p(t){return t.reduce((t,e)=>Array.isArray(e)?t.concat(p(e)):t.concat(e),[])}function y(t){const e=[];for(let r=0;r<t.length;r+=2)e.push([t[r],t[r+1]]);return e}function g(t){return o[t]}function I(t){const e=t.coordinates;let r=null,i=null,s=null,n=g(t.type),o=0;switch(t.type){case"Point":r=e;break;case"MultiPoint":case"LineString":r=p(e);break;case"MultiLineString":case"Polygon":const n=e;r=p(n),n.length>1&&(i=n.map(t=>o+=t.length));break;case"MultiPolygon":s=e.map(t=>({type:"Polygon",coordinates:t})).map(I);break;case"GeometryCollection":s=t.geometries.map(I)}return{xy:r,ends:i,type:n,parts:s}}function v(t,e){if(!e||0===e.length)return[y(t)];let r=0;return Array.from(e).map(e=>t.slice(r,r=e<<1)).map(t=>y(t))}function B(t,e){if(e==o.GeometryCollection){const r=[];for(let e=0;e<t.partsLength();e++){const i=t.parts(e),s=i.type();r.push(B(i,s))}return{type:o[e],geometries:r}}if(e==o.MultiPolygon){const r=[];for(let e=0;e<t.partsLength();e++){const i=t.parts(e);i.type();r.push(B(i,o.Polygon))}return{type:o[e],coordinates:r.map(t=>t.coordinates)}}const r=function(t,e){const r=t.xyArray();switch(e){case o.Point:return Array.from(r);case o.MultiPoint:case o.LineString:return y(r);case o.MultiLineString:case o.Polygon:return v(r,t.endsArray())}}(t,e);return{type:o[e],coordinates:r}}function w(t,e){const i=e.columns,s=new r.Builder(0),n=new Uint8Array(1e5);let o=0;if(i){const e=new DataView(n.buffer);for(let r=0;r<i.length;r++){const s=i[r],a=t.properties[s.name];if(null!==a)switch(e.setUint16(o,r,!0),o+=2,s.type){case b.Bool:e.setUint8(o,a),o+=1;break;case b.Short:e.setInt16(o,a,!0),o+=2;break;case b.UShort:e.setUint16(o,a,!0),o+=2;break;case b.Int:e.setInt32(o,a,!0),o+=4;break;case b.UInt:e.setUint32(o,a,!0),o+=4;break;case b.Long:e.setBigInt64(o,BigInt(a),!0),o+=8;break;case b.Long:e.setBigUint64(o,BigInt(a),!0),o+=8;break;case b.Double:e.setFloat64(o,a,!0),o+=8;break;case b.String:const t=a,r=(new TextEncoder).encode(t);e.setUint32(o,r.length,!0),o+=4,n.set(r,o),o+=r.length;break;default:throw new Error("Unknown type")}}}let a=null;o>0&&(a=c.createPropertiesVector(s,n.slice(0,o)));const h=function t(e,r){const{xy:i,ends:s,parts:n,type:o}=r;if(n){const r=n.map(r=>t(e,r)),i=f.createPartsVector(e,r);return f.start(e),f.addParts(e,i),f.end(e)}const a=f.createXyVector(e,i);let b=null;return s&&(b=f.createEndsVector(e,s)),f.start(e),b&&f.addEnds(e,b),f.addXy(e,a),f.addType(e,o),f.end(e)}(s,I(t.geometry));c.start(s),c.addGeometry(s,h),a&&c.addProperties(s,a);const u=c.end(s);return s.finishSizePrefixed(u),s.asUint8Array()}function m(t,e){const r=e.columns;let i;i=B(t.geometry(),e.geometryType);const s=function(t,e){if(!e||0===e.length)return;const r=t.propertiesArray(),i=new DataView(r.buffer,r.byteOffset),s=t.propertiesLength();let n=0;const o={};for(;n<s;){const t=i.getUint16(n,!0);n+=2;const s=e[t];switch(s.type){case b.Bool:o[s.name]=!!i.getUint8(n),n+=1;break;case b.Byte:o[s.name]=i.getInt8(n),n+=1;break;case b.UByte:o[s.name]=i.getUint8(n),n+=1;break;case b.Short:o[s.name]=i.getInt16(n,!0),n+=2;break;case b.UShort:o[s.name]=i.getUint16(n,!0),n+=2;break;case b.Int:o[s.name]=i.getInt32(n,!0),n+=4;break;case b.UInt:o[s.name]=i.getUint32(n,!0),n+=4;break;case b.Long:o[s.name]=Number(i.getBigInt64(n,!0)),n+=8;break;case b.ULong:o[s.name]=Number(i.getBigUint64(n,!0)),n+=8;break;case b.Double:o[s.name]=i.getFloat64(n,!0),n+=8;break;case b.DateTime:case b.String:{const t=i.getUint32(n,!0);n+=4;const e=new TextDecoder;o[s.name]=e.decode(r.subarray(n,n+t)),n+=t;break}default:throw new Error("Unknown type "+s.type)}}return o}(t,r),n={type:"Feature",geometry:i};return s&&(n.properties=s),n}var F=new Uint8Array(0);function E(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function U(t){this._source=t,this._array=F,this._index=0}U.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(r){return t._array=F,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:E(e,r.value)}}))},U.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var i=new Uint8Array(t);return i.set(this._array.subarray(this._index)),function s(){return e._source.read().then((function(n){return n.done?(e._array=F,e._index=0,r>0?i.subarray(0,r):null):r+n.value.length>=t?(e._array=n.value,e._index=t-r,i.set(n.value.subarray(0,t-r),r),i):(i.set(n.value,r),r+=n.value.length,s())}))}()},U.prototype.cancel=function(){return this._source.cancel()};function S(t,e){e=Math.min(Math.max(+e,2),65535);let r=t,i=r;do{r=Math.ceil(r/e),i+=r}while(1!==r);return 40*i}async function T(t,e,r,i){const s=function(t,e){if(e<2)throw new Error("Node size must be at least 2");if(0===t)throw new Error("Number of items must be greater than 0");let r=t,i=r;const s=[r];do{r=Math.ceil(r/e),i+=r,s.push(r)}while(1!==r);const n=[];r=i;for(let t of s)n.push(r-t),r-=t;n.reverse(),s.reverse();const o=[];for(let t=0;t<s.length;t++)o.push([n[t],n[t]+s[t]]);return o.reverse(),o}(t,e),[[,n]]=s,o=[],a=[];for(o.push([0,s.length-1]);0!==o.length;){const[u,f]=o.pop(),c=u>=n-t,[,d]=s[f],l=Math.min(u+e,d),_=l-u,p=await i(40*u,40*_),y=new Float64Array(p),g=new Uint32Array(p),I=[];for(let t=0;t<5*_;t+=5){const e=y[t+0],r=y[t+1],i=y[t+2],s=y[t+3],n=g[8+(t<<1)];I.push({minX:e,minY:r,maxX:i,maxY:s,offset:n})}for(let t=u;t<l;t++){const e=I[t-u];(h=e,(b=r).maxX<h.minX||b.maxY<h.minY||b.minX>h.maxX||b.minY>h.maxY)||(c?a.push([e,t-1]):o.push([e.offset,f-1]))}o.sort((t,e)=>e[0]-t[0])}var b,h;return a}const L=new Uint8Array([102,103,98,3,102,103,98,0]);function N(t,e){const r="function"==typeof(i=t).slice?i:new U("function"==typeof i.read?i:i.getReader());var i;return O(async t=>await r.slice(t),void 0,void 0,e)}async function*O(t,e,s,n){let o=0,a=new Uint8Array(await t(8));if(o+=8,!a.every((t,e)=>L[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await t(4)),o+=4;let b=new r.ByteBuffer(a);const u=b.readUint32(0);a=new Uint8Array(await t(u)),o+=u,b=new r.ByteBuffer(a);const f=_.getRoot(b),c=f.featuresCount().toFloat64(),d=[];for(let t=0;t<f.columnsLength();t++){const e=f.columns(t);d.push(new i(e.name(),e.type()))}const l=new h(f.geometryType(),d,c),p=f.indexNodeSize();if(p>0){const r=S(c,p);if(s){const i=async(r,i)=>(await e(o+r),await t(i)),a=await T(c,p,s,i);o+=r;for(let[r]of a)await e(o+r.offset),yield await P(t,l,n);return}e?await e(o+r):await t(r),o+=r}let y;for(;y=await P(t,l,n);)yield y}async function P(t,e,i){let s=new Uint8Array(await t(4));if(0===s.byteLength)return null;let n=new r.ByteBuffer(s);const o=n.readUint32(0);s=new Uint8Array(await t(o));const a=new Uint8Array(o+4);return a.set(s,4),n=new r.ByteBuffer(a),n.setPosition(4),i(c.getRoot(n),e)}function V(t){const e=new r.Builder(0);let i=null;t.columns&&(i=_.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return d.start(t),d.addName(t,r),d.addType(t,e.type),d.end(t)}(e,t))));const s=e.createString("L1");_.start(e),_.addFeaturesCount(e,new r.Long(t.featuresCount,0)),_.addGeometryType(e,t.geometryType),_.addIndexNodeSize(e,0),i&&_.addColumns(e,i),_.addName(e,s);const n=_.end(e);return e.finishSizePrefixed(n),e.asUint8Array()}function C(t){const e=function(t){const e=t.features[0],r=e.properties;let s=null;r&&(s=Object.keys(r).map(t=>new i(t,function(t){if("boolean"==typeof t)return b.Bool;if("number"==typeof t)return t%1==0?b.Int:b.Double;if("string"==typeof t)return b.String;if(null===t)return b.String;throw new Error("Unknown type (value '".concat(t,"')"))}(r[t]))));const n=new Set;for(const r of t.features)n.add(e.geometry.type);return new h(g(e.geometry.type),s,t.features.length)}(t),r=V(e),s=t.features.map(t=>w(t,e)),n=s.map(t=>t.length).reduce((t,e)=>t+e),o=new Uint8Array(L.length+r.length+n);o.set(r,L.length);let a=L.length+r.length;for(const t of s)o.set(t,a),a+=t.length;return o.set(L),o}function A(t){return{type:"FeatureCollection",features:function(t,e){if(!t.subarray(0,7).every((t,e)=>L[e]===t))throw new Error("Not a FlatGeobuf file");const s=new r.ByteBuffer(t),n=s.readUint32(L.length);s.setPosition(L.length+4);const o=_.getRoot(s),a=o.featuresCount().toFloat64(),b=[];for(let t=0;t<o.columnsLength();t++){const e=o.columns(t);b.push(new i(e.name(),e.type()))}const u=new h(o.geometryType(),b,0);let f=L.length+4+n;const d=o.indexNodeSize();d>0&&(f+=S(a,d));const l=[];for(;f<s.capacity();){const t=s.readUint32(f);s.setPosition(f+4);const r=c.getRoot(s);l.push(e(r,u)),f+=4+t}return l}(t,(t,e)=>m(t,e))}}function x(t,e){return function(t,e,r){let i=0;return O(async e=>{const r=await fetch(t,{headers:{Range:"bytes=".concat(i,"-").concat(i+e-1)}});return i+=e,await r.arrayBuffer()},async t=>i=t,e,r)}(t,e,(t,e)=>m(t,e))}r.SIZE_PREFIX_LENGTH=4,r.Builder.prototype.finish=function(t,e,i){var s=!!i;if(e){var n=e;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH+(s?r.SIZE_PREFIX_LENGTH:0)),n.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var o=r.FILE_IDENTIFIER_LENGTH-1;o>=0;o--)this.writeInt8(n.charCodeAt(o))}this.prep(this.minalign,r.SIZEOF_INT+(s?r.SIZE_PREFIX_LENGTH:0)),this.addOffset(t),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},t.deserialize=function(t){return A(t)},t.deserializeFiltered=function(t,e){return x(t,e)},t.deserializeStream=function(t){return function(t){return N(t,(t,e)=>m(t,e))}(t)},t.serialize=function(t){return C(t)},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){ true?e(exports):undefined}(this,(function(t){"use strict";var e;!function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(e||(e={}));var r=e;const i={[r.Byte]:Uint8Array,[r.UByte]:Uint8Array,[r.Bool]:Uint8Array,[r.Short]:Uint16Array,[r.UShort]:Uint16Array,[r.Int]:Uint32Array,[r.UInt]:Uint32Array,[r.Long]:BigUint64Array,[r.ULong]:BigUint64Array,[r.Double]:Float64Array};class s{constructor(t,e){this.name=t,this.type=e,this.arrayType=i[e]}}class n{constructor(t,e,r,i){this.geometryType=t,this.columns=e,this.featuresCount=r,this.crs=i}}var o,a,b,h,u={};u.SIZEOF_SHORT=2,u.SIZEOF_INT=4,u.FILE_IDENTIFIER_LENGTH=4,u.SIZE_PREFIX_LENGTH=4,u.Encoding={UTF8_BYTES:1,UTF16_STRING:2},u.int32=new Int32Array(2),u.float32=new Float32Array(u.int32.buffer),u.float64=new Float64Array(u.int32.buffer),u.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],u.Long=function(t,e){this.low=0|t,this.high=0|e},u.Long.create=function(t,e){return 0==t&&0==e?u.Long.ZERO:new u.Long(t,e)},u.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},u.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},u.Long.ZERO=new u.Long(0,0),u.Builder=function(t){if(t)e=t;else var e=1024;this.bb=u.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},u.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},u.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},u.Builder.prototype.dataBuffer=function(){return this.bb},u.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},u.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var r=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<r+t+e;){var i=this.bb.capacity();this.bb=u.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(r)},u.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},u.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},u.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},u.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},u.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},u.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},u.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},u.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},u.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},u.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},u.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},u.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},u.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},u.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},u.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},u.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},u.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},u.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},u.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},u.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},u.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},u.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},u.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},u.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},u.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},u.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var r=e<<1,i=u.ByteBuffer.allocate(r);return i.setPosition(r-e),i.bytes().set(t.bytes(),r-e),i},u.Builder.prototype.addOffset=function(t){this.prep(u.SIZEOF_INT,0),this.writeInt32(this.offset()-t+u.SIZEOF_INT)},u.Builder.prototype.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},u.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var r=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var i=(r+2)*u.SIZEOF_SHORT;this.addInt16(i);var s=0,n=this.space;t:for(e=0;e<this.vtables.length;e++){var o=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(o)){for(var a=u.SIZEOF_SHORT;a<i;a+=u.SIZEOF_SHORT)if(this.bb.readInt16(n+a)!=this.bb.readInt16(o+a))continue t;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},u.Builder.prototype.finish=function(t,e,r){var i=r?u.SIZE_PREFIX_LENGTH:0;if(e){var s=e;if(this.prep(this.minalign,u.SIZEOF_INT+u.FILE_IDENTIFIER_LENGTH+i),s.length!=u.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+u.FILE_IDENTIFIER_LENGTH);for(var n=u.FILE_IDENTIFIER_LENGTH-1;n>=0;n--)this.writeInt8(s.charCodeAt(n))}this.prep(this.minalign,u.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},u.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},u.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(!(0!=this.bb.readInt16(i+e)))throw new Error("FlatBuffers: field "+e+" must be set")},u.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(u.SIZEOF_INT,t*e),this.prep(r,t*e)},u.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},u.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var i,s=t.charCodeAt(r++);if(s<55296||s>=56320)i=s;else i=(s<<10)+t.charCodeAt(r++)+-56613888;i<128?e.push(i):(i<2048?e.push(i>>6&31|192):(i<65536?e.push(i>>12&15|224):e.push(i>>18&7|240,i>>12&63|128),e.push(i>>6&63|128)),e.push(63&i|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);r=0;for(var n=this.space,o=this.bb.bytes();r<e.length;r++)o[n++]=e[r];return this.endVector()},u.Builder.prototype.createLong=function(t,e){return u.Long.create(t,e)},u.ByteBuffer=function(t){this.bytes_=t,this.position_=0},u.ByteBuffer.allocate=function(t){return new u.ByteBuffer(new Uint8Array(t))},u.ByteBuffer.prototype.clear=function(){this.position_=0},u.ByteBuffer.prototype.bytes=function(){return this.bytes_},u.ByteBuffer.prototype.position=function(){return this.position_},u.ByteBuffer.prototype.setPosition=function(t){this.position_=t},u.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},u.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},u.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},u.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},u.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},u.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},u.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},u.ByteBuffer.prototype.readInt64=function(t){return new u.Long(this.readInt32(t),this.readInt32(t+4))},u.ByteBuffer.prototype.readUint64=function(t){return new u.Long(this.readUint32(t),this.readUint32(t+4))},u.ByteBuffer.prototype.readFloat32=function(t){return u.int32[0]=this.readInt32(t),u.float32[0]},u.ByteBuffer.prototype.readFloat64=function(t){return u.int32[u.isLittleEndian?0:1]=this.readInt32(t),u.int32[u.isLittleEndian?1:0]=this.readInt32(t+4),u.float64[0]},u.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},u.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},u.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},u.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},u.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},u.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},u.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},u.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},u.ByteBuffer.prototype.writeFloat32=function(t,e){u.float32[0]=e,this.writeInt32(t,u.int32[0])},u.ByteBuffer.prototype.writeFloat64=function(t,e){u.float64[0]=e,this.writeInt32(t,u.int32[u.isLittleEndian?0:1]),this.writeInt32(t+4,u.int32[u.isLittleEndian?1:0])},u.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+u.SIZEOF_INT+u.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<u.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+u.SIZEOF_INT+e));return t},u.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},u.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},u.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),i="",s=0;if(t+=u.SIZEOF_INT,e===u.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;s<r;){var n,o=this.readUint8(t+s++);if(o<192)n=o;else{var a=this.readUint8(t+s++);if(o<224)n=(31&o)<<6|63&a;else{var b=this.readUint8(t+s++);if(o<240)n=(15&o)<<12|(63&a)<<6|63&b;else n=(7&o)<<18|(63&a)<<12|(63&b)<<6|63&this.readUint8(t+s++)}}n<65536?i+=String.fromCharCode(n):(n-=65536,i+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return i},u.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},u.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+u.SIZEOF_INT},u.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},u.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=u.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+u.FILE_IDENTIFIER_LENGTH);for(var e=0;e<u.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+u.SIZEOF_INT+e))return!1;return!0},u.ByteBuffer.prototype.createLong=function(t,e){return u.Long.create(t,e)},function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(o||(o={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(a||(a={}));class c{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new c).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+u.SIZE_PREFIX_LENGTH),(e||new c).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):a.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,a.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return c.start(t),c.addName(t,e),c.addType(t,r),c.end(t)}}class f{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new f).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+u.SIZE_PREFIX_LENGTH),(e||new f).__init(t.readInt32(t.position())+t.position(),t)}org(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}code(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}name(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}wkt(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(5)}static addOrg(t,e){t.addFieldOffset(0,e,0)}static addCode(t,e){t.addFieldInt32(1,e,0)}static addName(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWkt(t,e){t.addFieldOffset(4,e,0)}static end(t){return t.endObject()}static create(t,e,r,i,s,n){return f.start(t),f.addOrg(t,e),f.addCode(t,r),f.addName(t,i),f.addDescription(t,s),f.addWkt(t,n),f.end(t)}}class d{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+u.SIZE_PREFIX_LENGTH),(e||new d).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}envelope(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}envelopeLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}envelopeArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}geometryType(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):o.Unknown}hasZ(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasM(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasT(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasTM(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}columns(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}featuresCount(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):this.bb.createLong(0,0)}indexNodeSize(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}crs(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new f).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addEnvelope(t,e){t.addFieldOffset(1,e,0)}static createEnvelopeVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,o.Unknown)}static addHasZ(t,e){t.addFieldInt8(3,+e,0)}static addHasM(t,e){t.addFieldInt8(4,+e,0)}static addHasT(t,e){t.addFieldInt8(5,+e,0)}static addHasTM(t,e){t.addFieldInt8(6,+e,0)}static addColumns(t,e){t.addFieldOffset(7,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static addFeaturesCount(t,e){t.addFieldInt64(8,e,t.createLong(0,0))}static addIndexNodeSize(t,e){t.addFieldInt16(9,e,16)}static addCrs(t,e){t.addFieldOffset(10,e,0)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,i,s,n,o,a,b,h,u,c){return d.start(t),d.addName(t,e),d.addEnvelope(t,r),d.addGeometryType(t,i),d.addHasZ(t,s),d.addHasM(t,n),d.addHasT(t,o),d.addHasTM(t,a),d.addColumns(t,b),d.addFeaturesCount(t,h),d.addIndexNodeSize(t,u),d.addCrs(t,c),d.end(t)}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(b||(b={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(h||(h={}));class l{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+u.SIZE_PREFIX_LENGTH),(e||new l).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):h.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,h.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return l.start(t),l.addName(t,e),l.addType(t,r),l.end(t)}}class _{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new _).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+u.SIZE_PREFIX_LENGTH),(e||new _).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):b.Unknown}parts(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new _).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}partsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,b.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,r,i,s,n,o,a,b){return _.start(t),_.addEnds(t,e),_.addXy(t,r),_.addZ(t,i),_.addM(t,s),_.addT(t,n),_.addTm(t,o),_.addType(t,a),_.addParts(t,b),_.end(t)}}class p{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new p).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+u.SIZE_PREFIX_LENGTH),(e||new p).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new _).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}properties(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}propertiesLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}propertiesArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}columns(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new l).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(3)}static addGeometry(t,e){t.addFieldOffset(0,e,0)}static addProperties(t,e){t.addFieldOffset(1,e,0)}static createPropertiesVector(t,e){t.startVector(1,e.length,1);for(var r=e.length-1;r>=0;r--)t.addInt8(e[r]);return t.endVector()}static startPropertiesVector(t,e){t.startVector(1,e,1)}static addColumns(t,e){t.addFieldOffset(2,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,i){return p.start(t),p.addGeometry(t,e),p.addProperties(t,r),p.addColumns(t,i),p.end(t)}}function y(t,e,r){if(0!==t.length)if(Array.isArray(t[0]))for(const i of t)y(i,e,r);else 2===t.length?e.push(...t):(e.push(t[0],t[1]),r.push(t[2]))}function g(t,e){const r=[];for(let i=0;i<t.length;i+=2){const s=[t[i],t[i+1]];e&&s.push(e[i>>1]),r.push(s)}return r}function I(t){return o[t]}function v(t){const e=t.coordinates,r=[],i=[];let s=null,n=null;const o=I(t.type);let a=0;switch(t.type){case"Point":y(e,r,i);break;case"MultiPoint":case"LineString":y(e,r,i);break;case"MultiLineString":case"Polygon":{const t=e;y(t,r,i),t.length>1&&(s=t.map(t=>a+=t.length));break}case"MultiPolygon":n=e.map(t=>({type:"Polygon",coordinates:t})).map(v);break;case"GeometryCollection":n=t.geometries.map(v)}return{xy:r,z:i.length>0?i:void 0,ends:s,type:o,parts:n}}function B(t,e,r){if(!r||0===r.length)return[g(t,e)];let i=0;const s=Array.from(r).map(e=>t.slice(i,i=e<<1));let n=null;return e&&(i=0,n=Array.from(r).map(t=>e.slice(i,i=t))),s.map((t,r)=>g(t,e?n[r]:void 0))}function w(t,e){if(e===o.GeometryCollection){const r=[];for(let e=0;e<t.partsLength();e++){const i=t.parts(e),s=i.type();r.push(w(i,s))}return{type:o[e],geometries:r}}if(e===o.MultiPolygon){const r=[];for(let e=0;e<t.partsLength();e++)r.push(w(t.parts(e),o.Polygon));return{type:o[e],coordinates:r.map(t=>t.coordinates)}}const r=function(t,e){const r=t.xyArray(),i=t.zArray();switch(e){case o.Point:{const t=Array.from(r);return i&&t.push(i[0]),t}case o.MultiPoint:case o.LineString:return g(r,i);case o.MultiLineString:case o.Polygon:return B(r,i,t.endsArray())}}(t,e);return{type:o[e],coordinates:r}}const m=new TextEncoder,F=new TextDecoder;function U(t,e,i){const s=i.columns,n=new u.Builder,o=[];if(s)for(let t=0;t<s.length;t++){const i=s[t],n=e[i.name];if(null!==n)switch(o.push(Uint16Array.of(t)),i.type){case r.Bool:case r.Short:case r.UShort:case r.Int:case r.UInt:case r.Long:case r.Double:o.push(i.arrayType.of(n));break;case r.DateTime:case r.String:{const t=m.encode(n);o.push(Uint32Array.of(t.length)),o.push(t);break}default:throw new Error("Unknown type "+i.type)}}let a=null;o.length>0&&(a=p.createPropertiesVector(n,function(t,...e){let r=0;for(const t of e)r+=t.byteLength;const i=new t(r);let s=0;for(const r of e)r instanceof Uint8Array?i.set(r,s):i.set(new t(r.buffer),s),s+=r.byteLength;return i}(Uint8Array,...o)));const b=function t(e,r){const{xy:i,z:s,ends:n,parts:o,type:a}=r;if(o){const r=o.map(r=>t(e,r)),i=_.createPartsVector(e,r);return _.start(e),_.addParts(e,i),_.end(e)}const b=_.createXyVector(e,i);let h=null;s&&(h=_.createZVector(e,s));let u=null;return n&&(u=_.createEndsVector(e,n)),_.start(e),u&&_.addEnds(e,u),_.addXy(e,b),h&&_.addZ(e,h),_.addType(e,a),_.end(e)}(n,t);p.start(n),p.addGeometry(n,b),a&&p.addProperties(n,a);const h=p.end(n);return n.finishSizePrefixed(h),n.asUint8Array()}function E(t,e){const i=e.columns,s=w(t.geometry(),e.geometryType),n=function(t,e){if(!e||0===e.length)return;const i=t.propertiesArray(),s=new DataView(i.buffer,i.byteOffset),n=t.propertiesLength();let o=0;const a={};for(;o<n;){const t=s.getUint16(o,!0);o+=2;const n=e[t];switch(n.type){case r.Bool:a[n.name]=!!s.getUint8(o),o+=1;break;case r.Byte:a[n.name]=s.getInt8(o),o+=1;break;case r.UByte:a[n.name]=s.getUint8(o),o+=1;break;case r.Short:a[n.name]=s.getInt16(o,!0),o+=2;break;case r.UShort:a[n.name]=s.getUint16(o,!0),o+=2;break;case r.Int:a[n.name]=s.getInt32(o,!0),o+=4;break;case r.UInt:a[n.name]=s.getUint32(o,!0),o+=4;break;case r.Long:a[n.name]=Number(s.getBigInt64(o,!0)),o+=8;break;case r.ULong:a[n.name]=Number(s.getBigUint64(o,!0)),o+=8;break;case r.Double:a[n.name]=s.getFloat64(o,!0),o+=8;break;case r.DateTime:case r.String:{const t=s.getUint32(o,!0);o+=4,a[n.name]=F.decode(i.subarray(o,o+t)),o+=t;break}default:throw new Error("Unknown type "+n.type)}}return a}(t,i),o={type:"Feature",geometry:s};return n&&(o.properties=n),o}var S=new Uint8Array(0);function T(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function L(t){this._source=t,this._array=S,this._index=0}L.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(r){return t._array=S,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:T(e,r.value)}}))},L.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var i=new Uint8Array(t);return i.set(this._array.subarray(this._index)),function s(){return e._source.read().then((function(n){return n.done?(e._array=S,e._index=0,r>0?i.subarray(0,r):null):r+n.value.length>=t?(e._array=n.value,e._index=t-r,i.set(n.value.subarray(0,t-r),r),i):(i.set(n.value,r),r+=n.value.length,s())}))}()},L.prototype.cancel=function(){return this._source.cancel()};class P{constructor(t,e,r,i,s){this.org=t,this.code=e,this.name=r,this.description=i,this.wkt=s}}function O(t,e){e=Math.min(Math.max(+e,2),65535);let r=t,i=r;do{r=Math.ceil(r/e),i+=r}while(1!==r);return 40*i}async function*N(t,e,r,i){const{minX:s,minY:n,maxX:o,maxY:a}=r,b=function(t,e){if(e<2)throw new Error("Node size must be at least 2");if(0===t)throw new Error("Number of items must be greater than 0");let r=t,i=r;const s=[r];do{r=Math.ceil(r/e),i+=r,s.push(r)}while(1!==r);const n=[];r=i;for(const t of s)n.push(r-t),r-=t;n.reverse(),s.reverse();const o=[];for(let t=0;t<s.length;t++)o.push([n[t],n[t]+s[t]]);return o.reverse(),o}(t,e),[[h,u]]=b,c=[];for(c.push([0,b.length-1]);0!==c.length;){const[r,f]=c.pop(),d=r>=u-t,[,l]=b[f],_=Math.min(r+e,l),p=_-r,y=await i(40*r,40*p),g=new Float64Array(y),I=new Uint32Array(y);for(let t=r;t<_;t++){const e=5*(t-r);if(o<g[e+0])continue;if(a<g[e+1])continue;if(s>g[e+2])continue;if(n>g[e+3])continue;const i=I[8+(e<<1)];d?yield[i,t-h]:c.push([i,f-1])}c.sort((t,e)=>e[0]-t[0])}}const V=new Uint8Array([102,103,98,3,102,103,98,0]);function A(t,e,r){const i="function"==typeof(s=t).slice?s:new L("function"==typeof s.read?s:s.getReader());var s;return C(async t=>await i.slice(t),void 0,void 0,e,r)}async function*C(t,e,r,i,o){let a=0,b=new Uint8Array(await t(8));if(a+=8,!b.every((t,e)=>V[e]===t))throw new Error("Not a FlatGeobuf file");b=new Uint8Array(await t(4)),a+=4;let h=new u.ByteBuffer(b);const c=h.readUint32(0);b=new Uint8Array(await t(c)),a+=c,h=new u.ByteBuffer(b);const f=d.getRoot(h),l=f.featuresCount().toFloat64(),_=[];for(let t=0;t<f.columnsLength();t++){const e=f.columns(t);_.push(new s(e.name(),e.type()))}const p=f.crs(),y=p?new P(p.org(),p.code(),p.name(),p.description(),p.wkt()):null,g=new n(f.geometryType(),_,l,y);o&&o(g);const I=f.indexNodeSize();if(I>0){const s=O(l,I);if(r){const n=async(r,i)=>(await e(a+r),await t(i)),o=[];for await(const[t]of N(l,I,r,n))o.push(t);a+=s;for await(const r of o)await e(a+r),yield await R(t,g,i);return}e?await e(a+s):await t(s),a+=s}let v;for(;v=await R(t,g,i);)yield v}async function R(t,e,r){let i=new Uint8Array(await t(4));if(0===i.byteLength)return null;let s=new u.ByteBuffer(i);const n=s.readUint32(0);i=new Uint8Array(await t(n));const o=new Uint8Array(n+4);o.set(i,4),s=new u.ByteBuffer(o),s.setPosition(4);return r(p.getRoot(s),e)}function M(t){const e=new u.Builder;let r=null;t.columns&&(r=d.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return c.start(t),c.addName(t,r),c.addType(t,e.type),c.end(t)}(e,t))));const i=e.createString("L1");d.start(e),d.addFeaturesCount(e,new u.Long(t.featuresCount,0)),d.addGeometryType(e,t.geometryType),d.addIndexNodeSize(e,0),r&&d.addColumns(e,r),d.addName(e,i);const s=d.end(e);return e.finishSizePrefixed(s),e.asUint8Array()}function x(t){const e=function(t){const e=t.features[0],i=e.properties;let o=null;i&&(o=Object.keys(i).map(t=>new s(t,function(t){if("boolean"==typeof t)return r.Bool;if("number"==typeof t)return t%1==0?r.Int:r.Double;if("string"==typeof t)return r.String;if(null===t)return r.String;throw new Error(`Unknown type (value '${t}')`)}(i[t]))));return new n(I(e.geometry.type),o,t.features.length)}(t),i=M(e),o=t.features.map(t=>U(v(t.geometry),t.properties,e)),a=o.map(t=>t.length).reduce((t,e)=>t+e),b=new Uint8Array(V.length+i.length+a);b.set(i,V.length);let h=V.length+i.length;for(const t of o)b.set(t,h),h+=t.length;return b.set(V),b}function k(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,7).every((t,e)=>V[e]===t))throw new Error("Not a FlatGeobuf file");const i=new u.ByteBuffer(t),o=i.readUint32(V.length);i.setPosition(V.length+4);const a=d.getRoot(i),b=a.featuresCount().toFloat64(),h=[];for(let t=0;t<a.columnsLength();t++){const e=a.columns(t);h.push(new s(e.name(),e.type()))}const c=a.crs(),f=c?new P(c.org(),c.code(),c.name(),c.description(),c.wkt()):null,l=new n(a.geometryType(),h,0,f);r&&r(l);let _=V.length+4+o;const y=a.indexNodeSize();y>0&&(_+=O(b,y));const g=[];for(;_<i.capacity();){const t=i.readUint32(_);i.setPosition(_+4);const r=p.getRoot(i);g.push(e(r,l)),_+=4+t}return g}(t,E,e)}}function Z(t,e,r){return function(t,e,r,i){let s=0;return C(async e=>{const r=await fetch(t,{headers:{Range:`bytes=${s}-${s+e-1}`}});s+=e;return await r.arrayBuffer()},async t=>{s=t},e,r,i)}(t,e,E,r)}t.deserialize=function(t,e,r){return t instanceof Uint8Array?k(t,r):t instanceof ReadableStream?function(t,e){return A(t,E,e)}(t,r):Z(t,e,r)},t.serialize=function(t){return x(t)},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=flatgeobuf-geojson.min.js.map | ||
@@ -179,3 +179,3 @@ | ||
// @ts-ignore TS2304: Cannot find name '__VERSION__'. | ||
const VERSION = true ? "2.3.0-alpha.8" : undefined; | ||
const VERSION = true ? "2.3.0-alpha.9" : undefined; | ||
@@ -182,0 +182,0 @@ const FlatGeobufWorkerLoader = { |
@@ -1,1 +0,1 @@ | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var i in r)("object"==typeof exports?exports:t)[i]=r[i]}}(window,(function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e,r){!function(t){"use strict";var e,r={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(t,e){this.low=0|t,this.high=0|e},r.Long.create=function(t,e){return 0==t&&0==e?r.Long.ZERO:new r.Long(t,e)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t){if(t)e=t;else var e=1024;this.bb=r.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var i=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<i+t+e;){var n=this.bb.capacity();this.bb=r.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)},r.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},r.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},r.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},r.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},r.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},r.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},r.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},r.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},r.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},r.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},r.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},r.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},r.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},r.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},r.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},r.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},r.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},r.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},r.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},r.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},r.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},r.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},r.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},r.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},r.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},r.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var i=e<<1,n=r.ByteBuffer.allocate(i);return n.setPosition(i-e),n.bytes().set(t.bytes(),i-e),n},r.Builder.prototype.addOffset=function(t){this.prep(r.SIZEOF_INT,0),this.writeInt32(this.offset()-t+r.SIZEOF_INT)},r.Builder.prototype.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},r.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var i=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var n=(i+2)*r.SIZEOF_SHORT;this.addInt16(n);var s=0,o=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(n==this.bb.readInt16(a)){for(var b=r.SIZEOF_SHORT;b<n;b+=r.SIZEOF_SHORT)if(this.bb.readInt16(o+b)!=this.bb.readInt16(a+b))continue t;s=this.vtables[e];break}}return s?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,s-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},r.Builder.prototype.finish=function(t,e){if(e){var i=e;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH),i.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var n=r.FILE_IDENTIFIER_LENGTH-1;n>=0;n--)this.writeInt8(i.charCodeAt(n))}this.prep(this.minalign,r.SIZEOF_INT),this.addOffset(t),this.bb.setPosition(this.space)},r.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(0==this.bb.readInt16(i+e))throw new Error("FlatBuffers: field "+e+" must be set")},r.Builder.prototype.startVector=function(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(r.SIZEOF_INT,t*e),this.prep(i,t*e)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var i,n=t.charCodeAt(r++);(i=n<55296||n>=56320?n:(n<<10)+t.charCodeAt(r++)+-56613888)<128?e.push(i):(i<2048?e.push(i>>6&31|192):(i<65536?e.push(i>>12&15|224):e.push(i>>18&7|240,i>>12&63|128),e.push(i>>6&63|128)),e.push(63&i|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),r=0;for(var s=this.space,o=this.bb.bytes();r<e.length;r++)o[s++]=e[r];return this.endVector()},r.Builder.prototype.createLong=function(t,e){return r.Long.create(t,e)},r.ByteBuffer=function(t){this.bytes_=t,this.position_=0},r.ByteBuffer.allocate=function(t){return new r.ByteBuffer(new Uint8Array(t))},r.ByteBuffer.prototype.clear=function(){this.position_=0},r.ByteBuffer.prototype.bytes=function(){return this.bytes_},r.ByteBuffer.prototype.position=function(){return this.position_},r.ByteBuffer.prototype.setPosition=function(t){this.position_=t},r.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},r.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},r.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},r.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},r.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},r.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},r.ByteBuffer.prototype.readInt64=function(t){return new r.Long(this.readInt32(t),this.readInt32(t+4))},r.ByteBuffer.prototype.readUint64=function(t){return new r.Long(this.readUint32(t),this.readUint32(t+4))},r.ByteBuffer.prototype.readFloat32=function(t){return r.int32[0]=this.readInt32(t),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t),r.int32[r.isLittleEndian?1:0]=this.readInt32(t+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},r.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},r.ByteBuffer.prototype.writeFloat32=function(t,e){r.float32[0]=e,this.writeInt32(t,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t,e){r.float64[0]=e,this.writeInt32(t,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<r.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+r.SIZEOF_INT+e));return t},r.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},r.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},r.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var i=this.readInt32(t),n="",s=0;if(t+=r.SIZEOF_INT,e===r.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;s<i;){var o,a=this.readUint8(t+s++);if(a<192)o=a;else{var b=this.readUint8(t+s++);if(a<224)o=(31&a)<<6|63&b;else{var u=this.readUint8(t+s++);o=a<240?(15&a)<<12|(63&b)<<6|63&u:(7&a)<<18|(63&b)<<12|(63&u)<<6|63&this.readUint8(t+s++)}}o<65536?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode(55296+(o>>10),56320+(1023&o)))}return n},r.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},r.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},r.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var e=0;e<r.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+r.SIZEOF_INT+e))return!1;return!0},r.ByteBuffer.prototype.createLong=function(t,e){return r.Long.create(t,e)};class i{constructor(t,e){this.name=t,this.type=e}}!function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(e||(e={}));var n,s,o,a,b=e;class u{constructor(t,e,r){this.geometryType=t,this.columns=e,this.featuresCount=r}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(n||(n={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(s||(s={}));class h{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new h).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new h).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):s.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,s.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return h.start(t),h.addName(t,e),h.addType(t,r),h.end(t)}}class f{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new f).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new f).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):n.Unknown}parts(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new f).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}partsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,n.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,r,i,n,s,o,a,b){return f.start(t),f.addEnds(t,e),f.addXy(t,r),f.addZ(t,i),f.addM(t,n),f.addT(t,s),f.addTm(t,o),f.addType(t,a),f.addParts(t,b),f.end(t)}}class c{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new c).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new c).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}properties(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}propertiesLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}propertiesArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}columns(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new h).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(3)}static addGeometry(t,e){t.addFieldOffset(0,e,0)}static addProperties(t,e){t.addFieldOffset(1,e,0)}static createPropertiesVector(t,e){t.startVector(1,e.length,1);for(var r=e.length-1;r>=0;r--)t.addInt8(e[r]);return t.endVector()}static startPropertiesVector(t,e){t.startVector(1,e,1)}static addColumns(t,e){t.addFieldOffset(2,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,i){return c.start(t),c.addGeometry(t,e),c.addProperties(t,r),c.addColumns(t,i),c.end(t)}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(o||(o={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(a||(a={}));class d{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):a.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,a.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return d.start(t),d.addName(t,e),d.addType(t,r),d.end(t)}}class l{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new l).__init(t.readInt32(t.position())+t.position(),t)}org(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}code(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}name(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}wkt(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(5)}static addOrg(t,e){t.addFieldOffset(0,e,0)}static addCode(t,e){t.addFieldInt32(1,e,0)}static addName(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWkt(t,e){t.addFieldOffset(4,e,0)}static end(t){return t.endObject()}static create(t,e,r,i,n,s){return l.start(t),l.addOrg(t,e),l.addCode(t,r),l.addName(t,i),l.addDescription(t,n),l.addWkt(t,s),l.end(t)}}class p{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new p).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new p).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}envelope(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}envelopeLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}envelopeArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}geometryType(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):o.Unknown}hasZ(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasM(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasT(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasTM(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}columns(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new d).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}featuresCount(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):this.bb.createLong(0,0)}indexNodeSize(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}crs(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new l).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addEnvelope(t,e){t.addFieldOffset(1,e,0)}static createEnvelopeVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,o.Unknown)}static addHasZ(t,e){t.addFieldInt8(3,+e,0)}static addHasM(t,e){t.addFieldInt8(4,+e,0)}static addHasT(t,e){t.addFieldInt8(5,+e,0)}static addHasTM(t,e){t.addFieldInt8(6,+e,0)}static addColumns(t,e){t.addFieldOffset(7,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static addFeaturesCount(t,e){t.addFieldInt64(8,e,t.createLong(0,0))}static addIndexNodeSize(t,e){t.addFieldInt16(9,e,16)}static addCrs(t,e){t.addFieldOffset(10,e,0)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,i,n,s,o,a,b,u,h,f){return p.start(t),p.addName(t,e),p.addEnvelope(t,r),p.addGeometryType(t,i),p.addHasZ(t,n),p.addHasM(t,s),p.addHasT(t,o),p.addHasTM(t,a),p.addColumns(t,b),p.addFeaturesCount(t,u),p.addIndexNodeSize(t,h),p.addCrs(t,f),p.end(t)}}function _(t){return t.reduce((t,e)=>Array.isArray(e)?t.concat(_(e)):t.concat(e),[])}function y(t){const e=[];for(let r=0;r<t.length;r+=2)e.push([t[r],t[r+1]]);return e}function g(t){return o[t]}function I(t){const e=t.coordinates;let r=null,i=null,n=null,s=g(t.type),o=0;switch(t.type){case"Point":r=e;break;case"MultiPoint":case"LineString":r=_(e);break;case"MultiLineString":case"Polygon":const s=e;r=_(s),s.length>1&&(i=s.map(t=>o+=t.length));break;case"MultiPolygon":n=e.map(t=>({type:"Polygon",coordinates:t})).map(I);break;case"GeometryCollection":n=t.geometries.map(I)}return{xy:r,ends:i,type:s,parts:n}}function v(t,e){if(e==o.GeometryCollection){const r=[];for(let e=0;e<t.partsLength();e++){const i=t.parts(e),n=i.type();r.push(v(i,n))}return{type:o[e],geometries:r}}if(e==o.MultiPolygon){const r=[];for(let e=0;e<t.partsLength();e++){const i=t.parts(e);i.type(),r.push(v(i,o.Polygon))}return{type:o[e],coordinates:r.map(t=>t.coordinates)}}const r=function(t,e){const r=t.xyArray();switch(e){case o.Point:return Array.from(r);case o.MultiPoint:case o.LineString:return y(r);case o.MultiLineString:case o.Polygon:return function(t,e){if(!e||0===e.length)return[y(t)];let r=0;return Array.from(e).map(e=>t.slice(r,r=e<<1)).map(t=>y(t))}(r,t.endsArray())}}(t,e);return{type:o[e],coordinates:r}}function w(t,e){const i=e.columns,n=new r.Builder(0),s=new Uint8Array(1e5);let o=0;if(i){const e=new DataView(s.buffer);for(let r=0;r<i.length;r++){const n=i[r],a=t.properties[n.name];if(null!==a)switch(e.setUint16(o,r,!0),o+=2,n.type){case b.Bool:e.setUint8(o,a),o+=1;break;case b.Short:e.setInt16(o,a,!0),o+=2;break;case b.UShort:e.setUint16(o,a,!0),o+=2;break;case b.Int:e.setInt32(o,a,!0),o+=4;break;case b.UInt:e.setUint32(o,a,!0),o+=4;break;case b.Long:e.setBigInt64(o,BigInt(a),!0),o+=8;break;case b.Long:e.setBigUint64(o,BigInt(a),!0),o+=8;break;case b.Double:e.setFloat64(o,a,!0),o+=8;break;case b.String:const t=a,r=(new TextEncoder).encode(t);e.setUint32(o,r.length,!0),o+=4,s.set(r,o),o+=r.length;break;default:throw new Error("Unknown type")}}}let a=null;o>0&&(a=c.createPropertiesVector(n,s.slice(0,o)));const u=function t(e,r){const{xy:i,ends:n,parts:s,type:o}=r;if(s){const r=s.map(r=>t(e,r)),i=f.createPartsVector(e,r);return f.start(e),f.addParts(e,i),f.end(e)}const a=f.createXyVector(e,i);let b=null;return n&&(b=f.createEndsVector(e,n)),f.start(e),b&&f.addEnds(e,b),f.addXy(e,a),f.addType(e,o),f.end(e)}(n,I(t.geometry));c.start(n),c.addGeometry(n,u),a&&c.addProperties(n,a);const h=c.end(n);return n.finishSizePrefixed(h),n.asUint8Array()}function B(t,e){const r=e.columns;let i;i=v(t.geometry(),e.geometryType);const n=function(t,e){if(!e||0===e.length)return;const r=t.propertiesArray(),i=new DataView(r.buffer,r.byteOffset),n=t.propertiesLength();let s=0;const o={};for(;s<n;){const t=i.getUint16(s,!0);s+=2;const n=e[t];switch(n.type){case b.Bool:o[n.name]=!!i.getUint8(s),s+=1;break;case b.Byte:o[n.name]=i.getInt8(s),s+=1;break;case b.UByte:o[n.name]=i.getUint8(s),s+=1;break;case b.Short:o[n.name]=i.getInt16(s,!0),s+=2;break;case b.UShort:o[n.name]=i.getUint16(s,!0),s+=2;break;case b.Int:o[n.name]=i.getInt32(s,!0),s+=4;break;case b.UInt:o[n.name]=i.getUint32(s,!0),s+=4;break;case b.Long:o[n.name]=Number(i.getBigInt64(s,!0)),s+=8;break;case b.ULong:o[n.name]=Number(i.getBigUint64(s,!0)),s+=8;break;case b.Double:o[n.name]=i.getFloat64(s,!0),s+=8;break;case b.DateTime:case b.String:{const t=i.getUint32(s,!0);s+=4;const e=new TextDecoder;o[n.name]=e.decode(r.subarray(s,s+t)),s+=t;break}default:throw new Error("Unknown type "+n.type)}}return o}(t,r),s={type:"Feature",geometry:i};return n&&(s.properties=n),s}var m=new Uint8Array(0);function F(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function E(t){this._source=t,this._array=m,this._index=0}function S(t,e){e=Math.min(Math.max(+e,2),65535);let r=t,i=r;do{r=Math.ceil(r/e),i+=r}while(1!==r);return 40*i}E.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(r){return t._array=m,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:F(e,r.value)}}))},E.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var i=new Uint8Array(t);return i.set(this._array.subarray(this._index)),function n(){return e._source.read().then((function(s){return s.done?(e._array=m,e._index=0,r>0?i.subarray(0,r):null):r+s.value.length>=t?(e._array=s.value,e._index=t-r,i.set(s.value.subarray(0,t-r),r),i):(i.set(s.value,r),r+=s.value.length,n())}))}()},E.prototype.cancel=function(){return this._source.cancel()};const U=new Uint8Array([102,103,98,3,102,103,98,0]);async function*T(t,e,n,s){let o=0,a=new Uint8Array(await t(8));if(o+=8,!a.every((t,e)=>U[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await t(4)),o+=4;let b=new r.ByteBuffer(a);const h=b.readUint32(0);a=new Uint8Array(await t(h)),o+=h,b=new r.ByteBuffer(a);const f=p.getRoot(b),c=f.featuresCount().toFloat64(),d=[];for(let t=0;t<f.columnsLength();t++){const e=f.columns(t);d.push(new i(e.name(),e.type()))}const l=new u(f.geometryType(),d,c),_=f.indexNodeSize();if(_>0){const r=S(c,_);if(n){const i=async(r,i)=>(await e(o+r),await t(i)),a=await async function(t,e,r,i){const n=function(t,e){if(e<2)throw new Error("Node size must be at least 2");if(0===t)throw new Error("Number of items must be greater than 0");let r=t,i=r;const n=[r];do{r=Math.ceil(r/e),i+=r,n.push(r)}while(1!==r);const s=[];r=i;for(let t of n)s.push(r-t),r-=t;s.reverse(),n.reverse();const o=[];for(let t=0;t<n.length;t++)o.push([s[t],s[t]+n[t]]);return o.reverse(),o}(t,e),[[,s]]=n,o=[],a=[];for(o.push([0,n.length-1]);0!==o.length;){const[h,f]=o.pop(),c=h>=s-t,[,d]=n[f],l=Math.min(h+e,d),p=l-h,_=await i(40*h,40*p),y=new Float64Array(_),g=new Uint32Array(_),I=[];for(let t=0;t<5*p;t+=5){const e=y[t+0],r=y[t+1],i=y[t+2],n=y[t+3],s=g[8+(t<<1)];I.push({minX:e,minY:r,maxX:i,maxY:n,offset:s})}for(let t=h;t<l;t++){const e=I[t-h];u=e,(b=r).maxX<u.minX||b.maxY<u.minY||b.minX>u.maxX||b.minY>u.maxY||(c?a.push([e,t-1]):o.push([e.offset,f-1]))}o.sort((t,e)=>e[0]-t[0])}var b,u;return a}(c,_,n,i);o+=r;for(let[r]of a)await e(o+r.offset),yield await L(t,l,s);return}e?await e(o+r):await t(r),o+=r}let y;for(;y=await L(t,l,s);)yield y}async function L(t,e,i){let n=new Uint8Array(await t(4));if(0===n.byteLength)return null;let s=new r.ByteBuffer(n);const o=s.readUint32(0);n=new Uint8Array(await t(o));const a=new Uint8Array(o+4);return a.set(n,4),s=new r.ByteBuffer(a),s.setPosition(4),i(c.getRoot(s),e)}function O(t){const e=new r.Builder(0);let i=null;t.columns&&(i=p.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return d.start(t),d.addName(t,r),d.addType(t,e.type),d.end(t)}(e,t))));const n=e.createString("L1");p.start(e),p.addFeaturesCount(e,new r.Long(t.featuresCount,0)),p.addGeometryType(e,t.geometryType),p.addIndexNodeSize(e,0),i&&p.addColumns(e,i),p.addName(e,n);const s=p.end(e);return e.finishSizePrefixed(s),e.asUint8Array()}function N(t,e){return function(t,e,r){let i=0;return T(async e=>{const r=await fetch(t,{headers:{Range:"bytes=".concat(i,"-").concat(i+e-1)}});return i+=e,await r.arrayBuffer()},async t=>i=t,e,(t,e)=>B(t,e))}(t,e)}r.SIZE_PREFIX_LENGTH=4,r.Builder.prototype.finish=function(t,e,i){var n=!!i;if(e){var s=e;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH+(n?r.SIZE_PREFIX_LENGTH:0)),s.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var o=r.FILE_IDENTIFIER_LENGTH-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,r.SIZEOF_INT+(n?r.SIZE_PREFIX_LENGTH:0)),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},t.deserialize=function(t){return function(t){return{type:"FeatureCollection",features:function(t,e){if(!t.subarray(0,7).every((t,e)=>U[e]===t))throw new Error("Not a FlatGeobuf file");const n=new r.ByteBuffer(t),s=n.readUint32(U.length);n.setPosition(U.length+4);const o=p.getRoot(n),a=o.featuresCount().toFloat64(),b=[];for(let t=0;t<o.columnsLength();t++){const e=o.columns(t);b.push(new i(e.name(),e.type()))}const h=new u(o.geometryType(),b,0);let f=U.length+4+s;const d=o.indexNodeSize();d>0&&(f+=S(a,d));const l=[];for(;f<n.capacity();){const t=n.readUint32(f);n.setPosition(f+4);const r=c.getRoot(n);l.push(e(r,h)),f+=4+t}return l}(t,(t,e)=>B(t,e))}}(t)},t.deserializeFiltered=function(t,e){return N(t,e)},t.deserializeStream=function(t){return function(t){return function(t,e){const r="function"==typeof(i=t).slice?i:new E("function"==typeof i.read?i:i.getReader());var i;return T(async t=>await r.slice(t),void 0,void 0,e)}(t,(t,e)=>B(t,e))}(t)},t.serialize=function(t){return function(t){const e=function(t){const e=t.features[0],r=e.properties;let n=null;r&&(n=Object.keys(r).map(t=>new i(t,function(t){if("boolean"==typeof t)return b.Bool;if("number"==typeof t)return t%1==0?b.Int:b.Double;if("string"==typeof t)return b.String;if(null===t)return b.String;throw new Error("Unknown type (value '".concat(t,"')"))}(r[t]))));const s=new Set;for(const r of t.features)s.add(e.geometry.type);return new u(g(e.geometry.type),n,t.features.length)}(t),r=O(e),n=t.features.map(t=>w(t,e)),s=n.map(t=>t.length).reduce((t,e)=>t+e),o=new Uint8Array(U.length+r.length+s);o.set(r,U.length);let a=U.length+r.length;for(const t of n)o.set(t,a),a+=t.length;return o.set(U),o}(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,r){(function(e){const i=r(3),n="undefined"==typeof window?e:window;n.loaders=n.loaders||{},t.exports=Object.assign(n.loaders,i)}).call(this,r(2))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.r(e),r.d(e,"FlatGeobufLoader",(function(){return s}));var i=r(0);function n(t,e){if(0===t.byteLength)return[];const r=new Uint8Array(t),{features:n}=Object(i.deserialize)(r);return n}const s={...{id:"fgb",name:"FlatGeobuf",version:"2.3.0-alpha.8",extensions:["fgb"],category:"geometry",options:{fgb:{workerUrl:"https://unpkg.com/@loaders.gl/flatgeobuf@2.3.0-alpha.8/dist/flatgeobuf-loader.worker.js"}}},parse:async(t,e)=>n(t),parseSync:n,parseInBatchesFromStream:function(t,e){return Object(i.deserializeStream)(t)},binary:!0}}])})); | ||
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var i in r)("object"==typeof exports?exports:t)[i]=r[i]}}(window,(function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e,r){!function(t){"use strict";var e;!function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(e||(e={}));var r=e;const i={[r.Byte]:Uint8Array,[r.UByte]:Uint8Array,[r.Bool]:Uint8Array,[r.Short]:Uint16Array,[r.UShort]:Uint16Array,[r.Int]:Uint32Array,[r.UInt]:Uint32Array,[r.Long]:BigUint64Array,[r.ULong]:BigUint64Array,[r.Double]:Float64Array};class n{constructor(t,e){this.name=t,this.type=e,this.arrayType=i[e]}}class s{constructor(t,e,r,i){this.geometryType=t,this.columns=e,this.featuresCount=r,this.crs=i}}var o,a,b,u,h={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};h.int32=new Int32Array(2),h.float32=new Float32Array(h.int32.buffer),h.float64=new Float64Array(h.int32.buffer),h.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],h.Long=function(t,e){this.low=0|t,this.high=0|e},h.Long.create=function(t,e){return 0==t&&0==e?h.Long.ZERO:new h.Long(t,e)},h.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},h.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},h.Long.ZERO=new h.Long(0,0),h.Builder=function(t){if(t)e=t;else var e=1024;this.bb=h.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},h.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},h.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},h.Builder.prototype.dataBuffer=function(){return this.bb},h.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},h.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var r=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<r+t+e;){var i=this.bb.capacity();this.bb=h.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(r)},h.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},h.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},h.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},h.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},h.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},h.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},h.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},h.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},h.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},h.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},h.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},h.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},h.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},h.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},h.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},h.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},h.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},h.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},h.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},h.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},h.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},h.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},h.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},h.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},h.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},h.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var r=e<<1,i=h.ByteBuffer.allocate(r);return i.setPosition(r-e),i.bytes().set(t.bytes(),r-e),i},h.Builder.prototype.addOffset=function(t){this.prep(h.SIZEOF_INT,0),this.writeInt32(this.offset()-t+h.SIZEOF_INT)},h.Builder.prototype.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},h.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var r=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var i=(r+2)*h.SIZEOF_SHORT;this.addInt16(i);var n=0,s=this.space;t:for(e=0;e<this.vtables.length;e++){var o=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(o)){for(var a=h.SIZEOF_SHORT;a<i;a+=h.SIZEOF_SHORT)if(this.bb.readInt16(s+a)!=this.bb.readInt16(o+a))continue t;n=this.vtables[e];break}}return n?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,n-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},h.Builder.prototype.finish=function(t,e,r){var i=r?h.SIZE_PREFIX_LENGTH:0;if(e){var n=e;if(this.prep(this.minalign,h.SIZEOF_INT+h.FILE_IDENTIFIER_LENGTH+i),n.length!=h.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+h.FILE_IDENTIFIER_LENGTH);for(var s=h.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(n.charCodeAt(s))}this.prep(this.minalign,h.SIZEOF_INT+i),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},h.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},h.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,i=r-this.bb.readInt32(r);if(0==this.bb.readInt16(i+e))throw new Error("FlatBuffers: field "+e+" must be set")},h.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(h.SIZEOF_INT,t*e),this.prep(r,t*e)},h.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},h.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var i,n=t.charCodeAt(r++);(i=n<55296||n>=56320?n:(n<<10)+t.charCodeAt(r++)+-56613888)<128?e.push(i):(i<2048?e.push(i>>6&31|192):(i<65536?e.push(i>>12&15|224):e.push(i>>18&7|240,i>>12&63|128),e.push(i>>6&63|128)),e.push(63&i|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),r=0;for(var s=this.space,o=this.bb.bytes();r<e.length;r++)o[s++]=e[r];return this.endVector()},h.Builder.prototype.createLong=function(t,e){return h.Long.create(t,e)},h.ByteBuffer=function(t){this.bytes_=t,this.position_=0},h.ByteBuffer.allocate=function(t){return new h.ByteBuffer(new Uint8Array(t))},h.ByteBuffer.prototype.clear=function(){this.position_=0},h.ByteBuffer.prototype.bytes=function(){return this.bytes_},h.ByteBuffer.prototype.position=function(){return this.position_},h.ByteBuffer.prototype.setPosition=function(t){this.position_=t},h.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},h.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},h.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},h.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},h.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},h.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},h.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},h.ByteBuffer.prototype.readInt64=function(t){return new h.Long(this.readInt32(t),this.readInt32(t+4))},h.ByteBuffer.prototype.readUint64=function(t){return new h.Long(this.readUint32(t),this.readUint32(t+4))},h.ByteBuffer.prototype.readFloat32=function(t){return h.int32[0]=this.readInt32(t),h.float32[0]},h.ByteBuffer.prototype.readFloat64=function(t){return h.int32[h.isLittleEndian?0:1]=this.readInt32(t),h.int32[h.isLittleEndian?1:0]=this.readInt32(t+4),h.float64[0]},h.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},h.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},h.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},h.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},h.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},h.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},h.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},h.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},h.ByteBuffer.prototype.writeFloat32=function(t,e){h.float32[0]=e,this.writeInt32(t,h.int32[0])},h.ByteBuffer.prototype.writeFloat64=function(t,e){h.float64[0]=e,this.writeInt32(t,h.int32[h.isLittleEndian?0:1]),this.writeInt32(t+4,h.int32[h.isLittleEndian?1:0])},h.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+h.SIZEOF_INT+h.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<h.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+h.SIZEOF_INT+e));return t},h.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},h.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},h.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),i="",n=0;if(t+=h.SIZEOF_INT,e===h.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;n<r;){var s,o=this.readUint8(t+n++);if(o<192)s=o;else{var a=this.readUint8(t+n++);if(o<224)s=(31&o)<<6|63&a;else{var b=this.readUint8(t+n++);s=o<240?(15&o)<<12|(63&a)<<6|63&b:(7&o)<<18|(63&a)<<12|(63&b)<<6|63&this.readUint8(t+n++)}}s<65536?i+=String.fromCharCode(s):(s-=65536,i+=String.fromCharCode(55296+(s>>10),56320+(1023&s)))}return i},h.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},h.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+h.SIZEOF_INT},h.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},h.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=h.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+h.FILE_IDENTIFIER_LENGTH);for(var e=0;e<h.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+h.SIZEOF_INT+e))return!1;return!0},h.ByteBuffer.prototype.createLong=function(t,e){return h.Long.create(t,e)},function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(o||(o={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(a||(a={}));class c{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new c).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+h.SIZE_PREFIX_LENGTH),(e||new c).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):a.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,a.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return c.start(t),c.addName(t,e),c.addType(t,r),c.end(t)}}class f{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new f).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+h.SIZE_PREFIX_LENGTH),(e||new f).__init(t.readInt32(t.position())+t.position(),t)}org(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}code(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}name(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}wkt(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(5)}static addOrg(t,e){t.addFieldOffset(0,e,0)}static addCode(t,e){t.addFieldInt32(1,e,0)}static addName(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWkt(t,e){t.addFieldOffset(4,e,0)}static end(t){return t.endObject()}static create(t,e,r,i,n,s){return f.start(t),f.addOrg(t,e),f.addCode(t,r),f.addName(t,i),f.addDescription(t,n),f.addWkt(t,s),f.end(t)}}class d{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+h.SIZE_PREFIX_LENGTH),(e||new d).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}envelope(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}envelopeLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}envelopeArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}geometryType(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):o.Unknown}hasZ(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasM(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasT(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasTM(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}columns(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new c).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}featuresCount(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):this.bb.createLong(0,0)}indexNodeSize(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}crs(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new f).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addEnvelope(t,e){t.addFieldOffset(1,e,0)}static createEnvelopeVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,o.Unknown)}static addHasZ(t,e){t.addFieldInt8(3,+e,0)}static addHasM(t,e){t.addFieldInt8(4,+e,0)}static addHasT(t,e){t.addFieldInt8(5,+e,0)}static addHasTM(t,e){t.addFieldInt8(6,+e,0)}static addColumns(t,e){t.addFieldOffset(7,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static addFeaturesCount(t,e){t.addFieldInt64(8,e,t.createLong(0,0))}static addIndexNodeSize(t,e){t.addFieldInt16(9,e,16)}static addCrs(t,e){t.addFieldOffset(10,e,0)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,i,n,s,o,a,b,u,h,c){return d.start(t),d.addName(t,e),d.addEnvelope(t,r),d.addGeometryType(t,i),d.addHasZ(t,n),d.addHasM(t,s),d.addHasT(t,o),d.addHasTM(t,a),d.addColumns(t,b),d.addFeaturesCount(t,u),d.addIndexNodeSize(t,h),d.addCrs(t,c),d.end(t)}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(b||(b={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(u||(u={}));class l{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+h.SIZE_PREFIX_LENGTH),(e||new l).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):u.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,u.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return l.start(t),l.addName(t,e),l.addType(t,r),l.end(t)}}class p{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new p).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+h.SIZE_PREFIX_LENGTH),(e||new p).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):b.Unknown}parts(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new p).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}partsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,b.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,r,i,n,s,o,a,b){return p.start(t),p.addEnds(t,e),p.addXy(t,r),p.addZ(t,i),p.addM(t,n),p.addT(t,s),p.addTm(t,o),p.addType(t,a),p.addParts(t,b),p.end(t)}}class _{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new _).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+h.SIZE_PREFIX_LENGTH),(e||new _).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new p).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}properties(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}propertiesLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}propertiesArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}columns(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new l).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(3)}static addGeometry(t,e){t.addFieldOffset(0,e,0)}static addProperties(t,e){t.addFieldOffset(1,e,0)}static createPropertiesVector(t,e){t.startVector(1,e.length,1);for(var r=e.length-1;r>=0;r--)t.addInt8(e[r]);return t.endVector()}static startPropertiesVector(t,e){t.startVector(1,e,1)}static addColumns(t,e){t.addFieldOffset(2,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,i){return _.start(t),_.addGeometry(t,e),_.addProperties(t,r),_.addColumns(t,i),_.end(t)}}function y(t,e,r){if(0!==t.length)if(Array.isArray(t[0]))for(const i of t)y(i,e,r);else 2===t.length?e.push(...t):(e.push(t[0],t[1]),r.push(t[2]))}function g(t,e){const r=[];for(let i=0;i<t.length;i+=2){const n=[t[i],t[i+1]];e&&n.push(e[i>>1]),r.push(n)}return r}function v(t){return o[t]}function I(t){const e=t.coordinates,r=[],i=[];let n=null,s=null;const o=v(t.type);let a=0;switch(t.type){case"Point":y(e,r,i);break;case"MultiPoint":case"LineString":y(e,r,i);break;case"MultiLineString":case"Polygon":{const t=e;y(t,r,i),t.length>1&&(n=t.map(t=>a+=t.length));break}case"MultiPolygon":s=e.map(t=>({type:"Polygon",coordinates:t})).map(I);break;case"GeometryCollection":s=t.geometries.map(I)}return{xy:r,z:i.length>0?i:void 0,ends:n,type:o,parts:s}}function w(t,e){if(e===o.GeometryCollection){const r=[];for(let e=0;e<t.partsLength();e++){const i=t.parts(e),n=i.type();r.push(w(i,n))}return{type:o[e],geometries:r}}if(e===o.MultiPolygon){const r=[];for(let e=0;e<t.partsLength();e++)r.push(w(t.parts(e),o.Polygon));return{type:o[e],coordinates:r.map(t=>t.coordinates)}}const r=function(t,e){const r=t.xyArray(),i=t.zArray();switch(e){case o.Point:{const t=Array.from(r);return i&&t.push(i[0]),t}case o.MultiPoint:case o.LineString:return g(r,i);case o.MultiLineString:case o.Polygon:return function(t,e,r){if(!r||0===r.length)return[g(t,e)];let i=0;const n=Array.from(r).map(e=>t.slice(i,i=e<<1));let s=null;return e&&(i=0,s=Array.from(r).map(t=>e.slice(i,i=t))),n.map((t,r)=>g(t,e?s[r]:void 0))}(r,i,t.endsArray())}}(t,e);return{type:o[e],coordinates:r}}const B=new TextEncoder,m=new TextDecoder;function F(t,e){const i=e.columns,n=w(t.geometry(),e.geometryType),s=function(t,e){if(!e||0===e.length)return;const i=t.propertiesArray(),n=new DataView(i.buffer,i.byteOffset),s=t.propertiesLength();let o=0;const a={};for(;o<s;){const t=n.getUint16(o,!0);o+=2;const s=e[t];switch(s.type){case r.Bool:a[s.name]=!!n.getUint8(o),o+=1;break;case r.Byte:a[s.name]=n.getInt8(o),o+=1;break;case r.UByte:a[s.name]=n.getUint8(o),o+=1;break;case r.Short:a[s.name]=n.getInt16(o,!0),o+=2;break;case r.UShort:a[s.name]=n.getUint16(o,!0),o+=2;break;case r.Int:a[s.name]=n.getInt32(o,!0),o+=4;break;case r.UInt:a[s.name]=n.getUint32(o,!0),o+=4;break;case r.Long:a[s.name]=Number(n.getBigInt64(o,!0)),o+=8;break;case r.ULong:a[s.name]=Number(n.getBigUint64(o,!0)),o+=8;break;case r.Double:a[s.name]=n.getFloat64(o,!0),o+=8;break;case r.DateTime:case r.String:{const t=n.getUint32(o,!0);o+=4,a[s.name]=m.decode(i.subarray(o,o+t)),o+=t;break}default:throw new Error("Unknown type "+s.type)}}return a}(t,i),o={type:"Feature",geometry:n};return s&&(o.properties=s),o}var U=new Uint8Array(0);function S(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function E(t){this._source=t,this._array=U,this._index=0}E.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(r){return t._array=U,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:S(e,r.value)}}))},E.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var i=new Uint8Array(t);return i.set(this._array.subarray(this._index)),function n(){return e._source.read().then((function(s){return s.done?(e._array=U,e._index=0,r>0?i.subarray(0,r):null):r+s.value.length>=t?(e._array=s.value,e._index=t-r,i.set(s.value.subarray(0,t-r),r),i):(i.set(s.value,r),r+=s.value.length,n())}))}()},E.prototype.cancel=function(){return this._source.cancel()};class L{constructor(t,e,r,i,n){this.org=t,this.code=e,this.name=r,this.description=i,this.wkt=n}}function T(t,e){e=Math.min(Math.max(+e,2),65535);let r=t,i=r;do{r=Math.ceil(r/e),i+=r}while(1!==r);return 40*i}const O=new Uint8Array([102,103,98,3,102,103,98,0]);async function*P(t,e,r,i,o){let a=0,b=new Uint8Array(await t(8));if(a+=8,!b.every((t,e)=>O[e]===t))throw new Error("Not a FlatGeobuf file");b=new Uint8Array(await t(4)),a+=4;let u=new h.ByteBuffer(b);const c=u.readUint32(0);b=new Uint8Array(await t(c)),a+=c,u=new h.ByteBuffer(b);const f=d.getRoot(u),l=f.featuresCount().toFloat64(),p=[];for(let t=0;t<f.columnsLength();t++){const e=f.columns(t);p.push(new n(e.name(),e.type()))}const _=f.crs(),y=_?new L(_.org(),_.code(),_.name(),_.description(),_.wkt()):null,g=new s(f.geometryType(),p,l,y);o&&o(g);const v=f.indexNodeSize();if(v>0){const n=T(l,v);if(r){const s=async(r,i)=>(await e(a+r),await t(i)),o=[];for await(const[t]of async function*(t,e,r,i){const{minX:n,minY:s,maxX:o,maxY:a}=r,b=function(t,e){if(e<2)throw new Error("Node size must be at least 2");if(0===t)throw new Error("Number of items must be greater than 0");let r=t,i=r;const n=[r];do{r=Math.ceil(r/e),i+=r,n.push(r)}while(1!==r);const s=[];r=i;for(const t of n)s.push(r-t),r-=t;s.reverse(),n.reverse();const o=[];for(let t=0;t<n.length;t++)o.push([s[t],s[t]+n[t]]);return o.reverse(),o}(t,e),[[u,h]]=b,c=[];for(c.push([0,b.length-1]);0!==c.length;){const[r,f]=c.pop(),d=r>=h-t,[,l]=b[f],p=Math.min(r+e,l),_=p-r,y=await i(40*r,40*_),g=new Float64Array(y),v=new Uint32Array(y);for(let t=r;t<p;t++){const e=5*(t-r);if(o<g[e+0])continue;if(a<g[e+1])continue;if(n>g[e+2])continue;if(s>g[e+3])continue;const i=v[8+(e<<1)];d?yield[i,t-u]:c.push([i,f-1])}c.sort((t,e)=>e[0]-t[0])}}(l,v,r,s))o.push(t);a+=n;for await(const r of o)await e(a+r),yield await N(t,g,i);return}e?await e(a+n):await t(n),a+=n}let I;for(;I=await N(t,g,i);)yield I}async function N(t,e,r){let i=new Uint8Array(await t(4));if(0===i.byteLength)return null;let n=new h.ByteBuffer(i);const s=n.readUint32(0);i=new Uint8Array(await t(s));const o=new Uint8Array(s+4);return o.set(i,4),n=new h.ByteBuffer(o),n.setPosition(4),r(_.getRoot(n),e)}function A(t){const e=function(t){const e=t.features[0],i=e.properties;let o=null;return i&&(o=Object.keys(i).map(t=>new n(t,function(t){if("boolean"==typeof t)return r.Bool;if("number"==typeof t)return t%1==0?r.Int:r.Double;if("string"==typeof t)return r.String;if(null===t)return r.String;throw new Error(`Unknown type (value '${t}')`)}(i[t])))),new s(v(e.geometry.type),o,t.features.length)}(t),i=function(t){const e=new h.Builder;let r=null;t.columns&&(r=d.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return c.start(t),c.addName(t,r),c.addType(t,e.type),c.end(t)}(e,t))));const i=e.createString("L1");d.start(e),d.addFeaturesCount(e,new h.Long(t.featuresCount,0)),d.addGeometryType(e,t.geometryType),d.addIndexNodeSize(e,0),r&&d.addColumns(e,r),d.addName(e,i);const n=d.end(e);return e.finishSizePrefixed(n),e.asUint8Array()}(e),o=t.features.map(t=>function(t,e,i){const n=i.columns,s=new h.Builder,o=[];if(n)for(let t=0;t<n.length;t++){const i=n[t],s=e[i.name];if(null!==s)switch(o.push(Uint16Array.of(t)),i.type){case r.Bool:case r.Short:case r.UShort:case r.Int:case r.UInt:case r.Long:case r.Double:o.push(i.arrayType.of(s));break;case r.DateTime:case r.String:{const t=B.encode(s);o.push(Uint32Array.of(t.length)),o.push(t);break}default:throw new Error("Unknown type "+i.type)}}let a=null;o.length>0&&(a=_.createPropertiesVector(s,function(t,...e){let r=0;for(const t of e)r+=t.byteLength;const i=new t(r);let n=0;for(const r of e)r instanceof Uint8Array?i.set(r,n):i.set(new t(r.buffer),n),n+=r.byteLength;return i}(Uint8Array,...o)));const b=function t(e,r){const{xy:i,z:n,ends:s,parts:o,type:a}=r;if(o){const r=o.map(r=>t(e,r)),i=p.createPartsVector(e,r);return p.start(e),p.addParts(e,i),p.end(e)}const b=p.createXyVector(e,i);let u=null;n&&(u=p.createZVector(e,n));let h=null;return s&&(h=p.createEndsVector(e,s)),p.start(e),h&&p.addEnds(e,h),p.addXy(e,b),u&&p.addZ(e,u),p.addType(e,a),p.end(e)}(s,t);_.start(s),_.addGeometry(s,b),a&&_.addProperties(s,a);const u=_.end(s);return s.finishSizePrefixed(u),s.asUint8Array()}(I(t.geometry),t.properties,e)),a=o.map(t=>t.length).reduce((t,e)=>t+e),b=new Uint8Array(O.length+i.length+a);b.set(i,O.length);let u=O.length+i.length;for(const t of o)b.set(t,u),u+=t.length;return b.set(O),b}t.deserialize=function(t,e,r){return t instanceof Uint8Array?function(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,7).every((t,e)=>O[e]===t))throw new Error("Not a FlatGeobuf file");const i=new h.ByteBuffer(t),o=i.readUint32(O.length);i.setPosition(O.length+4);const a=d.getRoot(i),b=a.featuresCount().toFloat64(),u=[];for(let t=0;t<a.columnsLength();t++){const e=a.columns(t);u.push(new n(e.name(),e.type()))}const c=a.crs(),f=c?new L(c.org(),c.code(),c.name(),c.description(),c.wkt()):null,l=new s(a.geometryType(),u,0,f);r&&r(l);let p=O.length+4+o;const y=a.indexNodeSize();y>0&&(p+=T(b,y));const g=[];for(;p<i.capacity();){const t=i.readUint32(p);i.setPosition(p+4);const r=_.getRoot(i);g.push(e(r,l)),p+=4+t}return g}(t,F,e)}}(t,r):t instanceof ReadableStream?function(t,e){return function(t,e,r){const i="function"==typeof(n=t).slice?n:new E("function"==typeof n.read?n:n.getReader());var n;return P(async t=>await i.slice(t),void 0,void 0,e,r)}(t,F,e)}(t,r):function(t,e,r){return function(t,e,r,i){let n=0;return P(async e=>{const r=await fetch(t,{headers:{Range:`bytes=${n}-${n+e-1}`}});return n+=e,await r.arrayBuffer()},async t=>{n=t},e,r,i)}(t,e,F,r)}(t,e,r)},t.serialize=function(t){return A(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,r){(function(e){const i=r(3),n="undefined"==typeof window?e:window;n.loaders=n.loaders||{},t.exports=Object.assign(n.loaders,i)}).call(this,r(2))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";r.r(e),r.d(e,"FlatGeobufLoader",(function(){return s}));var i=r(0);function n(t,e){if(0===t.byteLength)return[];const r=new Uint8Array(t),{features:n}=Object(i.deserialize)(r);return n}const s={...{id:"fgb",name:"FlatGeobuf",version:"2.3.0-alpha.9",extensions:["fgb"],category:"geometry",options:{fgb:{workerUrl:"https://unpkg.com/@loaders.gl/flatgeobuf@2.3.0-alpha.9/dist/flatgeobuf-loader.worker.js"}}},parse:async(t,e)=>n(t),parseSync:n,parseInBatchesFromStream:function(t,e){return Object(i.deserializeStream)(t)},binary:!0}}])})); |
@@ -24,3 +24,3 @@ "use strict"; | ||
var VERSION = typeof "2.3.0-alpha.8" !== 'undefined' ? "2.3.0-alpha.8" : 'latest'; | ||
var VERSION = typeof "2.3.0-alpha.9" !== 'undefined' ? "2.3.0-alpha.9" : 'latest'; | ||
var FlatGeobufWorkerLoader = { | ||
@@ -27,0 +27,0 @@ id: 'fgb', |
@@ -1,9 +0,3 @@ | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
import parseFlatGeobuf, { parseFlatGeobufInBatches } from './lib/parse-flatgeobuf'; | ||
const VERSION = typeof "2.3.0-alpha.8" !== 'undefined' ? "2.3.0-alpha.8" : 'latest'; | ||
const VERSION = typeof "2.3.0-alpha.9" !== 'undefined' ? "2.3.0-alpha.9" : 'latest'; | ||
export const FlatGeobufWorkerLoader = { | ||
@@ -21,3 +15,3 @@ id: 'fgb', | ||
}; | ||
export const FlatGeobufLoader = _objectSpread(_objectSpread({}, FlatGeobufWorkerLoader), {}, { | ||
export const FlatGeobufLoader = { ...FlatGeobufWorkerLoader, | ||
parse: async (arrayBuffer, options) => parseFlatGeobuf(arrayBuffer, options), | ||
@@ -27,3 +21,3 @@ parseSync: parseFlatGeobuf, | ||
binary: true | ||
}); | ||
}; | ||
//# sourceMappingURL=flatgeobuf-loader.js.map |
@@ -10,3 +10,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator"; | ||
import parseFlatGeobuf, { parseFlatGeobufInBatches } from './lib/parse-flatgeobuf'; | ||
var VERSION = typeof "2.3.0-alpha.8" !== 'undefined' ? "2.3.0-alpha.8" : 'latest'; | ||
var VERSION = typeof "2.3.0-alpha.9" !== 'undefined' ? "2.3.0-alpha.9" : 'latest'; | ||
export var FlatGeobufWorkerLoader = { | ||
@@ -13,0 +13,0 @@ id: 'fgb', |
@@ -1,1 +0,1 @@ | ||
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){function r(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,u,"next",t)}function u(t){r(s,i,o,a,u,"throw",t)}a(void 0)}))}}},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e,r){!function(t){"use strict";var e,r={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(t,e){this.low=0|t,this.high=0|e},r.Long.create=function(t,e){return 0==t&&0==e?r.Long.ZERO:new r.Long(t,e)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t){if(t)e=t;else var e=1024;this.bb=r.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var n=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<n+t+e;){var i=this.bb.capacity();this.bb=r.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(n)},r.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},r.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},r.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},r.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},r.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},r.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},r.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},r.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},r.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},r.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},r.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},r.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},r.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},r.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},r.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},r.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},r.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},r.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},r.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},r.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},r.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},r.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},r.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},r.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},r.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},r.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var n=e<<1,i=r.ByteBuffer.allocate(n);return i.setPosition(n-e),i.bytes().set(t.bytes(),n-e),i},r.Builder.prototype.addOffset=function(t){this.prep(r.SIZEOF_INT,0),this.writeInt32(this.offset()-t+r.SIZEOF_INT)},r.Builder.prototype.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},r.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var n=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var i=(n+2)*r.SIZEOF_SHORT;this.addInt16(i);var o=0,s=this.space;t:for(e=0;e<this.vtables.length;e++){var a=this.bb.capacity()-this.vtables[e];if(i==this.bb.readInt16(a)){for(var u=r.SIZEOF_SHORT;u<i;u+=r.SIZEOF_SHORT)if(this.bb.readInt16(s+u)!=this.bb.readInt16(a+u))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},r.Builder.prototype.finish=function(t,e){if(e){var n=e;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH),n.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var i=r.FILE_IDENTIFIER_LENGTH-1;i>=0;i--)this.writeInt8(n.charCodeAt(i))}this.prep(this.minalign,r.SIZEOF_INT),this.addOffset(t),this.bb.setPosition(this.space)},r.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,n=r-this.bb.readInt32(r);if(0==this.bb.readInt16(n+e))throw new Error("FlatBuffers: field "+e+" must be set")},r.Builder.prototype.startVector=function(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(r.SIZEOF_INT,t*e),this.prep(n,t*e)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var n,i=t.charCodeAt(r++);(n=i<55296||i>=56320?i:(i<<10)+t.charCodeAt(r++)+-56613888)<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(63&n|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),r=0;for(var o=this.space,s=this.bb.bytes();r<e.length;r++)s[o++]=e[r];return this.endVector()},r.Builder.prototype.createLong=function(t,e){return r.Long.create(t,e)},r.ByteBuffer=function(t){this.bytes_=t,this.position_=0},r.ByteBuffer.allocate=function(t){return new r.ByteBuffer(new Uint8Array(t))},r.ByteBuffer.prototype.clear=function(){this.position_=0},r.ByteBuffer.prototype.bytes=function(){return this.bytes_},r.ByteBuffer.prototype.position=function(){return this.position_},r.ByteBuffer.prototype.setPosition=function(t){this.position_=t},r.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},r.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},r.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},r.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},r.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},r.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},r.ByteBuffer.prototype.readInt64=function(t){return new r.Long(this.readInt32(t),this.readInt32(t+4))},r.ByteBuffer.prototype.readUint64=function(t){return new r.Long(this.readUint32(t),this.readUint32(t+4))},r.ByteBuffer.prototype.readFloat32=function(t){return r.int32[0]=this.readInt32(t),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t),r.int32[r.isLittleEndian?1:0]=this.readInt32(t+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},r.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},r.ByteBuffer.prototype.writeFloat32=function(t,e){r.float32[0]=e,this.writeInt32(t,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t,e){r.float64[0]=e,this.writeInt32(t,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<r.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+r.SIZEOF_INT+e));return t},r.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},r.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},r.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var n=this.readInt32(t),i="",o=0;if(t+=r.SIZEOF_INT,e===r.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+n);for(;o<n;){var s,a=this.readUint8(t+o++);if(a<192)s=a;else{var u=this.readUint8(t+o++);if(a<224)s=(31&a)<<6|63&u;else{var c=this.readUint8(t+o++);s=a<240?(15&a)<<12|(63&u)<<6|63&c:(7&a)<<18|(63&u)<<12|(63&c)<<6|63&this.readUint8(t+o++)}}s<65536?i+=String.fromCharCode(s):(s-=65536,i+=String.fromCharCode(55296+(s>>10),56320+(1023&s)))}return i},r.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},r.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},r.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var e=0;e<r.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+r.SIZEOF_INT+e))return!1;return!0},r.ByteBuffer.prototype.createLong=function(t,e){return r.Long.create(t,e)};class n{constructor(t,e){this.name=t,this.type=e}}!function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(e||(e={}));var i,o,s,a,u=e;class c{constructor(t,e,r){this.geometryType=t,this.columns=e,this.featuresCount=r}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(i||(i={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(o||(o={}));class f{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new f).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new f).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):o.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,o.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return f.start(t),f.addName(t,e),f.addType(t,r),f.end(t)}}class h{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new h).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new h).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):i.Unknown}parts(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new h).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}partsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,i.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,r,n,i,o,s,a,u){return h.start(t),h.addEnds(t,e),h.addXy(t,r),h.addZ(t,n),h.addM(t,i),h.addT(t,o),h.addTm(t,s),h.addType(t,a),h.addParts(t,u),h.end(t)}}class b{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new b).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new b).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new h).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}properties(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}propertiesLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}propertiesArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}columns(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new f).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(3)}static addGeometry(t,e){t.addFieldOffset(0,e,0)}static addProperties(t,e){t.addFieldOffset(1,e,0)}static createPropertiesVector(t,e){t.startVector(1,e.length,1);for(var r=e.length-1;r>=0;r--)t.addInt8(e[r]);return t.endVector()}static startPropertiesVector(t,e){t.startVector(1,e,1)}static addColumns(t,e){t.addFieldOffset(2,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,n){return b.start(t),b.addGeometry(t,e),b.addProperties(t,r),b.addColumns(t,n),b.end(t)}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(s||(s={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(a||(a={}));class l{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new l).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):a.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,a.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return l.start(t),l.addName(t,e),l.addType(t,r),l.end(t)}}class d{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}org(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}code(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}name(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}wkt(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(5)}static addOrg(t,e){t.addFieldOffset(0,e,0)}static addCode(t,e){t.addFieldInt32(1,e,0)}static addName(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWkt(t,e){t.addFieldOffset(4,e,0)}static end(t){return t.endObject()}static create(t,e,r,n,i,o){return d.start(t),d.addOrg(t,e),d.addCode(t,r),d.addName(t,n),d.addDescription(t,i),d.addWkt(t,o),d.end(t)}}class p{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new p).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return(e||new p).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}envelope(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}envelopeLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}envelopeArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}geometryType(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):s.Unknown}hasZ(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasM(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasT(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasTM(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}columns(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new l).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}featuresCount(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):this.bb.createLong(0,0)}indexNodeSize(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}crs(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new d).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addEnvelope(t,e){t.addFieldOffset(1,e,0)}static createEnvelopeVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,s.Unknown)}static addHasZ(t,e){t.addFieldInt8(3,+e,0)}static addHasM(t,e){t.addFieldInt8(4,+e,0)}static addHasT(t,e){t.addFieldInt8(5,+e,0)}static addHasTM(t,e){t.addFieldInt8(6,+e,0)}static addColumns(t,e){t.addFieldOffset(7,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static addFeaturesCount(t,e){t.addFieldInt64(8,e,t.createLong(0,0))}static addIndexNodeSize(t,e){t.addFieldInt16(9,e,16)}static addCrs(t,e){t.addFieldOffset(10,e,0)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,n,i,o,s,a,u,c,f,h){return p.start(t),p.addName(t,e),p.addEnvelope(t,r),p.addGeometryType(t,n),p.addHasZ(t,i),p.addHasM(t,o),p.addHasT(t,s),p.addHasTM(t,a),p.addColumns(t,u),p.addFeaturesCount(t,c),p.addIndexNodeSize(t,f),p.addCrs(t,h),p.end(t)}}function y(t){return t.reduce((t,e)=>Array.isArray(e)?t.concat(y(e)):t.concat(e),[])}function _(t){const e=[];for(let r=0;r<t.length;r+=2)e.push([t[r],t[r+1]]);return e}function g(t){return s[t]}function v(t){const e=t.coordinates;let r=null,n=null,i=null,o=g(t.type),s=0;switch(t.type){case"Point":r=e;break;case"MultiPoint":case"LineString":r=y(e);break;case"MultiLineString":case"Polygon":const o=e;r=y(o),o.length>1&&(n=o.map(t=>s+=t.length));break;case"MultiPolygon":i=e.map(t=>({type:"Polygon",coordinates:t})).map(v);break;case"GeometryCollection":i=t.geometries.map(v)}return{xy:r,ends:n,type:o,parts:i}}function w(t,e){if(e==s.GeometryCollection){const r=[];for(let e=0;e<t.partsLength();e++){const n=t.parts(e),i=n.type();r.push(w(n,i))}return{type:s[e],geometries:r}}if(e==s.MultiPolygon){const r=[];for(let e=0;e<t.partsLength();e++){const n=t.parts(e);n.type(),r.push(w(n,s.Polygon))}return{type:s[e],coordinates:r.map(t=>t.coordinates)}}const r=function(t,e){const r=t.xyArray();switch(e){case s.Point:return Array.from(r);case s.MultiPoint:case s.LineString:return _(r);case s.MultiLineString:case s.Polygon:return function(t,e){if(!e||0===e.length)return[_(t)];let r=0;return Array.from(e).map(e=>t.slice(r,r=e<<1)).map(t=>_(t))}(r,t.endsArray())}}(t,e);return{type:s[e],coordinates:r}}function m(t,e){const n=e.columns,i=new r.Builder(0),o=new Uint8Array(1e5);let s=0;if(n){const e=new DataView(o.buffer);for(let r=0;r<n.length;r++){const i=n[r],a=t.properties[i.name];if(null!==a)switch(e.setUint16(s,r,!0),s+=2,i.type){case u.Bool:e.setUint8(s,a),s+=1;break;case u.Short:e.setInt16(s,a,!0),s+=2;break;case u.UShort:e.setUint16(s,a,!0),s+=2;break;case u.Int:e.setInt32(s,a,!0),s+=4;break;case u.UInt:e.setUint32(s,a,!0),s+=4;break;case u.Long:e.setBigInt64(s,BigInt(a),!0),s+=8;break;case u.Long:e.setBigUint64(s,BigInt(a),!0),s+=8;break;case u.Double:e.setFloat64(s,a,!0),s+=8;break;case u.String:const t=a,r=(new TextEncoder).encode(t);e.setUint32(s,r.length,!0),s+=4,o.set(r,s),s+=r.length;break;default:throw new Error("Unknown type")}}}let a=null;s>0&&(a=b.createPropertiesVector(i,o.slice(0,s)));const c=function t(e,r){const{xy:n,ends:i,parts:o,type:s}=r;if(o){const r=o.map(r=>t(e,r)),n=h.createPartsVector(e,r);return h.start(e),h.addParts(e,n),h.end(e)}const a=h.createXyVector(e,n);let u=null;return i&&(u=h.createEndsVector(e,i)),h.start(e),u&&h.addEnds(e,u),h.addXy(e,a),h.addType(e,s),h.end(e)}(i,v(t.geometry));b.start(i),b.addGeometry(i,c),a&&b.addProperties(i,a);const f=b.end(i);return i.finishSizePrefixed(f),i.asUint8Array()}function I(t,e){const r=e.columns;let n;n=w(t.geometry(),e.geometryType);const i=function(t,e){if(!e||0===e.length)return;const r=t.propertiesArray(),n=new DataView(r.buffer,r.byteOffset),i=t.propertiesLength();let o=0;const s={};for(;o<i;){const t=n.getUint16(o,!0);o+=2;const i=e[t];switch(i.type){case u.Bool:s[i.name]=!!n.getUint8(o),o+=1;break;case u.Byte:s[i.name]=n.getInt8(o),o+=1;break;case u.UByte:s[i.name]=n.getUint8(o),o+=1;break;case u.Short:s[i.name]=n.getInt16(o,!0),o+=2;break;case u.UShort:s[i.name]=n.getUint16(o,!0),o+=2;break;case u.Int:s[i.name]=n.getInt32(o,!0),o+=4;break;case u.UInt:s[i.name]=n.getUint32(o,!0),o+=4;break;case u.Long:s[i.name]=Number(n.getBigInt64(o,!0)),o+=8;break;case u.ULong:s[i.name]=Number(n.getBigUint64(o,!0)),o+=8;break;case u.Double:s[i.name]=n.getFloat64(o,!0),o+=8;break;case u.DateTime:case u.String:{const t=n.getUint32(o,!0);o+=4;const e=new TextDecoder;s[i.name]=e.decode(r.subarray(o,o+t)),o+=t;break}default:throw new Error("Unknown type "+i.type)}}return s}(t,r),o={type:"Feature",geometry:n};return i&&(o.properties=i),o}var B=new Uint8Array(0);function F(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function E(t){this._source=t,this._array=B,this._index=0}function O(t,e){e=Math.min(Math.max(+e,2),65535);let r=t,n=r;do{r=Math.ceil(r/e),n+=r}while(1!==r);return 40*n}E.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(r){return t._array=B,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:F(e,r.value)}}))},E.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var n=new Uint8Array(t);return n.set(this._array.subarray(this._index)),function i(){return e._source.read().then((function(o){return o.done?(e._array=B,e._index=0,r>0?n.subarray(0,r):null):r+o.value.length>=t?(e._array=o.value,e._index=t-r,n.set(o.value.subarray(0,t-r),r),n):(n.set(o.value,r),r+=o.value.length,i())}))}()},E.prototype.cancel=function(){return this._source.cancel()};const S=new Uint8Array([102,103,98,3,102,103,98,0]);async function*L(t,e,i,o){let s=0,a=new Uint8Array(await t(8));if(s+=8,!a.every((t,e)=>S[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await t(4)),s+=4;let u=new r.ByteBuffer(a);const f=u.readUint32(0);a=new Uint8Array(await t(f)),s+=f,u=new r.ByteBuffer(a);const h=p.getRoot(u),b=h.featuresCount().toFloat64(),l=[];for(let t=0;t<h.columnsLength();t++){const e=h.columns(t);l.push(new n(e.name(),e.type()))}const d=new c(h.geometryType(),l,b),y=h.indexNodeSize();if(y>0){const r=O(b,y);if(i){const n=async(r,n)=>(await e(s+r),await t(n)),a=await async function(t,e,r,n){const i=function(t,e){if(e<2)throw new Error("Node size must be at least 2");if(0===t)throw new Error("Number of items must be greater than 0");let r=t,n=r;const i=[r];do{r=Math.ceil(r/e),n+=r,i.push(r)}while(1!==r);const o=[];r=n;for(let t of i)o.push(r-t),r-=t;o.reverse(),i.reverse();const s=[];for(let t=0;t<i.length;t++)s.push([o[t],o[t]+i[t]]);return s.reverse(),s}(t,e),[[,o]]=i,s=[],a=[];for(s.push([0,i.length-1]);0!==s.length;){const[f,h]=s.pop(),b=f>=o-t,[,l]=i[h],d=Math.min(f+e,l),p=d-f,y=await n(40*f,40*p),_=new Float64Array(y),g=new Uint32Array(y),v=[];for(let t=0;t<5*p;t+=5){const e=_[t+0],r=_[t+1],n=_[t+2],i=_[t+3],o=g[8+(t<<1)];v.push({minX:e,minY:r,maxX:n,maxY:i,offset:o})}for(let t=f;t<d;t++){const e=v[t-f];c=e,(u=r).maxX<c.minX||u.maxY<c.minY||u.minX>c.maxX||u.minY>c.maxY||(b?a.push([e,t-1]):s.push([e.offset,h-1]))}s.sort((t,e)=>e[0]-t[0])}var u,c;return a}(b,y,i,n);s+=r;for(let[r]of a)await e(s+r.offset),yield await T(t,d,o);return}e?await e(s+r):await t(r),s+=r}let _;for(;_=await T(t,d,o);)yield _}async function T(t,e,n){let i=new Uint8Array(await t(4));if(0===i.byteLength)return null;let o=new r.ByteBuffer(i);const s=o.readUint32(0);i=new Uint8Array(await t(s));const a=new Uint8Array(s+4);return a.set(i,4),o=new r.ByteBuffer(a),o.setPosition(4),n(b.getRoot(o),e)}function U(t){const e=new r.Builder(0);let n=null;t.columns&&(n=p.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return l.start(t),l.addName(t,r),l.addType(t,e.type),l.end(t)}(e,t))));const i=e.createString("L1");p.start(e),p.addFeaturesCount(e,new r.Long(t.featuresCount,0)),p.addGeometryType(e,t.geometryType),p.addIndexNodeSize(e,0),n&&p.addColumns(e,n),p.addName(e,i);const o=p.end(e);return e.finishSizePrefixed(o),e.asUint8Array()}function P(t,e){return function(t,e,r){let n=0;return L(async e=>{const r=await fetch(t,{headers:{Range:"bytes=".concat(n,"-").concat(n+e-1)}});return n+=e,await r.arrayBuffer()},async t=>n=t,e,(t,e)=>I(t,e))}(t,e)}r.SIZE_PREFIX_LENGTH=4,r.Builder.prototype.finish=function(t,e,n){var i=!!n;if(e){var o=e;if(this.prep(this.minalign,r.SIZEOF_INT+r.FILE_IDENTIFIER_LENGTH+(i?r.SIZE_PREFIX_LENGTH:0)),o.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var s=r.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,r.SIZEOF_INT+(i?r.SIZE_PREFIX_LENGTH:0)),this.addOffset(t),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},t.deserialize=function(t){return function(t){return{type:"FeatureCollection",features:function(t,e){if(!t.subarray(0,7).every((t,e)=>S[e]===t))throw new Error("Not a FlatGeobuf file");const i=new r.ByteBuffer(t),o=i.readUint32(S.length);i.setPosition(S.length+4);const s=p.getRoot(i),a=s.featuresCount().toFloat64(),u=[];for(let t=0;t<s.columnsLength();t++){const e=s.columns(t);u.push(new n(e.name(),e.type()))}const f=new c(s.geometryType(),u,0);let h=S.length+4+o;const l=s.indexNodeSize();l>0&&(h+=O(a,l));const d=[];for(;h<i.capacity();){const t=i.readUint32(h);i.setPosition(h+4);const r=b.getRoot(i);d.push(e(r,f)),h+=4+t}return d}(t,(t,e)=>I(t,e))}}(t)},t.deserializeFiltered=function(t,e){return P(t,e)},t.deserializeStream=function(t){return function(t){return function(t,e){const r="function"==typeof(n=t).slice?n:new E("function"==typeof n.read?n:n.getReader());var n;return L(async t=>await r.slice(t),void 0,void 0,e)}(t,(t,e)=>I(t,e))}(t)},t.serialize=function(t){return function(t){const e=function(t){const e=t.features[0],r=e.properties;let i=null;r&&(i=Object.keys(r).map(t=>new n(t,function(t){if("boolean"==typeof t)return u.Bool;if("number"==typeof t)return t%1==0?u.Int:u.Double;if("string"==typeof t)return u.String;if(null===t)return u.String;throw new Error("Unknown type (value '".concat(t,"')"))}(r[t]))));const o=new Set;for(const r of t.features)o.add(e.geometry.type);return new c(g(e.geometry.type),i,t.features.length)}(t),r=U(e),i=t.features.map(t=>m(t,e)),o=i.map(t=>t.length).reduce((t,e)=>t+e),s=new Uint8Array(S.length+r.length+o);s.set(r,S.length);let a=S.length+r.length;for(const t of i)s.set(t,a),a+=t.length;return s.set(S),s}(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r,n){var i=e&&e.prototype instanceof f?e:f,o=Object.create(i.prototype),s=new I(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return F()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=v(s,r);if(a){if(a===c)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=u(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===c)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,s),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var c={};function f(){}function h(){}function b(){}var l={};l[i]=function(){return this};var d=Object.getPrototypeOf,p=d&&d(d(B([])));p&&p!==e&&r.call(p,i)&&(l=p);var y=b.prototype=f.prototype=Object.create(l);function _(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function g(t,e){var n;this._invoke=function(i,o){function s(){return new e((function(n,s){!function n(i,o,s,a){var c=u(t[i],t,o);if("throw"!==c.type){var f=c.arg,h=f.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(h).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}(i,o,n,s)}))}return n=n?n.then(s,s):s()}}function v(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,v(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,c;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function B(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:F}}function F(){return{value:void 0,done:!0}}return h.prototype=y.constructor=b,b.constructor=h,b[s]=h.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s in t||(t[s]="GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},_(g.prototype),g.prototype[o]=function(){return this},t.AsyncIterator=g,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new g(a(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(y),y[s]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=B,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),m(r),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;m(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:B(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n),o=r(1),s=r.n(o),a=r(2),u=r.n(a),c=r(3);function f(t,e){if(0===t.byteLength)return[];var r=new Uint8Array(t);return Object(c.deserialize)(r).features}function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l,d=b(b({},{id:"fgb",name:"FlatGeobuf",version:"2.3.0-alpha.8",extensions:["fgb"],category:"geometry",options:{fgb:{workerUrl:"https://unpkg.com/@loaders.gl/flatgeobuf@".concat("2.3.0-alpha.8","/dist/flatgeobuf-loader.worker.js")}}}),{},{parse:(l=s()(i.a.mark((function t(e,r){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f(e));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return l.apply(this,arguments)}),parseSync:f,parseInBatchesFromStream:function(t,e){return Object(c.deserializeStream)(t)},binary:!0}),p=r(4),y=r.n(p);function _(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(g(t))n.add(t);else if(g(t.buffer))n.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===y()(t))for(var i in t)_(t[i],e,n)}else;return void 0===r?Array.from(n):[]}function g(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}function v(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function w(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2.3.0-alpha.8";v(t,"no loader provided");var r=t.version;e&&r&&(e=m(e),r=m(r))}function m(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach((function(e){u()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function F(t){return E.apply(this,arguments)}function E(){return(E=s()(i.a.mark((function t(e){var r,n,o,s,a,u,c;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,o=e.options,s=e.context,!r.parseSync&&!r.parse){t.next=6;break}a=n,u=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}c=new TextDecoder,a=c.decode(n),u=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=B(B({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,u(a,B({},o),s,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function O(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(i,o){var s=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===s)switch(r.type){case"parse-done":self.removeEventListener("message",t),i(r.result);break;case"parse-error":self.removeEventListener("message",t),o(r.message)}})),self.postMessage({type:"parse",id:s,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=s()(i.a.mark((function e(n){var o,s,a,u,c,f,h,b,l,d;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.data,e.prev=1,O(o,t.name)){e.next=4;break}return e.abrupt("return");case 4:return w(t,o.source.split("@")[1]),s=o.arraybuffer,a=o.byteOffset,u=void 0===a?0:a,c=o.byteLength,f=void 0===c?0:c,h=o.options,b=void 0===h?{}:h,e.next=8,F({loader:t,arraybuffer:s,byteOffset:u,byteLength:f,options:b,context:{parse:r}});case 8:l=e.sent,d=_(l),self.postMessage({type:"done",result:l},d),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(d)}]); | ||
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e,r){t.exports=r(5)},function(t,e){function r(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(t){return void r(t)}a.done?e(c):Promise.resolve(c).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,c,"next",t)}function c(t){r(s,i,o,a,c,"throw",t)}a(void 0)}))}}},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e,r){!function(t){"use strict";var e;!function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(e||(e={}));var r=e;const n={[r.Byte]:Uint8Array,[r.UByte]:Uint8Array,[r.Bool]:Uint8Array,[r.Short]:Uint16Array,[r.UShort]:Uint16Array,[r.Int]:Uint32Array,[r.UInt]:Uint32Array,[r.Long]:BigUint64Array,[r.ULong]:BigUint64Array,[r.Double]:Float64Array};class i{constructor(t,e){this.name=t,this.type=e,this.arrayType=n[e]}}class o{constructor(t,e,r,n){this.geometryType=t,this.columns=e,this.featuresCount=r,this.crs=n}}var s,a,c,u,f={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};f.int32=new Int32Array(2),f.float32=new Float32Array(f.int32.buffer),f.float64=new Float64Array(f.int32.buffer),f.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],f.Long=function(t,e){this.low=0|t,this.high=0|e},f.Long.create=function(t,e){return 0==t&&0==e?f.Long.ZERO:new f.Long(t,e)},f.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},f.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},f.Long.ZERO=new f.Long(0,0),f.Builder=function(t){if(t)e=t;else var e=1024;this.bb=f.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},f.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},f.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},f.Builder.prototype.dataBuffer=function(){return this.bb},f.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},f.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var r=1+~(this.bb.capacity()-this.space+e)&t-1;this.space<r+t+e;){var n=this.bb.capacity();this.bb=f.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},f.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},f.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},f.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},f.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},f.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},f.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},f.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},f.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},f.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},f.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},f.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},f.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},f.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},f.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},f.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},f.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},f.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},f.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},f.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},f.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},f.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},f.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},f.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},f.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},f.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},f.Builder.growByteBuffer=function(t){var e=t.capacity();if(3221225472&e)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");var r=e<<1,n=f.ByteBuffer.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n},f.Builder.prototype.addOffset=function(t){this.prep(f.SIZEOF_INT,0),this.writeInt32(this.offset()-t+f.SIZEOF_INT)},f.Builder.prototype.startObject=function(t){this.notNested(),null==this.vtable&&(this.vtable=[]),this.vtable_in_use=t;for(var e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()},f.Builder.prototype.endObject=function(){if(null==this.vtable||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);for(var t=this.offset(),e=this.vtable_in_use-1;e>=0&&0==this.vtable[e];e--);for(var r=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var n=(r+2)*f.SIZEOF_SHORT;this.addInt16(n);var i=0,o=this.space;t:for(e=0;e<this.vtables.length;e++){var s=this.bb.capacity()-this.vtables[e];if(n==this.bb.readInt16(s)){for(var a=f.SIZEOF_SHORT;a<n;a+=f.SIZEOF_SHORT)if(this.bb.readInt16(o+a)!=this.bb.readInt16(s+a))continue t;i=this.vtables[e];break}}return i?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,i-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t},f.Builder.prototype.finish=function(t,e,r){var n=r?f.SIZE_PREFIX_LENGTH:0;if(e){var i=e;if(this.prep(this.minalign,f.SIZEOF_INT+f.FILE_IDENTIFIER_LENGTH+n),i.length!=f.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+f.FILE_IDENTIFIER_LENGTH);for(var o=f.FILE_IDENTIFIER_LENGTH-1;o>=0;o--)this.writeInt8(i.charCodeAt(o))}this.prep(this.minalign,f.SIZEOF_INT+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},f.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},f.Builder.prototype.requiredField=function(t,e){var r=this.bb.capacity()-t,n=r-this.bb.readInt32(r);if(0==this.bb.readInt16(n+e))throw new Error("FlatBuffers: field "+e+" must be set")},f.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(f.SIZEOF_INT,t*e),this.prep(r,t*e)},f.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},f.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var r=0;r<t.length;){var n,i=t.charCodeAt(r++);(n=i<55296||i>=56320?i:(i<<10)+t.charCodeAt(r++)+-56613888)<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(63&n|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),r=0;for(var o=this.space,s=this.bb.bytes();r<e.length;r++)s[o++]=e[r];return this.endVector()},f.Builder.prototype.createLong=function(t,e){return f.Long.create(t,e)},f.ByteBuffer=function(t){this.bytes_=t,this.position_=0},f.ByteBuffer.allocate=function(t){return new f.ByteBuffer(new Uint8Array(t))},f.ByteBuffer.prototype.clear=function(){this.position_=0},f.ByteBuffer.prototype.bytes=function(){return this.bytes_},f.ByteBuffer.prototype.position=function(){return this.position_},f.ByteBuffer.prototype.setPosition=function(t){this.position_=t},f.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},f.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},f.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},f.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},f.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},f.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},f.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},f.ByteBuffer.prototype.readInt64=function(t){return new f.Long(this.readInt32(t),this.readInt32(t+4))},f.ByteBuffer.prototype.readUint64=function(t){return new f.Long(this.readUint32(t),this.readUint32(t+4))},f.ByteBuffer.prototype.readFloat32=function(t){return f.int32[0]=this.readInt32(t),f.float32[0]},f.ByteBuffer.prototype.readFloat64=function(t){return f.int32[f.isLittleEndian?0:1]=this.readInt32(t),f.int32[f.isLittleEndian?1:0]=this.readInt32(t+4),f.float64[0]},f.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},f.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},f.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},f.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},f.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},f.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},f.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},f.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},f.ByteBuffer.prototype.writeFloat32=function(t,e){f.float32[0]=e,this.writeInt32(t,f.int32[0])},f.ByteBuffer.prototype.writeFloat64=function(t,e){f.float64[0]=e,this.writeInt32(t,f.int32[f.isLittleEndian?0:1]),this.writeInt32(t+4,f.int32[f.isLittleEndian?1:0])},f.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+f.SIZEOF_INT+f.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<f.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+f.SIZEOF_INT+e));return t},f.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},f.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},f.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),n="",i=0;if(t+=f.SIZEOF_INT,e===f.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;i<r;){var o,s=this.readUint8(t+i++);if(s<192)o=s;else{var a=this.readUint8(t+i++);if(s<224)o=(31&s)<<6|63&a;else{var c=this.readUint8(t+i++);o=s<240?(15&s)<<12|(63&a)<<6|63&c:(7&s)<<18|(63&a)<<12|(63&c)<<6|63&this.readUint8(t+i++)}}o<65536?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode(55296+(o>>10),56320+(1023&o)))}return n},f.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},f.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+f.SIZEOF_INT},f.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},f.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=f.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+f.FILE_IDENTIFIER_LENGTH);for(var e=0;e<f.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+f.SIZEOF_INT+e))return!1;return!0},f.ByteBuffer.prototype.createLong=function(t,e){return f.Long.create(t,e)},function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(s||(s={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(a||(a={}));class h{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new h).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+f.SIZE_PREFIX_LENGTH),(e||new h).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):a.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,a.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return h.start(t),h.addName(t,e),h.addType(t,r),h.end(t)}}class b{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new b).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+f.SIZE_PREFIX_LENGTH),(e||new b).__init(t.readInt32(t.position())+t.position(),t)}org(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}code(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}name(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}wkt(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(5)}static addOrg(t,e){t.addFieldOffset(0,e,0)}static addCode(t,e){t.addFieldInt32(1,e,0)}static addName(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWkt(t,e){t.addFieldOffset(4,e,0)}static end(t){return t.endObject()}static create(t,e,r,n,i,o){return b.start(t),b.addOrg(t,e),b.addCode(t,r),b.addName(t,n),b.addDescription(t,i),b.addWkt(t,o),b.end(t)}}class l{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new l).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+f.SIZE_PREFIX_LENGTH),(e||new l).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}envelope(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}envelopeLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}envelopeArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}geometryType(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):s.Unknown}hasZ(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasM(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasT(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}hasTM(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}columns(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new h).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}featuresCount(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):this.bb.createLong(0,0)}indexNodeSize(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}crs(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new b).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addEnvelope(t,e){t.addFieldOffset(1,e,0)}static createEnvelopeVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startEnvelopeVector(t,e){t.startVector(8,e,8)}static addGeometryType(t,e){t.addFieldInt8(2,e,s.Unknown)}static addHasZ(t,e){t.addFieldInt8(3,+e,0)}static addHasM(t,e){t.addFieldInt8(4,+e,0)}static addHasT(t,e){t.addFieldInt8(5,+e,0)}static addHasTM(t,e){t.addFieldInt8(6,+e,0)}static addColumns(t,e){t.addFieldOffset(7,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static addFeaturesCount(t,e){t.addFieldInt64(8,e,t.createLong(0,0))}static addIndexNodeSize(t,e){t.addFieldInt16(9,e,16)}static addCrs(t,e){t.addFieldOffset(10,e,0)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,n,i,o,s,a,c,u,f,h){return l.start(t),l.addName(t,e),l.addEnvelope(t,r),l.addGeometryType(t,n),l.addHasZ(t,i),l.addHasM(t,o),l.addHasT(t,s),l.addHasTM(t,a),l.addColumns(t,c),l.addFeaturesCount(t,u),l.addIndexNodeSize(t,f),l.addCrs(t,h),l.end(t)}}!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(c||(c={})),function(t){t[t.Byte=0]="Byte",t[t.UByte=1]="UByte",t[t.Bool=2]="Bool",t[t.Short=3]="Short",t[t.UShort=4]="UShort",t[t.Int=5]="Int",t[t.UInt=6]="UInt",t[t.Long=7]="Long",t[t.ULong=8]="ULong",t[t.Float=9]="Float",t[t.Double=10]="Double",t[t.String=11]="String",t[t.Json=12]="Json",t[t.DateTime=13]="DateTime",t[t.Binary=14]="Binary"}(u||(u={}));class d{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new d).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+f.SIZE_PREFIX_LENGTH),(e||new d).__init(t.readInt32(t.position())+t.position(),t)}name(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}type(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):u.Byte}static start(t){t.startObject(2)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,u.Byte)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r){return d.start(t),d.addName(t,e),d.addType(t,r),d.end(t)}}class p{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new p).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+f.SIZE_PREFIX_LENGTH),(e||new p).__init(t.readInt32(t.position())+t.position(),t)}ends(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}endsLength(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}endsArray(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}xy(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}xyLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}xyArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}z(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}zLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}zArray(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}m(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}mLength(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}mArray(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}t(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}tLength(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}tArray(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}tm(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}tmLength(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}type(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):c.Unknown}parts(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new p).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}partsLength(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(8)}static addEnds(t,e){t.addFieldOffset(0,e,0)}static createEndsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addInt32(e[r]);return t.endVector()}static startEndsVector(t,e){t.startVector(4,e,4)}static addXy(t,e){t.addFieldOffset(1,e,0)}static createXyVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startXyVector(t,e){t.startVector(8,e,8)}static addZ(t,e){t.addFieldOffset(2,e,0)}static createZVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startZVector(t,e){t.startVector(8,e,8)}static addM(t,e){t.addFieldOffset(3,e,0)}static createMVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startMVector(t,e){t.startVector(8,e,8)}static addT(t,e){t.addFieldOffset(4,e,0)}static createTVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}static startTVector(t,e){t.startVector(8,e,8)}static addTm(t,e){t.addFieldOffset(5,e,0)}static createTmVector(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}static startTmVector(t,e){t.startVector(8,e,8)}static addType(t,e){t.addFieldInt8(6,e,c.Unknown)}static addParts(t,e){t.addFieldOffset(7,e,0)}static createPartsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startPartsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static create(t,e,r,n,i,o,s,a,c){return p.start(t),p.addEnds(t,e),p.addXy(t,r),p.addZ(t,n),p.addM(t,i),p.addT(t,o),p.addTm(t,s),p.addType(t,a),p.addParts(t,c),p.end(t)}}class y{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRoot(t,e){return(e||new y).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+f.SIZE_PREFIX_LENGTH),(e||new y).__init(t.readInt32(t.position())+t.position(),t)}geometry(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new p).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}properties(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}propertiesLength(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}propertiesArray(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}columns(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new d).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}columnsLength(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static start(t){t.startObject(3)}static addGeometry(t,e){t.addFieldOffset(0,e,0)}static addProperties(t,e){t.addFieldOffset(1,e,0)}static createPropertiesVector(t,e){t.startVector(1,e.length,1);for(var r=e.length-1;r>=0;r--)t.addInt8(e[r]);return t.endVector()}static startPropertiesVector(t,e){t.startVector(1,e,1)}static addColumns(t,e){t.addFieldOffset(2,e,0)}static createColumnsVector(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}static startColumnsVector(t,e){t.startVector(4,e,4)}static end(t){return t.endObject()}static finishBuffer(t,e){t.finish(e)}static finishSizePrefixedBuffer(t,e){t.finish(e,void 0,!0)}static create(t,e,r,n){return y.start(t),y.addGeometry(t,e),y.addProperties(t,r),y.addColumns(t,n),y.end(t)}}function _(t,e,r){if(0!==t.length)if(Array.isArray(t[0]))for(const n of t)_(n,e,r);else 2===t.length?e.push(...t):(e.push(t[0],t[1]),r.push(t[2]))}function g(t,e){const r=[];for(let n=0;n<t.length;n+=2){const i=[t[n],t[n+1]];e&&i.push(e[n>>1]),r.push(i)}return r}function v(t){return s[t]}function w(t){const e=t.coordinates,r=[],n=[];let i=null,o=null;const s=v(t.type);let a=0;switch(t.type){case"Point":_(e,r,n);break;case"MultiPoint":case"LineString":_(e,r,n);break;case"MultiLineString":case"Polygon":{const t=e;_(t,r,n),t.length>1&&(i=t.map(t=>a+=t.length));break}case"MultiPolygon":o=e.map(t=>({type:"Polygon",coordinates:t})).map(w);break;case"GeometryCollection":o=t.geometries.map(w)}return{xy:r,z:n.length>0?n:void 0,ends:i,type:s,parts:o}}function m(t,e){if(e===s.GeometryCollection){const r=[];for(let e=0;e<t.partsLength();e++){const n=t.parts(e),i=n.type();r.push(m(n,i))}return{type:s[e],geometries:r}}if(e===s.MultiPolygon){const r=[];for(let e=0;e<t.partsLength();e++)r.push(m(t.parts(e),s.Polygon));return{type:s[e],coordinates:r.map(t=>t.coordinates)}}const r=function(t,e){const r=t.xyArray(),n=t.zArray();switch(e){case s.Point:{const t=Array.from(r);return n&&t.push(n[0]),t}case s.MultiPoint:case s.LineString:return g(r,n);case s.MultiLineString:case s.Polygon:return function(t,e,r){if(!r||0===r.length)return[g(t,e)];let n=0;const i=Array.from(r).map(e=>t.slice(n,n=e<<1));let o=null;return e&&(n=0,o=Array.from(r).map(t=>e.slice(n,n=t))),i.map((t,r)=>g(t,e?o[r]:void 0))}(r,n,t.endsArray())}}(t,e);return{type:s[e],coordinates:r}}const I=new TextEncoder,B=new TextDecoder;function F(t,e){const n=e.columns,i=m(t.geometry(),e.geometryType),o=function(t,e){if(!e||0===e.length)return;const n=t.propertiesArray(),i=new DataView(n.buffer,n.byteOffset),o=t.propertiesLength();let s=0;const a={};for(;s<o;){const t=i.getUint16(s,!0);s+=2;const o=e[t];switch(o.type){case r.Bool:a[o.name]=!!i.getUint8(s),s+=1;break;case r.Byte:a[o.name]=i.getInt8(s),s+=1;break;case r.UByte:a[o.name]=i.getUint8(s),s+=1;break;case r.Short:a[o.name]=i.getInt16(s,!0),s+=2;break;case r.UShort:a[o.name]=i.getUint16(s,!0),s+=2;break;case r.Int:a[o.name]=i.getInt32(s,!0),s+=4;break;case r.UInt:a[o.name]=i.getUint32(s,!0),s+=4;break;case r.Long:a[o.name]=Number(i.getBigInt64(s,!0)),s+=8;break;case r.ULong:a[o.name]=Number(i.getBigUint64(s,!0)),s+=8;break;case r.Double:a[o.name]=i.getFloat64(s,!0),s+=8;break;case r.DateTime:case r.String:{const t=i.getUint32(s,!0);s+=4,a[o.name]=B.decode(n.subarray(s,s+t)),s+=t;break}default:throw new Error("Unknown type "+o.type)}}return a}(t,n),s={type:"Feature",geometry:i};return o&&(s.properties=o),s}var E=new Uint8Array(0);function S(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function O(t){this._source=t,this._array=E,this._index=0}O.prototype.read=function(){var t=this,e=t._array.subarray(t._index);return t._source.read().then((function(r){return t._array=E,t._index=0,r.done?e.length>0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:S(e,r.value)}}))},O.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var n=new Uint8Array(t);return n.set(this._array.subarray(this._index)),function i(){return e._source.read().then((function(o){return o.done?(e._array=E,e._index=0,r>0?n.subarray(0,r):null):r+o.value.length>=t?(e._array=o.value,e._index=t-r,n.set(o.value.subarray(0,t-r),r),n):(n.set(o.value,r),r+=o.value.length,i())}))}()},O.prototype.cancel=function(){return this._source.cancel()};class L{constructor(t,e,r,n,i){this.org=t,this.code=e,this.name=r,this.description=n,this.wkt=i}}function U(t,e){e=Math.min(Math.max(+e,2),65535);let r=t,n=r;do{r=Math.ceil(r/e),n+=r}while(1!==r);return 40*n}const P=new Uint8Array([102,103,98,3,102,103,98,0]);async function*T(t,e,r,n,s){let a=0,c=new Uint8Array(await t(8));if(a+=8,!c.every((t,e)=>P[e]===t))throw new Error("Not a FlatGeobuf file");c=new Uint8Array(await t(4)),a+=4;let u=new f.ByteBuffer(c);const h=u.readUint32(0);c=new Uint8Array(await t(h)),a+=h,u=new f.ByteBuffer(c);const b=l.getRoot(u),d=b.featuresCount().toFloat64(),p=[];for(let t=0;t<b.columnsLength();t++){const e=b.columns(t);p.push(new i(e.name(),e.type()))}const y=b.crs(),_=y?new L(y.org(),y.code(),y.name(),y.description(),y.wkt()):null,g=new o(b.geometryType(),p,d,_);s&&s(g);const v=b.indexNodeSize();if(v>0){const i=U(d,v);if(r){const o=async(r,n)=>(await e(a+r),await t(n)),s=[];for await(const[t]of async function*(t,e,r,n){const{minX:i,minY:o,maxX:s,maxY:a}=r,c=function(t,e){if(e<2)throw new Error("Node size must be at least 2");if(0===t)throw new Error("Number of items must be greater than 0");let r=t,n=r;const i=[r];do{r=Math.ceil(r/e),n+=r,i.push(r)}while(1!==r);const o=[];r=n;for(const t of i)o.push(r-t),r-=t;o.reverse(),i.reverse();const s=[];for(let t=0;t<i.length;t++)s.push([o[t],o[t]+i[t]]);return s.reverse(),s}(t,e),[[u,f]]=c,h=[];for(h.push([0,c.length-1]);0!==h.length;){const[r,b]=h.pop(),l=r>=f-t,[,d]=c[b],p=Math.min(r+e,d),y=p-r,_=await n(40*r,40*y),g=new Float64Array(_),v=new Uint32Array(_);for(let t=r;t<p;t++){const e=5*(t-r);if(s<g[e+0])continue;if(a<g[e+1])continue;if(i>g[e+2])continue;if(o>g[e+3])continue;const n=v[8+(e<<1)];l?yield[n,t-u]:h.push([n,b-1])}h.sort((t,e)=>e[0]-t[0])}}(d,v,r,o))s.push(t);a+=i;for await(const r of s)await e(a+r),yield await x(t,g,n);return}e?await e(a+i):await t(i),a+=i}let w;for(;w=await x(t,g,n);)yield w}async function x(t,e,r){let n=new Uint8Array(await t(4));if(0===n.byteLength)return null;let i=new f.ByteBuffer(n);const o=i.readUint32(0);n=new Uint8Array(await t(o));const s=new Uint8Array(o+4);return s.set(n,4),i=new f.ByteBuffer(s),i.setPosition(4),r(y.getRoot(i),e)}function N(t){const e=function(t){const e=t.features[0],n=e.properties;let s=null;return n&&(s=Object.keys(n).map(t=>new i(t,function(t){if("boolean"==typeof t)return r.Bool;if("number"==typeof t)return t%1==0?r.Int:r.Double;if("string"==typeof t)return r.String;if(null===t)return r.String;throw new Error(`Unknown type (value '${t}')`)}(n[t])))),new o(v(e.geometry.type),s,t.features.length)}(t),n=function(t){const e=new f.Builder;let r=null;t.columns&&(r=l.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return h.start(t),h.addName(t,r),h.addType(t,e.type),h.end(t)}(e,t))));const n=e.createString("L1");l.start(e),l.addFeaturesCount(e,new f.Long(t.featuresCount,0)),l.addGeometryType(e,t.geometryType),l.addIndexNodeSize(e,0),r&&l.addColumns(e,r),l.addName(e,n);const i=l.end(e);return e.finishSizePrefixed(i),e.asUint8Array()}(e),s=t.features.map(t=>function(t,e,n){const i=n.columns,o=new f.Builder,s=[];if(i)for(let t=0;t<i.length;t++){const n=i[t],o=e[n.name];if(null!==o)switch(s.push(Uint16Array.of(t)),n.type){case r.Bool:case r.Short:case r.UShort:case r.Int:case r.UInt:case r.Long:case r.Double:s.push(n.arrayType.of(o));break;case r.DateTime:case r.String:{const t=I.encode(o);s.push(Uint32Array.of(t.length)),s.push(t);break}default:throw new Error("Unknown type "+n.type)}}let a=null;s.length>0&&(a=y.createPropertiesVector(o,function(t,...e){let r=0;for(const t of e)r+=t.byteLength;const n=new t(r);let i=0;for(const r of e)r instanceof Uint8Array?n.set(r,i):n.set(new t(r.buffer),i),i+=r.byteLength;return n}(Uint8Array,...s)));const c=function t(e,r){const{xy:n,z:i,ends:o,parts:s,type:a}=r;if(s){const r=s.map(r=>t(e,r)),n=p.createPartsVector(e,r);return p.start(e),p.addParts(e,n),p.end(e)}const c=p.createXyVector(e,n);let u=null;i&&(u=p.createZVector(e,i));let f=null;return o&&(f=p.createEndsVector(e,o)),p.start(e),f&&p.addEnds(e,f),p.addXy(e,c),u&&p.addZ(e,u),p.addType(e,a),p.end(e)}(o,t);y.start(o),y.addGeometry(o,c),a&&y.addProperties(o,a);const u=y.end(o);return o.finishSizePrefixed(u),o.asUint8Array()}(w(t.geometry),t.properties,e)),a=s.map(t=>t.length).reduce((t,e)=>t+e),c=new Uint8Array(P.length+n.length+a);c.set(n,P.length);let u=P.length+n.length;for(const t of s)c.set(t,u),u+=t.length;return c.set(P),c}t.deserialize=function(t,e,r){return t instanceof Uint8Array?function(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,7).every((t,e)=>P[e]===t))throw new Error("Not a FlatGeobuf file");const n=new f.ByteBuffer(t),s=n.readUint32(P.length);n.setPosition(P.length+4);const a=l.getRoot(n),c=a.featuresCount().toFloat64(),u=[];for(let t=0;t<a.columnsLength();t++){const e=a.columns(t);u.push(new i(e.name(),e.type()))}const h=a.crs(),b=h?new L(h.org(),h.code(),h.name(),h.description(),h.wkt()):null,d=new o(a.geometryType(),u,0,b);r&&r(d);let p=P.length+4+s;const _=a.indexNodeSize();_>0&&(p+=U(c,_));const g=[];for(;p<n.capacity();){const t=n.readUint32(p);n.setPosition(p+4);const r=y.getRoot(n);g.push(e(r,d)),p+=4+t}return g}(t,F,e)}}(t,r):t instanceof ReadableStream?function(t,e){return function(t,e,r){const n="function"==typeof(i=t).slice?i:new O("function"==typeof i.read?i:i.getReader());var i;return T(async t=>await n.slice(t),void 0,void 0,e,r)}(t,F,e)}(t,r):function(t,e,r){return function(t,e,r,n){let i=0;return T(async e=>{const r=await fetch(t,{headers:{Range:`bytes=${i}-${i+e-1}`}});return i+=e,await r.arrayBuffer()},async t=>{i=t},e,r,n)}(t,e,F,r)}(t,e,r)},t.serialize=function(t){return N(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof h?e:h,o=Object.create(i.prototype),s=new B(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return E()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===f)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,s),o}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function h(){}function b(){}function l(){}var d={};d[i]=function(){return this};var p=Object.getPrototypeOf,y=p&&p(p(F([])));y&&y!==e&&r.call(y,i)&&(d=y);var _=l.prototype=h.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var n;this._invoke=function(i,o){function s(){return new e((function(n,s){!function n(i,o,s,a){var c=u(t[i],t,o);if("throw"!==c.type){var f=c.arg,h=f.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(h).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}(i,o,n,s)}))}return n=n?n.then(s,s):s()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function m(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(m,this),this.reset(!0)}function F(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return b.prototype=_.constructor=l,l.constructor=b,b.displayName=a(l,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,a(t,s,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},g(v.prototype),v.prototype[o]=function(){return this},t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new v(c(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},g(_),a(_,s,"Generator"),_[i]=function(){return this},_.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=F,B.prototype={constructor:B,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(I),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:F(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";r.r(e);var n=r(0),i=r.n(n),o=r(1),s=r.n(o),a=r(2),c=r.n(a),u=r(3);function f(t,e){if(0===t.byteLength)return[];var r=new Uint8Array(t);return Object(u.deserialize)(r).features}function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l,d=b(b({},{id:"fgb",name:"FlatGeobuf",version:"2.3.0-alpha.9",extensions:["fgb"],category:"geometry",options:{fgb:{workerUrl:"https://unpkg.com/@loaders.gl/flatgeobuf@".concat("2.3.0-alpha.9","/dist/flatgeobuf-loader.worker.js")}}}),{},{parse:(l=s()(i.a.mark((function t(e,r){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f(e));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return l.apply(this,arguments)}),parseSync:f,parseInBatchesFromStream:function(t,e){return Object(u.deserializeStream)(t)},binary:!0}),p=r(4),y=r.n(p);function _(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0,n=r||new Set;if(t){if(g(t))n.add(t);else if(g(t.buffer))n.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===y()(t))for(var i in t)_(t[i],e,n)}else;return void 0===r?Array.from(n):[]}function g(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}function v(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function w(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2.3.0-alpha.9";v(t,"no loader provided");var r=t.version;e&&r&&(e=m(e),r=m(r))}function m(t){var e=t.split(".").map(Number);return{major:e[0],minor:e[1]}}function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function F(t){return E.apply(this,arguments)}function E(){return(E=s()(i.a.mark((function t(e){var r,n,o,s,a,c,u;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.loader,n=e.arraybuffer,e.byteOffset,e.byteLength,o=e.options,s=e.context,!r.parseSync&&!r.parse){t.next=6;break}a=n,c=r.parseSync||r.parse,t.next=13;break;case 6:if(!r.parseTextSync){t.next=12;break}u=new TextDecoder,a=u.decode(n),c=r.parseTextSync,t.next=13;break;case 12:throw new Error("Could not load data with ".concat(r.name," loader"));case 13:return o=B(B({},o),{},{modules:r&&r.options&&r.options.modules||{},worker:!1}),t.next=16,c(a,B({},o),s,r);case 16:return t.abrupt("return",t.sent);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function S(t,e){return t&&"parse"===t.type&&t.source&&t.source.startsWith("loaders.gl")}!function(t){if("undefined"!=typeof self){var e=0,r=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise((function(i,o){var s=e++;self.addEventListener("message",(function t(e){var r=e.data;if(r&&r.id===s)switch(r.type){case"parse-done":self.removeEventListener("message",t),i(r.result);break;case"parse-error":self.removeEventListener("message",t),o(r.message)}})),self.postMessage({type:"parse",id:s,arraybuffer:t,options:r,url:n},[t])}))};self.onmessage=function(){var e=s()(i.a.mark((function e(n){var o,s,a,c,u,f,h,b,l,d;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.data,e.prev=1,S(o,t.name)){e.next=4;break}return e.abrupt("return");case 4:return w(t,o.source.split("@")[1]),s=o.arraybuffer,a=o.byteOffset,c=void 0===a?0:a,u=o.byteLength,f=void 0===u?0:u,h=o.options,b=void 0===h?{}:h,e.next=8,F({loader:t,arraybuffer:s,byteOffset:c,byteLength:f,options:b,context:{parse:r}});case 8:l=e.sent,d=_(l),self.postMessage({type:"done",result:l},d),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),self.postMessage({type:"error",message:e.t0.message});case 16:case"end":return e.stop()}}),e,null,[[1,13]])})));return function(t){return e.apply(this,arguments)}}()}}(d)}]); |
{ | ||
"name": "@loaders.gl/flatgeobuf", | ||
"description": "Loader for FlatGeobuf", | ||
"version": "2.3.0-alpha.8", | ||
"version": "2.3.0-alpha.9", | ||
"license": "MIT", | ||
@@ -41,3 +41,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "4d7fda93a345a7346558ecd43f3d3eef901e7069" | ||
"gitHead": "946018b8768f1766d68799a543671c8f4cb43fe4" | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
161707
629
4