@loaders.gl/flatgeobuf
Advanced tools
Comparing version 3.0.0-alpha.12 to 3.0.0-alpha.13
@@ -101,3 +101,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/*!***************************************************************************************************!*\ | ||
!*** /home/daniil/actionEngine/loaders.gl/node_modules/flatgeobuf/dist/flatgeobuf-geojson.min.js ***! | ||
!*** /home/user/apps/loaders.gl_duplicate/node_modules/flatgeobuf/dist/flatgeobuf-geojson.min.js ***! | ||
\***************************************************************************************************/ | ||
@@ -179,3 +179,3 @@ /*! no static exports found */ | ||
// @ts-ignore TS2304: Cannot find name '__VERSION__'. | ||
const VERSION = true ? "3.0.0-alpha.12" : undefined; | ||
const VERSION = true ? "3.0.0-alpha.13" : undefined; | ||
@@ -182,0 +182,0 @@ const FlatGeobufWorkerLoader = { |
@@ -1,2 +0,2 @@ | ||
!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=0)}([function(t,e,r){"use strict";(function(e){var i=r(2),n="undefined"==typeof window?e:window;n.loaders=n.loaders||{},t.exports=Object.assign(n.loaders,i)}).call(this,r(1))},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";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"FlatGeobufLoader",{enumerable:!0,get:function(){return i.FlatGeobufLoader}});var i=r(3)},function(t,e,r){"use strict";var i=r(4),n=r(6);Object.defineProperty(e,"__esModule",{value:!0}),e.FlatGeobufLoader=e.FlatGeobufWorkerLoader=void 0;var o=n(r(7)),s=n(r(9)),a=n(r(10)),u=i(r(11));function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?b(Object(r),!0).forEach((function(e){(0,a.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var d={id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",version:"3.0.0-alpha.12",worker:!0,extensions:["fgb"],category:"geometry",options:{flatgeobuf:{}}};e.FlatGeobufWorkerLoader=d;var f,h=c(c({},d),{},{parse:(f=(0,s.default)(o.default.mark((function t(e,r){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,u.default)(e,r));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return f.apply(this,arguments)}),parseSync:u.default,parseInBatchesFromStream:u.parseFlatGeobufInBatches,binary:!0});e.FlatGeobufLoader=h},function(t,e,r){var i=r(5).default;function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}t.exports=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==i(t)&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=t[s]}return r.default=t,e&&e.set(t,r),r},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){t.exports=r(8)},function(t,e,r){var i=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},n=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.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 u(t,e,r,i){var n=e&&e.prototype instanceof d?e:d,o=Object.create(n.prototype),s=new B(i||[]);return o._invoke=function(t,e,r){var i="suspendedStart";return function(n,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===n)throw o;return E()}for(r.method=n,r.arg=o;;){var s=r.delegate;if(s){var a=w(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"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i="executing";var u=b(t,e,r);if("normal"===u.type){if(i=r.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i="completed",r.method="throw",r.arg=u.arg)}}}(t,r,s),o}function b(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c={};function d(){}function f(){}function h(){}var l={};l[n]=function(){return this};var p=Object.getPrototypeOf,_=p&&p(p(F([])));_&&_!==e&&r.call(_,n)&&(l=_);var y=h.prototype=d.prototype=Object.create(l);function g(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;this._invoke=function(n,o){function s(){return new e((function(i,s){!function i(n,o,s,a){var u=b(t[n],t,o);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){i("next",t,s,a)}),(function(t){i("throw",t,s,a)})):e.resolve(d).then((function(t){c.value=t,s(c)}),(function(t){return i("throw",t,s,a)}))}a(u.arg)}(n,o,i,s)}))}return i=i?i.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 c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var i=b(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,c;var n=i.arg;return n?n.done?(e[t.resultName]=n.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function I(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 B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function F(t){if(t){var e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(r.call(t,i))return e.value=t[i],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 f.prototype=y.constructor=h,h.constructor=f,f.displayName=a(h,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a(t,s,"GeneratorFunction")),t.prototype=Object.create(y),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,i,n,o){void 0===o&&(o=Promise);var s=new v(u(e,r,i,n),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},g(y),a(y,s,"Generator"),y[n]=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 i=e.pop();if(i in t)return r.value=i,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(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 i(r,i){return s.type="throw",s.arg=t,e.next=r,i&&(e.method="next",e.arg=void 0),!!i}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],s=o.completion;if("root"===o.tryLoc)return i("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 i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;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 i=r.completion;if("throw"===i.type){var n=i.arg;m(r)}return n}}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),c}},t}(t.exports);try{regeneratorRuntime=i}catch(t){Function("r","regeneratorRuntime = r")(i)}},function(t,e){function r(t,e,r,i,n,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(i,n)}t.exports=function(t){return function(){var e=this,i=arguments;return new Promise((function(n,o){var s=t.apply(e,i);function a(t){r(s,n,o,a,u,"next",t)}function u(t){r(s,n,o,a,u,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!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},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if(0===t.byteLength)return[];var r=new Uint8Array(t);return(0,i.deserialize)(r).features},e.parseFlatGeobufInBatches=function(t,e){return(0,i.deserializeStream)(t)};var i=r(12)},function(t,e,r){!function(t){"use strict";var e,r,i={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};i.int32=new Int32Array(2),i.float32=new Float32Array(i.int32.buffer),i.float64=new Float64Array(i.int32.buffer),i.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],i.Long=function(t,e){this.low=0|t,this.high=0|e},i.Long.create=function(t,e){return 0==t&&0==e?i.Long.ZERO:new i.Long(t,e)},i.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},i.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},i.Long.ZERO=new i.Long(0,0),i.Builder=function(t){if(t)e=t;else var e=1024;this.bb=i.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},i.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},i.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},i.Builder.prototype.dataBuffer=function(){return this.bb},i.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},i.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=i.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},i.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},i.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},i.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},i.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},i.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},i.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},i.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},i.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},i.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},i.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},i.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},i.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},i.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},i.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},i.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},i.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},i.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},i.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},i.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},i.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},i.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},i.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},i.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},i.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},i.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},i.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=i.ByteBuffer.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n},i.Builder.prototype.addOffset=function(t){this.prep(i.SIZEOF_INT,0),this.writeInt32(this.offset()-t+i.SIZEOF_INT)},i.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()},i.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)*i.SIZEOF_SHORT;this.addInt16(n);var o=0,s=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 u=i.SIZEOF_SHORT;u<n;u+=i.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},i.Builder.prototype.finish=function(t,e,r){var n=r?i.SIZE_PREFIX_LENGTH:0;if(e){var o=e;if(this.prep(this.minalign,i.SIZEOF_INT+i.FILE_IDENTIFIER_LENGTH+n),o.length!=i.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+i.FILE_IDENTIFIER_LENGTH);for(var s=i.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,i.SIZEOF_INT+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},i.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},i.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")},i.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(i.SIZEOF_INT,t*e),this.prep(r,t*e)},i.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},i.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 o=this.space,s=this.bb.bytes();r<e.length;r++)s[o++]=e[r];return this.endVector()},i.Builder.prototype.createLong=function(t,e){return i.Long.create(t,e)},i.ByteBuffer=function(t){this.bytes_=t,this.position_=0},i.ByteBuffer.allocate=function(t){return new i.ByteBuffer(new Uint8Array(t))},i.ByteBuffer.prototype.clear=function(){this.position_=0},i.ByteBuffer.prototype.bytes=function(){return this.bytes_},i.ByteBuffer.prototype.position=function(){return this.position_},i.ByteBuffer.prototype.setPosition=function(t){this.position_=t},i.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},i.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},i.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},i.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},i.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},i.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},i.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},i.ByteBuffer.prototype.readInt64=function(t){return new i.Long(this.readInt32(t),this.readInt32(t+4))},i.ByteBuffer.prototype.readUint64=function(t){return new i.Long(this.readUint32(t),this.readUint32(t+4))},i.ByteBuffer.prototype.readFloat32=function(t){return i.int32[0]=this.readInt32(t),i.float32[0]},i.ByteBuffer.prototype.readFloat64=function(t){return i.int32[i.isLittleEndian?0:1]=this.readInt32(t),i.int32[i.isLittleEndian?1:0]=this.readInt32(t+4),i.float64[0]},i.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},i.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},i.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},i.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},i.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},i.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},i.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},i.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},i.ByteBuffer.prototype.writeFloat32=function(t,e){i.float32[0]=e,this.writeInt32(t,i.int32[0])},i.ByteBuffer.prototype.writeFloat64=function(t,e){i.float64[0]=e,this.writeInt32(t,i.int32[i.isLittleEndian?0:1]),this.writeInt32(t+4,i.int32[i.isLittleEndian?1:0])},i.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+i.SIZEOF_INT+i.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<i.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+i.SIZEOF_INT+e));return t},i.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},i.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},i.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),n="",o=0;if(t+=i.SIZEOF_INT,e===i.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;o<r;){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 b=this.readUint8(t+o++);s=a<240?(15&a)<<12|(63&u)<<6|63&b:(7&a)<<18|(63&u)<<12|(63&b)<<6|63&this.readUint8(t+o++)}}s<65536?n+=String.fromCharCode(s):(s-=65536,n+=String.fromCharCode(55296+(s>>10),56320+(1023&s)))}return n},i.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},i.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+i.SIZEOF_INT},i.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},i.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=i.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+i.FILE_IDENTIFIER_LENGTH);for(var e=0;e<i.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+i.SIZEOF_INT+e))return!1;return!0},i.ByteBuffer.prototype.createLong=function(t,e){return i.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"}(e||(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"}(r||(r={}));class n{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 n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+i.SIZE_PREFIX_LENGTH),(e||new n).__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):r.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,r.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r,i,o,s,a,u,b,c,d,f){return n.start(t),n.addName(t,e),n.addType(t,r),n.addTitle(t,i),n.addDescription(t,o),n.addWidth(t,s),n.addPrecision(t,a),n.addScale(t,u),n.addNullable(t,b),n.addUnique(t,c),n.addPrimaryKey(t,d),n.addMetadata(t,f),n.end(t)}}class o{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 o).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+i.SIZE_PREFIX_LENGTH),(e||new o).__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}codeString(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(6)}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 addCodeString(t,e){t.addFieldOffset(5,e,0)}static end(t){return t.endObject()}static create(t,e,r,i,n,s,a){return o.start(t),o.addOrg(t,e),o.addCode(t,r),o.addName(t,i),o.addDescription(t,n),o.addWkt(t,s),o.addCodeString(t,a),o.end(t)}}class s{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 s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+i.SIZE_PREFIX_LENGTH),(e||new s).__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):e.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 n).__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 o).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}title(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}metadata(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(14)}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,r){t.addFieldInt8(2,r,e.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 addTitle(t,e){t.addFieldOffset(11,e,0)}static addDescription(t,e){t.addFieldOffset(12,e,0)}static addMetadata(t,e){t.addFieldOffset(13,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,o,a,u,b,c,d,f,h,l,p){return s.start(t),s.addName(t,e),s.addEnvelope(t,r),s.addGeometryType(t,i),s.addHasZ(t,n),s.addHasM(t,o),s.addHasT(t,a),s.addHasTM(t,u),s.addColumns(t,b),s.addFeaturesCount(t,c),s.addIndexNodeSize(t,d),s.addCrs(t,f),s.addTitle(t,h),s.addDescription(t,l),s.addMetadata(t,p),s.end(t)}}const a={[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.Float]:Float64Array,[r.Double]:Float64Array,[r.String]:String,[r.Json]:String,[r.DateTime]:String,[r.Binary]:String};class u{constructor(t,e,r,i,n,o,s,u,b,c){this.name=t,this.type=e,this.title=r,this.description=i,this.width=n,this.precision=o,this.scale=s,this.nullable=u,this.unique=b,this.primary_key=c,this.arrayType=a[e]}}class b{constructor(t,e,r,i,n,o,s,a){this.geometryType=t,this.columns=e,this.featuresCount=r,this.indexNodeSize=i,this.crs=n,this.title=o,this.description=s,this.metadata=a}}var c,d;!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"}(d||(d={}));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()+i.SIZE_PREFIX_LENGTH),(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):d.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,d.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r,i,n,o,s,a,u,b,c,d){return f.start(t),f.addName(t,e),f.addType(t,r),f.addTitle(t,i),f.addDescription(t,n),f.addWidth(t,o),f.addPrecision(t,s),f.addScale(t,a),f.addNullable(t,u),f.addUnique(t,b),f.addPrimaryKey(t,c),f.addMetadata(t,d),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 t.setPosition(t.position()+i.SIZE_PREFIX_LENGTH),(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):c.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,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,i,n,o,s,a,u){return h.start(t),h.addEnds(t,e),h.addXy(t,r),h.addZ(t,i),h.addM(t,n),h.addT(t,o),h.addTm(t,s),h.addType(t,a),h.addParts(t,u),h.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()+i.SIZE_PREFIX_LENGTH),(e||new l).__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,i){return l.start(t),l.addGeometry(t,e),l.addProperties(t,r),l.addColumns(t,i),l.end(t)}}function p(t,e,r){if(0!==t.length)if(Array.isArray(t[0]))for(const i of t)p(i,e,r);else 2===t.length?e.push(...t):(e.push(t[0],t[1]),r.push(t[2]))}function _(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 y(t){return t?e[t]:e.Unknown}function g(t){const e=t.coordinates,r=[],i=[];let n,o;const s=y(t.type);let a=0;switch(t.type){case"Point":p(e,r,i);break;case"MultiPoint":case"LineString":p(e,r,i);break;case"MultiLineString":case"Polygon":{const t=e;p(t,r,i),t.length>1&&(n=t.map(t=>a+=t.length));break}case"MultiPolygon":o=e.map(t=>({type:"Polygon",coordinates:t})).map(g);break;case"GeometryCollection":t.geometries&&(o=t.geometries.map(g))}return{xy:r,z:i.length>0?i:void 0,ends:n,type:s,parts:o}}function v(t,r){if(r===e.GeometryCollection){const i=[];for(let e=0;e<t.partsLength();e++){const r=t.parts(e),n=r.type();i.push(v(r,n))}return{type:e[r],geometries:i}}if(r===e.MultiPolygon){const i=[];for(let r=0;r<t.partsLength();r++)i.push(v(t.parts(r),e.Polygon));return{type:e[r],coordinates:i.map(t=>t.coordinates)}}const i=function(t,r){const i=t.xyArray(),n=t.zArray();switch(r){case e.Point:{const t=Array.from(i);return n&&t.push(n[0]),t}case e.MultiPoint:case e.LineString:return _(i,n);case e.MultiLineString:case e.Polygon:return function(t,e,r){if(!r||0===r.length)return[_(t,e)];let i=0;const n=Array.from(r).map(e=>t.slice(i,i=e<<1));let o;return e&&(i=0,o=Array.from(r).map(t=>e.slice(i,i=t))),n.map((t,e)=>_(t,o?o[e]:void 0))}(i,n,t.endsArray())}}(t,r);return{type:e[r],coordinates:i}}const w=new TextEncoder,I=new TextDecoder;function m(t,e,n){const o=n.columns,s=new i.Builder,a=[];if(o)for(let t=0;t<o.length;t++){const i=o[t],n=e[i.name];if(null!==n)switch(a.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:a.push(i.arrayType.of(n));break;case r.DateTime:case r.String:{const t=w.encode(n);a.push(Uint32Array.of(t.length)),a.push(t);break}default:throw new Error("Unknown type "+i.type)}}let u=null;a.length>0&&(u=l.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,...a)));const b=function t(e,r){const{xy:i,z:n,ends:o,parts:s,type:a}=r;if(s){const r=s.map(r=>t(e,r)),i=h.createPartsVector(e,r);return h.start(e),h.addParts(e,i),h.end(e)}const u=h.createXyVector(e,i);let b,c;return n&&(b=h.createZVector(e,n)),o&&(c=h.createEndsVector(e,o)),h.start(e),c&&h.addEnds(e,c),h.addXy(e,u),b&&h.addZ(e,b),h.addType(e,a),h.end(e)}(s,t);l.start(s),l.addGeometry(s,b),u&&l.addProperties(s,u);const c=l.end(s);return s.finishSizePrefixed(c),s.asUint8Array()}function B(t,e){const i=e.columns,n={type:"Feature",geometry:v(t.geometry(),e.geometryType)};return i&&i.length>0&&(n.properties=function(t,e){const i={};if(!e||0===e.length)return i;const n=t.propertiesArray();if(!n)return i;const o=new DataView(n.buffer,n.byteOffset),s=t.propertiesLength();let a=0;for(;a<s;){const t=o.getUint16(a,!0);a+=2;const s=e[t],u=s.name;switch(s.type){case r.Bool:i[u]=!!o.getUint8(a),a+=1;break;case r.Byte:i[u]=o.getInt8(a),a+=1;break;case r.UByte:i[u]=o.getUint8(a),a+=1;break;case r.Short:i[u]=o.getInt16(a,!0),a+=2;break;case r.UShort:i[u]=o.getUint16(a,!0),a+=2;break;case r.Int:i[u]=o.getInt32(a,!0),a+=4;break;case r.UInt:i[u]=o.getUint32(a,!0),a+=4;break;case r.Long:i[u]=Number(o.getBigInt64(a,!0)),a+=8;break;case r.ULong:i[u]=Number(o.getBigUint64(a,!0)),a+=8;break;case r.Double:i[u]=o.getFloat64(a,!0),a+=8;break;case r.DateTime:case r.String:{const t=o.getUint32(a,!0);a+=4,i[u]=I.decode(n.subarray(a,a+t)),a+=t;break}default:throw new Error("Unknown type "+s.type)}}return i}(t,i)),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 S(t){this._source=t,this._array=F,this._index=0}S.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)}}))},S.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(o){return o.done?(e._array=F,e._index=0,r>0?i.subarray(0,r):null):r+o.value.length>=t?(e._array=o.value,e._index=t-r,i.set(o.value.subarray(0,t-r),r),i):(i.set(o.value,r),r+=o.value.length,n())}))}()},S.prototype.cancel=function(){return this._source.cancel()};class O{constructor(t,e,r,i,n,o){this.org=t,this.code=e,this.name=r,this.description=i,this.wkt=n,this.code_string=o}}function L(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 P=new Uint8Array([102,103,98,3,102,103,98,0]);function U(t){const e=s.getRoot(t),r=e.featuresCount().toFloat64(),i=e.indexNodeSize(),n=[];for(let t=0;t<e.columnsLength();t++){const r=e.columns(t);if(!r)throw new Error("Column unexpectedly missing");if(!r.name())throw new Error("Column name unexpectedly missing");n.push(new u(r.name(),r.type(),r.title(),r.description(),r.width(),r.precision(),r.scale(),r.nullable(),r.unique(),r.primaryKey()))}const o=e.crs(),a=o?new O(o.org(),o.code(),o.name(),o.description(),o.wkt(),o.codeString()):null;return new b(e.geometryType(),n,r,i,a,e.title(),e.description(),e.metadata())}async function*x(t,e,r,n,o){let s=0,a=new Uint8Array(await e(8));if(s+=8,!a.every((t,e)=>P[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await e(4)),s+=4;let u=new i.ByteBuffer(a);const b=u.readUint32(0);a=new Uint8Array(await e(b)),s+=b,u=new i.ByteBuffer(a);const c=U(u);o&&o(c);const{indexNodeSize:d,featuresCount:f}=c;if(d>0){const i=L(f,d);if(n&&r){const o=async(t,i)=>(await r(s+t),await e(i)),a=[];for await(const[t]of async function*(t,e,r,i){const{minX:n,minY:o,maxX:s,maxY:a}=r,u=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 o=[];r=i;for(const t of n)o.push(r-t),r-=t;o.reverse(),n.reverse();const s=[];for(let t=0;t<n.length;t++)s.push([o[t],o[t]+n[t]]);return s.reverse(),s}(t,e),[[b,c]]=u,d=[];for(d.push([0,u.length-1]);0!==d.length;){const[r,f]=d.pop(),h=r>=c-t,[,l]=u[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(s<g[e+0])continue;if(a<g[e+1])continue;if(n>g[e+2])continue;if(o>g[e+3])continue;const i=v[8+(e<<1)];h?yield[i,t-b]:d.push([i,f-1])}d.sort((t,e)=>e[0]-t[0])}}(f,d,n,o))a.push(t);s+=i;for await(const i of a){await r(s+i);const n=await T(e,c,t);n&&(yield n)}return}r?await r(s+i):await e(i),s+=i}let h;for(;h=await T(e,c,t);)yield h}async function T(t,e,r){let n=new Uint8Array(await t(4));if(0===n.byteLength)return;let o=new i.ByteBuffer(n);const s=o.readUint32(0);n=new Uint8Array(await t(s));const a=new Uint8Array(s+4);return a.set(n,4),o=new i.ByteBuffer(a),o.setPosition(4),r(l.getRoot(o),e)}function N(t){const e=new i.Builder;let r=null;t.columns&&(r=s.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return n.start(t),n.addName(t,r),n.addType(t,e.type),n.end(t)}(e,t))));const o=e.createString("L1");s.start(e),s.addFeaturesCount(e,new i.Long(t.featuresCount,0)),s.addGeometryType(e,t.geometryType),s.addIndexNodeSize(e,0),r&&s.addColumns(e,r),s.addName(e,o);const a=s.end(e);return e.finishSizePrefixed(a),e.asUint8Array()}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 i.ByteBuffer(t),o=n.readUint32(P.length);n.setPosition(P.length+4);const s=U(n);r&&r(s);let a=P.length+4+o;const{indexNodeSize:u,featuresCount:b}=s;u>0&&(a+=L(b,u));const c=[];for(;a<n.capacity();){const t=n.readUint32(a);n.setPosition(a+4);const r=l.getRoot(n);c.push(e(r,s)),a+=4+t}return c}(t,B,e)}}(t,r):t instanceof ReadableStream?function(t,e){return function(t,e,r){const i="function"==typeof(n=t).slice?n:new S("function"==typeof n.read?n:n.getReader());var n;return x(e,async t=>await i.slice(t),void 0,void 0,r)}(t,B,e)}(t,r):function(t,e,r){return function(t,e,r,i){let n=0;return x(r,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,i)}(t,e,B,r)}(t,e,r)},t.serialize=function(t){return function(t){const e=function(t){const e=t.features[0],i=e.properties;let n=null;return i&&(n=Object.keys(i).map(t=>new u(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]),null,null,-1,-1,-1,!0,!1,!1))),new b(y(e.geometry.type),n,t.features.length,0,null,null,null,null)}(t),i=N(e),n=t.features.map(t=>m(g(t.geometry),t.properties,e)),o=n.map(t=>t.length).reduce((t,e)=>t+e),s=new Uint8Array(P.length+i.length+o);s.set(i,P.length);let a=P.length+i.length;for(const t of n)s.set(t,a),a+=t.length;return s.set(P),s}(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)}])})); | ||
!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=0)}([function(t,e,r){"use strict";(function(e){var i=r(2),n="undefined"==typeof window?e:window;n.loaders=n.loaders||{},t.exports=Object.assign(n.loaders,i)}).call(this,r(1))},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";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"FlatGeobufLoader",{enumerable:!0,get:function(){return i.FlatGeobufLoader}});var i=r(3)},function(t,e,r){"use strict";var i=r(4),n=r(6);Object.defineProperty(e,"__esModule",{value:!0}),e.FlatGeobufLoader=e.FlatGeobufWorkerLoader=void 0;var o=n(r(7)),s=n(r(9)),a=n(r(10)),u=i(r(11));function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?b(Object(r),!0).forEach((function(e){(0,a.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var d={id:"flatgeobuf",name:"FlatGeobuf",module:"flatgeobuf",version:"3.0.0-alpha.13",worker:!0,extensions:["fgb"],category:"geometry",options:{flatgeobuf:{}}};e.FlatGeobufWorkerLoader=d;var f,h=c(c({},d),{},{parse:(f=(0,s.default)(o.default.mark((function t(e,r){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,u.default)(e,r));case 1:case"end":return t.stop()}}),t)}))),function(t,e){return f.apply(this,arguments)}),parseSync:u.default,parseInBatchesFromStream:u.parseFlatGeobufInBatches,binary:!0});e.FlatGeobufLoader=h},function(t,e,r){var i=r(5).default;function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}t.exports=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==i(t)&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var a=o?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(r,s,a):r[s]=t[s]}return r.default=t,e&&e.set(t,r),r},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){t.exports=r(8)},function(t,e,r){var i=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},n=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.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 u(t,e,r,i){var n=e&&e.prototype instanceof d?e:d,o=Object.create(n.prototype),s=new B(i||[]);return o._invoke=function(t,e,r){var i="suspendedStart";return function(n,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===n)throw o;return E()}for(r.method=n,r.arg=o;;){var s=r.delegate;if(s){var a=w(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"===i)throw i="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i="executing";var u=b(t,e,r);if("normal"===u.type){if(i=r.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i="completed",r.method="throw",r.arg=u.arg)}}}(t,r,s),o}function b(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c={};function d(){}function f(){}function h(){}var l={};l[n]=function(){return this};var p=Object.getPrototypeOf,_=p&&p(p(F([])));_&&_!==e&&r.call(_,n)&&(l=_);var y=h.prototype=d.prototype=Object.create(l);function g(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var i;this._invoke=function(n,o){function s(){return new e((function(i,s){!function i(n,o,s,a){var u=b(t[n],t,o);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){i("next",t,s,a)}),(function(t){i("throw",t,s,a)})):e.resolve(d).then((function(t){c.value=t,s(c)}),(function(t){return i("throw",t,s,a)}))}a(u.arg)}(n,o,i,s)}))}return i=i?i.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 c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var i=b(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,c;var n=i.arg;return n?n.done?(e[t.resultName]=n.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):n:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function I(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 B(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function F(t){if(t){var e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(r.call(t,i))return e.value=t[i],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 f.prototype=y.constructor=h,h.constructor=f,f.displayName=a(h,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a(t,s,"GeneratorFunction")),t.prototype=Object.create(y),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,i,n,o){void 0===o&&(o=Promise);var s=new v(u(e,r,i,n),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},g(y),a(y,s,"Generator"),y[n]=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 i=e.pop();if(i in t)return r.value=i,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(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 i(r,i){return s.type="throw",s.arg=t,e.next=r,i&&(e.method="next",e.arg=void 0),!!i}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],s=o.completion;if("root"===o.tryLoc)return i("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 i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;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 i=r.completion;if("throw"===i.type){var n=i.arg;m(r)}return n}}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),c}},t}(t.exports);try{regeneratorRuntime=i}catch(t){Function("r","regeneratorRuntime = r")(i)}},function(t,e){function r(t,e,r,i,n,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(i,n)}t.exports=function(t){return function(){var e=this,i=arguments;return new Promise((function(n,o){var s=t.apply(e,i);function a(t){r(s,n,o,a,u,"next",t)}function u(t){r(s,n,o,a,u,"throw",t)}a(void 0)}))}},t.exports.default=t.exports,t.exports.__esModule=!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},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){if(0===t.byteLength)return[];var r=new Uint8Array(t);return(0,i.deserialize)(r).features},e.parseFlatGeobufInBatches=function(t,e){return(0,i.deserializeStream)(t)};var i=r(12)},function(t,e,r){!function(t){"use strict";var e,r,i={SIZEOF_SHORT:2,SIZEOF_INT:4,FILE_IDENTIFIER_LENGTH:4,SIZE_PREFIX_LENGTH:4,Encoding:{UTF8_BYTES:1,UTF16_STRING:2}};i.int32=new Int32Array(2),i.float32=new Float32Array(i.int32.buffer),i.float64=new Float64Array(i.int32.buffer),i.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],i.Long=function(t,e){this.low=0|t,this.high=0|e},i.Long.create=function(t,e){return 0==t&&0==e?i.Long.ZERO:new i.Long(t,e)},i.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},i.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},i.Long.ZERO=new i.Long(0,0),i.Builder=function(t){if(t)e=t;else var e=1024;this.bb=i.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},i.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},i.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},i.Builder.prototype.dataBuffer=function(){return this.bb},i.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},i.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=i.Builder.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(r)},i.Builder.prototype.pad=function(t){for(var e=0;e<t;e++)this.bb.writeInt8(--this.space,0)},i.Builder.prototype.writeInt8=function(t){this.bb.writeInt8(this.space-=1,t)},i.Builder.prototype.writeInt16=function(t){this.bb.writeInt16(this.space-=2,t)},i.Builder.prototype.writeInt32=function(t){this.bb.writeInt32(this.space-=4,t)},i.Builder.prototype.writeInt64=function(t){this.bb.writeInt64(this.space-=8,t)},i.Builder.prototype.writeFloat32=function(t){this.bb.writeFloat32(this.space-=4,t)},i.Builder.prototype.writeFloat64=function(t){this.bb.writeFloat64(this.space-=8,t)},i.Builder.prototype.addInt8=function(t){this.prep(1,0),this.writeInt8(t)},i.Builder.prototype.addInt16=function(t){this.prep(2,0),this.writeInt16(t)},i.Builder.prototype.addInt32=function(t){this.prep(4,0),this.writeInt32(t)},i.Builder.prototype.addInt64=function(t){this.prep(8,0),this.writeInt64(t)},i.Builder.prototype.addFloat32=function(t){this.prep(4,0),this.writeFloat32(t)},i.Builder.prototype.addFloat64=function(t){this.prep(8,0),this.writeFloat64(t)},i.Builder.prototype.addFieldInt8=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt8(e),this.slot(t))},i.Builder.prototype.addFieldInt16=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt16(e),this.slot(t))},i.Builder.prototype.addFieldInt32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addInt32(e),this.slot(t))},i.Builder.prototype.addFieldInt64=function(t,e,r){!this.force_defaults&&e.equals(r)||(this.addInt64(e),this.slot(t))},i.Builder.prototype.addFieldFloat32=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat32(e),this.slot(t))},i.Builder.prototype.addFieldFloat64=function(t,e,r){(this.force_defaults||e!=r)&&(this.addFloat64(e),this.slot(t))},i.Builder.prototype.addFieldOffset=function(t,e,r){(this.force_defaults||e!=r)&&(this.addOffset(e),this.slot(t))},i.Builder.prototype.addFieldStruct=function(t,e,r){e!=r&&(this.nested(e),this.slot(t))},i.Builder.prototype.nested=function(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")},i.Builder.prototype.notNested=function(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")},i.Builder.prototype.slot=function(t){this.vtable[t]=this.offset()},i.Builder.prototype.offset=function(){return this.bb.capacity()-this.space},i.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=i.ByteBuffer.allocate(r);return n.setPosition(r-e),n.bytes().set(t.bytes(),r-e),n},i.Builder.prototype.addOffset=function(t){this.prep(i.SIZEOF_INT,0),this.writeInt32(this.offset()-t+i.SIZEOF_INT)},i.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()},i.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)*i.SIZEOF_SHORT;this.addInt16(n);var o=0,s=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 u=i.SIZEOF_SHORT;u<n;u+=i.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},i.Builder.prototype.finish=function(t,e,r){var n=r?i.SIZE_PREFIX_LENGTH:0;if(e){var o=e;if(this.prep(this.minalign,i.SIZEOF_INT+i.FILE_IDENTIFIER_LENGTH+n),o.length!=i.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+i.FILE_IDENTIFIER_LENGTH);for(var s=i.FILE_IDENTIFIER_LENGTH-1;s>=0;s--)this.writeInt8(o.charCodeAt(s))}this.prep(this.minalign,i.SIZEOF_INT+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},i.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},i.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")},i.Builder.prototype.startVector=function(t,e,r){this.notNested(),this.vector_num_elems=e,this.prep(i.SIZEOF_INT,t*e),this.prep(r,t*e)},i.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},i.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 o=this.space,s=this.bb.bytes();r<e.length;r++)s[o++]=e[r];return this.endVector()},i.Builder.prototype.createLong=function(t,e){return i.Long.create(t,e)},i.ByteBuffer=function(t){this.bytes_=t,this.position_=0},i.ByteBuffer.allocate=function(t){return new i.ByteBuffer(new Uint8Array(t))},i.ByteBuffer.prototype.clear=function(){this.position_=0},i.ByteBuffer.prototype.bytes=function(){return this.bytes_},i.ByteBuffer.prototype.position=function(){return this.position_},i.ByteBuffer.prototype.setPosition=function(t){this.position_=t},i.ByteBuffer.prototype.capacity=function(){return this.bytes_.length},i.ByteBuffer.prototype.readInt8=function(t){return this.readUint8(t)<<24>>24},i.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},i.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},i.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},i.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},i.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},i.ByteBuffer.prototype.readInt64=function(t){return new i.Long(this.readInt32(t),this.readInt32(t+4))},i.ByteBuffer.prototype.readUint64=function(t){return new i.Long(this.readUint32(t),this.readUint32(t+4))},i.ByteBuffer.prototype.readFloat32=function(t){return i.int32[0]=this.readInt32(t),i.float32[0]},i.ByteBuffer.prototype.readFloat64=function(t){return i.int32[i.isLittleEndian?0:1]=this.readInt32(t),i.int32[i.isLittleEndian?1:0]=this.readInt32(t+4),i.float64[0]},i.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},i.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},i.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},i.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},i.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},i.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},i.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},i.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},i.ByteBuffer.prototype.writeFloat32=function(t,e){i.float32[0]=e,this.writeInt32(t,i.int32[0])},i.ByteBuffer.prototype.writeFloat64=function(t,e){i.float64[0]=e,this.writeInt32(t,i.int32[i.isLittleEndian?0:1]),this.writeInt32(t+4,i.int32[i.isLittleEndian?1:0])},i.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length<this.position_+i.SIZEOF_INT+i.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");for(var t="",e=0;e<i.FILE_IDENTIFIER_LENGTH;e++)t+=String.fromCharCode(this.readInt8(this.position_+i.SIZEOF_INT+e));return t},i.ByteBuffer.prototype.__offset=function(t,e){var r=t-this.readInt32(t);return e<this.readInt16(r)?this.readInt16(r+e):0},i.ByteBuffer.prototype.__union=function(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t},i.ByteBuffer.prototype.__string=function(t,e){t+=this.readInt32(t);var r=this.readInt32(t),n="",o=0;if(t+=i.SIZEOF_INT,e===i.Encoding.UTF8_BYTES)return this.bytes_.subarray(t,t+r);for(;o<r;){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 b=this.readUint8(t+o++);s=a<240?(15&a)<<12|(63&u)<<6|63&b:(7&a)<<18|(63&u)<<12|(63&b)<<6|63&this.readUint8(t+o++)}}s<65536?n+=String.fromCharCode(s):(s-=65536,n+=String.fromCharCode(55296+(s>>10),56320+(1023&s)))}return n},i.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},i.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+i.SIZEOF_INT},i.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},i.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=i.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+i.FILE_IDENTIFIER_LENGTH);for(var e=0;e<i.FILE_IDENTIFIER_LENGTH;e++)if(t.charCodeAt(e)!=this.readInt8(this.position_+i.SIZEOF_INT+e))return!1;return!0},i.ByteBuffer.prototype.createLong=function(t,e){return i.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"}(e||(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"}(r||(r={}));class n{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 n).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+i.SIZE_PREFIX_LENGTH),(e||new n).__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):r.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,r.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r,i,o,s,a,u,b,c,d,f){return n.start(t),n.addName(t,e),n.addType(t,r),n.addTitle(t,i),n.addDescription(t,o),n.addWidth(t,s),n.addPrecision(t,a),n.addScale(t,u),n.addNullable(t,b),n.addUnique(t,c),n.addPrimaryKey(t,d),n.addMetadata(t,f),n.end(t)}}class o{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 o).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+i.SIZE_PREFIX_LENGTH),(e||new o).__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}codeString(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(6)}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 addCodeString(t,e){t.addFieldOffset(5,e,0)}static end(t){return t.endObject()}static create(t,e,r,i,n,s,a){return o.start(t),o.addOrg(t,e),o.addCode(t,r),o.addName(t,i),o.addDescription(t,n),o.addWkt(t,s),o.addCodeString(t,a),o.end(t)}}class s{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 s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRoot(t,e){return t.setPosition(t.position()+i.SIZE_PREFIX_LENGTH),(e||new s).__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):e.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 n).__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 o).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}title(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}description(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}metadata(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(14)}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,r){t.addFieldInt8(2,r,e.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 addTitle(t,e){t.addFieldOffset(11,e,0)}static addDescription(t,e){t.addFieldOffset(12,e,0)}static addMetadata(t,e){t.addFieldOffset(13,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,o,a,u,b,c,d,f,h,l,p){return s.start(t),s.addName(t,e),s.addEnvelope(t,r),s.addGeometryType(t,i),s.addHasZ(t,n),s.addHasM(t,o),s.addHasT(t,a),s.addHasTM(t,u),s.addColumns(t,b),s.addFeaturesCount(t,c),s.addIndexNodeSize(t,d),s.addCrs(t,f),s.addTitle(t,h),s.addDescription(t,l),s.addMetadata(t,p),s.end(t)}}const a={[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.Float]:Float64Array,[r.Double]:Float64Array,[r.String]:String,[r.Json]:String,[r.DateTime]:String,[r.Binary]:String};class u{constructor(t,e,r,i,n,o,s,u,b,c){this.name=t,this.type=e,this.title=r,this.description=i,this.width=n,this.precision=o,this.scale=s,this.nullable=u,this.unique=b,this.primary_key=c,this.arrayType=a[e]}}class b{constructor(t,e,r,i,n,o,s,a){this.geometryType=t,this.columns=e,this.featuresCount=r,this.indexNodeSize=i,this.crs=n,this.title=o,this.description=s,this.metadata=a}}var c,d;!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"}(d||(d={}));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()+i.SIZE_PREFIX_LENGTH),(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):d.Byte}title(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}width(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt32(this.bb_pos+t):-1}precision(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt32(this.bb_pos+t):-1}scale(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):-1}nullable(){var t=this.bb.__offset(this.bb_pos,18);return!t||!!this.bb.readInt8(this.bb_pos+t)}unique(){var t=this.bb.__offset(this.bb_pos,20);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}primaryKey(){var t=this.bb.__offset(this.bb_pos,22);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}metadata(t){var e=this.bb.__offset(this.bb_pos,24);return e?this.bb.__string(this.bb_pos+e,t):null}static start(t){t.startObject(11)}static addName(t,e){t.addFieldOffset(0,e,0)}static addType(t,e){t.addFieldInt8(1,e,d.Byte)}static addTitle(t,e){t.addFieldOffset(2,e,0)}static addDescription(t,e){t.addFieldOffset(3,e,0)}static addWidth(t,e){t.addFieldInt32(4,e,-1)}static addPrecision(t,e){t.addFieldInt32(5,e,-1)}static addScale(t,e){t.addFieldInt32(6,e,-1)}static addNullable(t,e){t.addFieldInt8(7,+e,1)}static addUnique(t,e){t.addFieldInt8(8,+e,0)}static addPrimaryKey(t,e){t.addFieldInt8(9,+e,0)}static addMetadata(t,e){t.addFieldOffset(10,e,0)}static end(t){var e=t.endObject();return t.requiredField(e,4),e}static create(t,e,r,i,n,o,s,a,u,b,c,d){return f.start(t),f.addName(t,e),f.addType(t,r),f.addTitle(t,i),f.addDescription(t,n),f.addWidth(t,o),f.addPrecision(t,s),f.addScale(t,a),f.addNullable(t,u),f.addUnique(t,b),f.addPrimaryKey(t,c),f.addMetadata(t,d),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 t.setPosition(t.position()+i.SIZE_PREFIX_LENGTH),(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):c.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,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,i,n,o,s,a,u){return h.start(t),h.addEnds(t,e),h.addXy(t,r),h.addZ(t,i),h.addM(t,n),h.addT(t,o),h.addTm(t,s),h.addType(t,a),h.addParts(t,u),h.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()+i.SIZE_PREFIX_LENGTH),(e||new l).__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,i){return l.start(t),l.addGeometry(t,e),l.addProperties(t,r),l.addColumns(t,i),l.end(t)}}function p(t,e,r){if(0!==t.length)if(Array.isArray(t[0]))for(const i of t)p(i,e,r);else 2===t.length?e.push(...t):(e.push(t[0],t[1]),r.push(t[2]))}function _(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 y(t){return t?e[t]:e.Unknown}function g(t){const e=t.coordinates,r=[],i=[];let n,o;const s=y(t.type);let a=0;switch(t.type){case"Point":p(e,r,i);break;case"MultiPoint":case"LineString":p(e,r,i);break;case"MultiLineString":case"Polygon":{const t=e;p(t,r,i),t.length>1&&(n=t.map(t=>a+=t.length));break}case"MultiPolygon":o=e.map(t=>({type:"Polygon",coordinates:t})).map(g);break;case"GeometryCollection":t.geometries&&(o=t.geometries.map(g))}return{xy:r,z:i.length>0?i:void 0,ends:n,type:s,parts:o}}function v(t,r){if(r===e.GeometryCollection){const i=[];for(let e=0;e<t.partsLength();e++){const r=t.parts(e),n=r.type();i.push(v(r,n))}return{type:e[r],geometries:i}}if(r===e.MultiPolygon){const i=[];for(let r=0;r<t.partsLength();r++)i.push(v(t.parts(r),e.Polygon));return{type:e[r],coordinates:i.map(t=>t.coordinates)}}const i=function(t,r){const i=t.xyArray(),n=t.zArray();switch(r){case e.Point:{const t=Array.from(i);return n&&t.push(n[0]),t}case e.MultiPoint:case e.LineString:return _(i,n);case e.MultiLineString:case e.Polygon:return function(t,e,r){if(!r||0===r.length)return[_(t,e)];let i=0;const n=Array.from(r).map(e=>t.slice(i,i=e<<1));let o;return e&&(i=0,o=Array.from(r).map(t=>e.slice(i,i=t))),n.map((t,e)=>_(t,o?o[e]:void 0))}(i,n,t.endsArray())}}(t,r);return{type:e[r],coordinates:i}}const w=new TextEncoder,I=new TextDecoder;function m(t,e,n){const o=n.columns,s=new i.Builder,a=[];if(o)for(let t=0;t<o.length;t++){const i=o[t],n=e[i.name];if(null!==n)switch(a.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:a.push(i.arrayType.of(n));break;case r.DateTime:case r.String:{const t=w.encode(n);a.push(Uint32Array.of(t.length)),a.push(t);break}default:throw new Error("Unknown type "+i.type)}}let u=null;a.length>0&&(u=l.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,...a)));const b=function t(e,r){const{xy:i,z:n,ends:o,parts:s,type:a}=r;if(s){const r=s.map(r=>t(e,r)),i=h.createPartsVector(e,r);return h.start(e),h.addParts(e,i),h.end(e)}const u=h.createXyVector(e,i);let b,c;return n&&(b=h.createZVector(e,n)),o&&(c=h.createEndsVector(e,o)),h.start(e),c&&h.addEnds(e,c),h.addXy(e,u),b&&h.addZ(e,b),h.addType(e,a),h.end(e)}(s,t);l.start(s),l.addGeometry(s,b),u&&l.addProperties(s,u);const c=l.end(s);return s.finishSizePrefixed(c),s.asUint8Array()}function B(t,e){const i=e.columns,n={type:"Feature",geometry:v(t.geometry(),e.geometryType)};return i&&i.length>0&&(n.properties=function(t,e){const i={};if(!e||0===e.length)return i;const n=t.propertiesArray();if(!n)return i;const o=new DataView(n.buffer,n.byteOffset),s=t.propertiesLength();let a=0;for(;a<s;){const t=o.getUint16(a,!0);a+=2;const s=e[t],u=s.name;switch(s.type){case r.Bool:i[u]=!!o.getUint8(a),a+=1;break;case r.Byte:i[u]=o.getInt8(a),a+=1;break;case r.UByte:i[u]=o.getUint8(a),a+=1;break;case r.Short:i[u]=o.getInt16(a,!0),a+=2;break;case r.UShort:i[u]=o.getUint16(a,!0),a+=2;break;case r.Int:i[u]=o.getInt32(a,!0),a+=4;break;case r.UInt:i[u]=o.getUint32(a,!0),a+=4;break;case r.Long:i[u]=Number(o.getBigInt64(a,!0)),a+=8;break;case r.ULong:i[u]=Number(o.getBigUint64(a,!0)),a+=8;break;case r.Double:i[u]=o.getFloat64(a,!0),a+=8;break;case r.DateTime:case r.String:{const t=o.getUint32(a,!0);a+=4,i[u]=I.decode(n.subarray(a,a+t)),a+=t;break}default:throw new Error("Unknown type "+s.type)}}return i}(t,i)),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 S(t){this._source=t,this._array=F,this._index=0}S.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)}}))},S.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(o){return o.done?(e._array=F,e._index=0,r>0?i.subarray(0,r):null):r+o.value.length>=t?(e._array=o.value,e._index=t-r,i.set(o.value.subarray(0,t-r),r),i):(i.set(o.value,r),r+=o.value.length,n())}))}()},S.prototype.cancel=function(){return this._source.cancel()};class O{constructor(t,e,r,i,n,o){this.org=t,this.code=e,this.name=r,this.description=i,this.wkt=n,this.code_string=o}}function L(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 P=new Uint8Array([102,103,98,3,102,103,98,0]);function U(t){const e=s.getRoot(t),r=e.featuresCount().toFloat64(),i=e.indexNodeSize(),n=[];for(let t=0;t<e.columnsLength();t++){const r=e.columns(t);if(!r)throw new Error("Column unexpectedly missing");if(!r.name())throw new Error("Column name unexpectedly missing");n.push(new u(r.name(),r.type(),r.title(),r.description(),r.width(),r.precision(),r.scale(),r.nullable(),r.unique(),r.primaryKey()))}const o=e.crs(),a=o?new O(o.org(),o.code(),o.name(),o.description(),o.wkt(),o.codeString()):null;return new b(e.geometryType(),n,r,i,a,e.title(),e.description(),e.metadata())}async function*x(t,e,r,n,o){let s=0,a=new Uint8Array(await e(8));if(s+=8,!a.every((t,e)=>P[e]===t))throw new Error("Not a FlatGeobuf file");a=new Uint8Array(await e(4)),s+=4;let u=new i.ByteBuffer(a);const b=u.readUint32(0);a=new Uint8Array(await e(b)),s+=b,u=new i.ByteBuffer(a);const c=U(u);o&&o(c);const{indexNodeSize:d,featuresCount:f}=c;if(d>0){const i=L(f,d);if(n&&r){const o=async(t,i)=>(await r(s+t),await e(i)),a=[];for await(const[t]of async function*(t,e,r,i){const{minX:n,minY:o,maxX:s,maxY:a}=r,u=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 o=[];r=i;for(const t of n)o.push(r-t),r-=t;o.reverse(),n.reverse();const s=[];for(let t=0;t<n.length;t++)s.push([o[t],o[t]+n[t]]);return s.reverse(),s}(t,e),[[b,c]]=u,d=[];for(d.push([0,u.length-1]);0!==d.length;){const[r,f]=d.pop(),h=r>=c-t,[,l]=u[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(s<g[e+0])continue;if(a<g[e+1])continue;if(n>g[e+2])continue;if(o>g[e+3])continue;const i=v[8+(e<<1)];h?yield[i,t-b]:d.push([i,f-1])}d.sort((t,e)=>e[0]-t[0])}}(f,d,n,o))a.push(t);s+=i;for await(const i of a){await r(s+i);const n=await T(e,c,t);n&&(yield n)}return}r?await r(s+i):await e(i),s+=i}let h;for(;h=await T(e,c,t);)yield h}async function T(t,e,r){let n=new Uint8Array(await t(4));if(0===n.byteLength)return;let o=new i.ByteBuffer(n);const s=o.readUint32(0);n=new Uint8Array(await t(s));const a=new Uint8Array(s+4);return a.set(n,4),o=new i.ByteBuffer(a),o.setPosition(4),r(l.getRoot(o),e)}function N(t){const e=new i.Builder;let r=null;t.columns&&(r=s.createColumnsVector(e,t.columns.map(t=>function(t,e){const r=t.createString(e.name);return n.start(t),n.addName(t,r),n.addType(t,e.type),n.end(t)}(e,t))));const o=e.createString("L1");s.start(e),s.addFeaturesCount(e,new i.Long(t.featuresCount,0)),s.addGeometryType(e,t.geometryType),s.addIndexNodeSize(e,0),r&&s.addColumns(e,r),s.addName(e,o);const a=s.end(e);return e.finishSizePrefixed(a),e.asUint8Array()}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 i.ByteBuffer(t),o=n.readUint32(P.length);n.setPosition(P.length+4);const s=U(n);r&&r(s);let a=P.length+4+o;const{indexNodeSize:u,featuresCount:b}=s;u>0&&(a+=L(b,u));const c=[];for(;a<n.capacity();){const t=n.readUint32(a);n.setPosition(a+4);const r=l.getRoot(n);c.push(e(r,s)),a+=4+t}return c}(t,B,e)}}(t,r):t instanceof ReadableStream?function(t,e){return function(t,e,r){const i="function"==typeof(n=t).slice?n:new S("function"==typeof n.read?n:n.getReader());var n;return x(e,async t=>await i.slice(t),void 0,void 0,r)}(t,B,e)}(t,r):function(t,e,r){return function(t,e,r,i){let n=0;return x(r,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,i)}(t,e,B,r)}(t,e,r)},t.serialize=function(t){return function(t){const e=function(t){const e=t.features[0],i=e.properties;let n=null;return i&&(n=Object.keys(i).map(t=>new u(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]),null,null,-1,-1,-1,!0,!1,!1))),new b(y(e.geometry.type),n,t.features.length,0,null,null,null,null)}(t),i=N(e),n=t.features.map(t=>m(g(t.geometry),t.properties,e)),o=n.map(t=>t.length).reduce((t,e)=>t+e),s=new Uint8Array(P.length+i.length+o);s.set(i,P.length);let a=P.length+i.length;for(const t of n)s.set(t,a),a+=t.length;return s.set(P),s}(t)},Object.defineProperty(t,"__esModule",{value:!0})}(e)}])})); | ||
//# sourceMappingURL=dist.min.js.map |
@@ -24,3 +24,3 @@ "use strict"; | ||
var VERSION = typeof "3.0.0-alpha.12" !== 'undefined' ? "3.0.0-alpha.12" : 'latest'; | ||
var VERSION = typeof "3.0.0-alpha.13" !== 'undefined' ? "3.0.0-alpha.13" : 'latest'; | ||
var FlatGeobufWorkerLoader = { | ||
@@ -27,0 +27,0 @@ id: 'flatgeobuf', |
@@ -10,3 +10,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
import parseFlatGeobuf, { parseFlatGeobufInBatches } from './lib/parse-flatgeobuf'; | ||
var VERSION = typeof "3.0.0-alpha.12" !== 'undefined' ? "3.0.0-alpha.12" : 'latest'; | ||
var VERSION = typeof "3.0.0-alpha.13" !== 'undefined' ? "3.0.0-alpha.13" : 'latest'; | ||
export var FlatGeobufWorkerLoader = { | ||
@@ -13,0 +13,0 @@ id: 'flatgeobuf', |
{ | ||
"name": "@loaders.gl/flatgeobuf", | ||
"description": "Loader for FlatGeobuf", | ||
"version": "3.0.0-alpha.12", | ||
"version": "3.0.0-alpha.13", | ||
"license": "MIT", | ||
@@ -34,3 +34,3 @@ "publishConfig": { | ||
"dependencies": { | ||
"@loaders.gl/loader-utils": "3.0.0-alpha.12", | ||
"@loaders.gl/loader-utils": "3.0.0-alpha.13", | ||
"flatgeobuf": "^3.1.0" | ||
@@ -41,3 +41,3 @@ }, | ||
}, | ||
"gitHead": "b65ccc1d6a1713b349e9994f45ec45d77c6b3964" | ||
"gitHead": "2d13b42b8ccc1e04e839aa90b56297cb0de73bfa" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6
+ Added@loaders.gl/loader-utils@3.0.0-alpha.13(transitive)
+ Added@loaders.gl/worker-utils@3.0.0-alpha.13(transitive)
+ Addedflatbuffers@24.12.23(transitive)
+ Addedflatgeobuf@3.37.0(transitive)
- Removed@loaders.gl/loader-utils@3.0.0-alpha.12(transitive)
- Removed@loaders.gl/worker-utils@3.0.0-alpha.12(transitive)
- Removedflatbuffers@24.3.25(transitive)
- Removedflatgeobuf@3.36.0(transitive)