geo-polygonize 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/geo_polygonize.wasm +0 -0
- package/dist/geo_polygonize_simd.wasm +0 -0
- package/dist/slim/cjs/index_slim.js +483 -0
- package/dist/slim/es/index_slim.js +481 -1
- package/dist/standard/cjs/index.js +245 -2
- package/dist/standard/es/index.js +243 -3
- package/dist/threads/es/index.js +237 -1
- package/package.json +1 -1
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
let wasm$1;
|
|
2
2
|
|
|
3
|
+
function debugString$1(val) {
|
|
4
|
+
// primitive types
|
|
5
|
+
const type = typeof val;
|
|
6
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
7
|
+
return `${val}`;
|
|
8
|
+
}
|
|
9
|
+
if (type == 'string') {
|
|
10
|
+
return `"${val}"`;
|
|
11
|
+
}
|
|
12
|
+
if (type == 'symbol') {
|
|
13
|
+
const description = val.description;
|
|
14
|
+
if (description == null) {
|
|
15
|
+
return 'Symbol';
|
|
16
|
+
} else {
|
|
17
|
+
return `Symbol(${description})`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (type == 'function') {
|
|
21
|
+
const name = val.name;
|
|
22
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
23
|
+
return `Function(${name})`;
|
|
24
|
+
} else {
|
|
25
|
+
return 'Function';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// objects
|
|
29
|
+
if (Array.isArray(val)) {
|
|
30
|
+
const length = val.length;
|
|
31
|
+
let debug = '[';
|
|
32
|
+
if (length > 0) {
|
|
33
|
+
debug += debugString$1(val[0]);
|
|
34
|
+
}
|
|
35
|
+
for(let i = 1; i < length; i++) {
|
|
36
|
+
debug += ', ' + debugString$1(val[i]);
|
|
37
|
+
}
|
|
38
|
+
debug += ']';
|
|
39
|
+
return debug;
|
|
40
|
+
}
|
|
41
|
+
// Test for built-in
|
|
42
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
43
|
+
let className;
|
|
44
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
45
|
+
className = builtInMatches[1];
|
|
46
|
+
} else {
|
|
47
|
+
// Failed to match the standard '[object ClassName]'
|
|
48
|
+
return toString.call(val);
|
|
49
|
+
}
|
|
50
|
+
if (className == 'Object') {
|
|
51
|
+
// we're a user defined class or Object
|
|
52
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
53
|
+
// easier than looping through ownProperties of `val`.
|
|
54
|
+
try {
|
|
55
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
56
|
+
} catch (_) {
|
|
57
|
+
return 'Object';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// errors
|
|
61
|
+
if (val instanceof Error) {
|
|
62
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
63
|
+
}
|
|
64
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
65
|
+
return className;
|
|
66
|
+
}
|
|
67
|
+
|
|
3
68
|
function getArrayU8FromWasm0$1(ptr, len) {
|
|
4
69
|
ptr = ptr >>> 0;
|
|
5
70
|
return getUint8ArrayMemory0$1().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -311,6 +376,68 @@ function polygonize$1(geojson_str, node_input, snap_grid_size, extract_only_poly
|
|
|
311
376
|
}
|
|
312
377
|
}
|
|
313
378
|
|
|
379
|
+
/**
|
|
380
|
+
* @param {Uint8Array} ipc_bytes
|
|
381
|
+
* @param {any} options_val
|
|
382
|
+
* @returns {Uint8Array}
|
|
383
|
+
*/
|
|
384
|
+
function polygonizeGeoArrowWithOptions$1(ipc_bytes, options_val) {
|
|
385
|
+
const ptr0 = passArray8ToWasm0$1(ipc_bytes, wasm$1.__wbindgen_malloc);
|
|
386
|
+
const len0 = WASM_VECTOR_LEN$1;
|
|
387
|
+
const ret = wasm$1.polygonizeGeoArrowWithOptions(ptr0, len0, options_val);
|
|
388
|
+
if (ret[3]) {
|
|
389
|
+
throw takeFromExternrefTable0$1(ret[2]);
|
|
390
|
+
}
|
|
391
|
+
var v2 = getArrayU8FromWasm0$1(ret[0], ret[1]).slice();
|
|
392
|
+
wasm$1.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
393
|
+
return v2;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* @param {string} geojson_str
|
|
398
|
+
* @param {any} options_val
|
|
399
|
+
* @returns {string}
|
|
400
|
+
*/
|
|
401
|
+
function polygonizeWithOptions$1(geojson_str, options_val) {
|
|
402
|
+
let deferred3_0;
|
|
403
|
+
let deferred3_1;
|
|
404
|
+
try {
|
|
405
|
+
const ptr0 = passStringToWasm0$1(geojson_str, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
|
406
|
+
const len0 = WASM_VECTOR_LEN$1;
|
|
407
|
+
const ret = wasm$1.polygonizeWithOptions(ptr0, len0, options_val);
|
|
408
|
+
var ptr2 = ret[0];
|
|
409
|
+
var len2 = ret[1];
|
|
410
|
+
if (ret[3]) {
|
|
411
|
+
ptr2 = 0; len2 = 0;
|
|
412
|
+
throw takeFromExternrefTable0$1(ret[2]);
|
|
413
|
+
}
|
|
414
|
+
deferred3_0 = ptr2;
|
|
415
|
+
deferred3_1 = len2;
|
|
416
|
+
return getStringFromWasm0$1(ptr2, len2);
|
|
417
|
+
} finally {
|
|
418
|
+
wasm$1.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* @param {Float64Array} coords
|
|
424
|
+
* @param {Uint32Array} offsets
|
|
425
|
+
* @param {number} stride
|
|
426
|
+
* @param {any} options_val
|
|
427
|
+
* @returns {WasmPolygonResult}
|
|
428
|
+
*/
|
|
429
|
+
function polygonizeWithOptionsBuffer$1(coords, offsets, stride, options_val) {
|
|
430
|
+
const ptr0 = passArrayF64ToWasm0$1(coords, wasm$1.__wbindgen_malloc);
|
|
431
|
+
const len0 = WASM_VECTOR_LEN$1;
|
|
432
|
+
const ptr1 = passArray32ToWasm0$1(offsets, wasm$1.__wbindgen_malloc);
|
|
433
|
+
const len1 = WASM_VECTOR_LEN$1;
|
|
434
|
+
const ret = wasm$1.polygonizeWithOptionsBuffer(ptr0, len0, ptr1, len1, stride, options_val);
|
|
435
|
+
if (ret[2]) {
|
|
436
|
+
throw takeFromExternrefTable0$1(ret[1]);
|
|
437
|
+
}
|
|
438
|
+
return WasmPolygonResult$1.__wrap(ret[0]);
|
|
439
|
+
}
|
|
440
|
+
|
|
314
441
|
/**
|
|
315
442
|
* @param {Float64Array} coords
|
|
316
443
|
* @param {Uint32Array} offsets
|
|
@@ -385,9 +512,71 @@ async function __wbg_load$1(module, imports) {
|
|
|
385
512
|
function __wbg_get_imports$1() {
|
|
386
513
|
const imports = {};
|
|
387
514
|
imports.wbg = {};
|
|
515
|
+
imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
516
|
+
const ret = Error(getStringFromWasm0$1(arg0, arg1));
|
|
517
|
+
return ret;
|
|
518
|
+
};
|
|
519
|
+
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
520
|
+
const ret = String(arg1);
|
|
521
|
+
const ptr1 = passStringToWasm0$1(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
|
522
|
+
const len1 = WASM_VECTOR_LEN$1;
|
|
523
|
+
getDataViewMemory0$1().setInt32(arg0 + 4 * 1, len1, true);
|
|
524
|
+
getDataViewMemory0$1().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
525
|
+
};
|
|
526
|
+
imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
|
|
527
|
+
const v = arg0;
|
|
528
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
529
|
+
return isLikeNone$1(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
530
|
+
};
|
|
531
|
+
imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
532
|
+
const ret = debugString$1(arg1);
|
|
533
|
+
const ptr1 = passStringToWasm0$1(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
|
534
|
+
const len1 = WASM_VECTOR_LEN$1;
|
|
535
|
+
getDataViewMemory0$1().setInt32(arg0 + 4 * 1, len1, true);
|
|
536
|
+
getDataViewMemory0$1().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
537
|
+
};
|
|
538
|
+
imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
|
|
539
|
+
const ret = arg0 in arg1;
|
|
540
|
+
return ret;
|
|
541
|
+
};
|
|
542
|
+
imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
543
|
+
const val = arg0;
|
|
544
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
545
|
+
return ret;
|
|
546
|
+
};
|
|
547
|
+
imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
|
|
548
|
+
const ret = typeof(arg0) === 'string';
|
|
549
|
+
return ret;
|
|
550
|
+
};
|
|
551
|
+
imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
552
|
+
const ret = arg0 === undefined;
|
|
553
|
+
return ret;
|
|
554
|
+
};
|
|
555
|
+
imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
|
|
556
|
+
const ret = arg0 == arg1;
|
|
557
|
+
return ret;
|
|
558
|
+
};
|
|
559
|
+
imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
560
|
+
const obj = arg1;
|
|
561
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
562
|
+
getDataViewMemory0$1().setFloat64(arg0 + 8 * 1, isLikeNone$1(ret) ? 0 : ret, true);
|
|
563
|
+
getDataViewMemory0$1().setInt32(arg0 + 4 * 0, !isLikeNone$1(ret), true);
|
|
564
|
+
};
|
|
565
|
+
imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
566
|
+
const obj = arg1;
|
|
567
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
568
|
+
var ptr1 = isLikeNone$1(ret) ? 0 : passStringToWasm0$1(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
|
569
|
+
var len1 = WASM_VECTOR_LEN$1;
|
|
570
|
+
getDataViewMemory0$1().setInt32(arg0 + 4 * 1, len1, true);
|
|
571
|
+
getDataViewMemory0$1().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
572
|
+
};
|
|
388
573
|
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
389
574
|
throw new Error(getStringFromWasm0$1(arg0, arg1));
|
|
390
575
|
};
|
|
576
|
+
imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
|
|
577
|
+
const ret = Object.entries(arg0);
|
|
578
|
+
return ret;
|
|
579
|
+
};
|
|
391
580
|
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
392
581
|
let deferred0_0;
|
|
393
582
|
let deferred0_1;
|
|
@@ -399,6 +588,46 @@ function __wbg_get_imports$1() {
|
|
|
399
588
|
wasm$1.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
400
589
|
}
|
|
401
590
|
};
|
|
591
|
+
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
592
|
+
const ret = arg0[arg1 >>> 0];
|
|
593
|
+
return ret;
|
|
594
|
+
};
|
|
595
|
+
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
596
|
+
const ret = arg0[arg1];
|
|
597
|
+
return ret;
|
|
598
|
+
};
|
|
599
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
|
|
600
|
+
let result;
|
|
601
|
+
try {
|
|
602
|
+
result = arg0 instanceof ArrayBuffer;
|
|
603
|
+
} catch (_) {
|
|
604
|
+
result = false;
|
|
605
|
+
}
|
|
606
|
+
const ret = result;
|
|
607
|
+
return ret;
|
|
608
|
+
};
|
|
609
|
+
imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
|
|
610
|
+
let result;
|
|
611
|
+
try {
|
|
612
|
+
result = arg0 instanceof Uint8Array;
|
|
613
|
+
} catch (_) {
|
|
614
|
+
result = false;
|
|
615
|
+
}
|
|
616
|
+
const ret = result;
|
|
617
|
+
return ret;
|
|
618
|
+
};
|
|
619
|
+
imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
620
|
+
const ret = arg0.length;
|
|
621
|
+
return ret;
|
|
622
|
+
};
|
|
623
|
+
imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
|
|
624
|
+
const ret = arg0.length;
|
|
625
|
+
return ret;
|
|
626
|
+
};
|
|
627
|
+
imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
|
|
628
|
+
const ret = new Uint8Array(arg0);
|
|
629
|
+
return ret;
|
|
630
|
+
};
|
|
402
631
|
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
403
632
|
const ret = new Error();
|
|
404
633
|
return ret;
|
|
@@ -407,6 +636,9 @@ function __wbg_get_imports$1() {
|
|
|
407
636
|
const ret = PolygonizerWasmError$1.__wrap(arg0);
|
|
408
637
|
return ret;
|
|
409
638
|
};
|
|
639
|
+
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
640
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0$1(arg0, arg1), arg2);
|
|
641
|
+
};
|
|
410
642
|
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
411
643
|
const ret = arg1.stack;
|
|
412
644
|
const ptr1 = passStringToWasm0$1(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
|
|
@@ -414,6 +646,11 @@ function __wbg_get_imports$1() {
|
|
|
414
646
|
getDataViewMemory0$1().setInt32(arg0 + 4 * 1, len1, true);
|
|
415
647
|
getDataViewMemory0$1().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
416
648
|
};
|
|
649
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
650
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
651
|
+
const ret = getStringFromWasm0$1(arg0, arg1);
|
|
652
|
+
return ret;
|
|
653
|
+
};
|
|
417
654
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
418
655
|
const table = wasm$1.__wbindgen_externrefs;
|
|
419
656
|
const offset = table.grow(4);
|
|
@@ -493,12 +730,80 @@ var scalarExports = /*#__PURE__*/Object.freeze({
|
|
|
493
730
|
default: __wbg_init$1,
|
|
494
731
|
initSync: initSync$1,
|
|
495
732
|
polygonize: polygonize$1,
|
|
733
|
+
polygonizeGeoArrowWithOptions: polygonizeGeoArrowWithOptions$1,
|
|
734
|
+
polygonizeWithOptions: polygonizeWithOptions$1,
|
|
735
|
+
polygonizeWithOptionsBuffer: polygonizeWithOptionsBuffer$1,
|
|
496
736
|
polygonize_buffers: polygonize_buffers$1,
|
|
497
737
|
polygonize_geoarrow: polygonize_geoarrow$1
|
|
498
738
|
});
|
|
499
739
|
|
|
500
740
|
let wasm;
|
|
501
741
|
|
|
742
|
+
function debugString(val) {
|
|
743
|
+
// primitive types
|
|
744
|
+
const type = typeof val;
|
|
745
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
746
|
+
return `${val}`;
|
|
747
|
+
}
|
|
748
|
+
if (type == 'string') {
|
|
749
|
+
return `"${val}"`;
|
|
750
|
+
}
|
|
751
|
+
if (type == 'symbol') {
|
|
752
|
+
const description = val.description;
|
|
753
|
+
if (description == null) {
|
|
754
|
+
return 'Symbol';
|
|
755
|
+
} else {
|
|
756
|
+
return `Symbol(${description})`;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
if (type == 'function') {
|
|
760
|
+
const name = val.name;
|
|
761
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
762
|
+
return `Function(${name})`;
|
|
763
|
+
} else {
|
|
764
|
+
return 'Function';
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
// objects
|
|
768
|
+
if (Array.isArray(val)) {
|
|
769
|
+
const length = val.length;
|
|
770
|
+
let debug = '[';
|
|
771
|
+
if (length > 0) {
|
|
772
|
+
debug += debugString(val[0]);
|
|
773
|
+
}
|
|
774
|
+
for(let i = 1; i < length; i++) {
|
|
775
|
+
debug += ', ' + debugString(val[i]);
|
|
776
|
+
}
|
|
777
|
+
debug += ']';
|
|
778
|
+
return debug;
|
|
779
|
+
}
|
|
780
|
+
// Test for built-in
|
|
781
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
782
|
+
let className;
|
|
783
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
784
|
+
className = builtInMatches[1];
|
|
785
|
+
} else {
|
|
786
|
+
// Failed to match the standard '[object ClassName]'
|
|
787
|
+
return toString.call(val);
|
|
788
|
+
}
|
|
789
|
+
if (className == 'Object') {
|
|
790
|
+
// we're a user defined class or Object
|
|
791
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
792
|
+
// easier than looping through ownProperties of `val`.
|
|
793
|
+
try {
|
|
794
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
795
|
+
} catch (_) {
|
|
796
|
+
return 'Object';
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
// errors
|
|
800
|
+
if (val instanceof Error) {
|
|
801
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
802
|
+
}
|
|
803
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
804
|
+
return className;
|
|
805
|
+
}
|
|
806
|
+
|
|
502
807
|
function getArrayU8FromWasm0(ptr, len) {
|
|
503
808
|
ptr = ptr >>> 0;
|
|
504
809
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -810,6 +1115,68 @@ function polygonize(geojson_str, node_input, snap_grid_size, extract_only_polygo
|
|
|
810
1115
|
}
|
|
811
1116
|
}
|
|
812
1117
|
|
|
1118
|
+
/**
|
|
1119
|
+
* @param {Uint8Array} ipc_bytes
|
|
1120
|
+
* @param {any} options_val
|
|
1121
|
+
* @returns {Uint8Array}
|
|
1122
|
+
*/
|
|
1123
|
+
function polygonizeGeoArrowWithOptions(ipc_bytes, options_val) {
|
|
1124
|
+
const ptr0 = passArray8ToWasm0(ipc_bytes, wasm.__wbindgen_malloc);
|
|
1125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1126
|
+
const ret = wasm.polygonizeGeoArrowWithOptions(ptr0, len0, options_val);
|
|
1127
|
+
if (ret[3]) {
|
|
1128
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1129
|
+
}
|
|
1130
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1131
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1132
|
+
return v2;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
/**
|
|
1136
|
+
* @param {string} geojson_str
|
|
1137
|
+
* @param {any} options_val
|
|
1138
|
+
* @returns {string}
|
|
1139
|
+
*/
|
|
1140
|
+
function polygonizeWithOptions(geojson_str, options_val) {
|
|
1141
|
+
let deferred3_0;
|
|
1142
|
+
let deferred3_1;
|
|
1143
|
+
try {
|
|
1144
|
+
const ptr0 = passStringToWasm0(geojson_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1145
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1146
|
+
const ret = wasm.polygonizeWithOptions(ptr0, len0, options_val);
|
|
1147
|
+
var ptr2 = ret[0];
|
|
1148
|
+
var len2 = ret[1];
|
|
1149
|
+
if (ret[3]) {
|
|
1150
|
+
ptr2 = 0; len2 = 0;
|
|
1151
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1152
|
+
}
|
|
1153
|
+
deferred3_0 = ptr2;
|
|
1154
|
+
deferred3_1 = len2;
|
|
1155
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1156
|
+
} finally {
|
|
1157
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* @param {Float64Array} coords
|
|
1163
|
+
* @param {Uint32Array} offsets
|
|
1164
|
+
* @param {number} stride
|
|
1165
|
+
* @param {any} options_val
|
|
1166
|
+
* @returns {WasmPolygonResult}
|
|
1167
|
+
*/
|
|
1168
|
+
function polygonizeWithOptionsBuffer(coords, offsets, stride, options_val) {
|
|
1169
|
+
const ptr0 = passArrayF64ToWasm0(coords, wasm.__wbindgen_malloc);
|
|
1170
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1171
|
+
const ptr1 = passArray32ToWasm0(offsets, wasm.__wbindgen_malloc);
|
|
1172
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1173
|
+
const ret = wasm.polygonizeWithOptionsBuffer(ptr0, len0, ptr1, len1, stride, options_val);
|
|
1174
|
+
if (ret[2]) {
|
|
1175
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1176
|
+
}
|
|
1177
|
+
return WasmPolygonResult.__wrap(ret[0]);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
813
1180
|
/**
|
|
814
1181
|
* @param {Float64Array} coords
|
|
815
1182
|
* @param {Uint32Array} offsets
|
|
@@ -884,9 +1251,71 @@ async function __wbg_load(module, imports) {
|
|
|
884
1251
|
function __wbg_get_imports() {
|
|
885
1252
|
const imports = {};
|
|
886
1253
|
imports.wbg = {};
|
|
1254
|
+
imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
1255
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1256
|
+
return ret;
|
|
1257
|
+
};
|
|
1258
|
+
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
1259
|
+
const ret = String(arg1);
|
|
1260
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1261
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1262
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1263
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1264
|
+
};
|
|
1265
|
+
imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
|
|
1266
|
+
const v = arg0;
|
|
1267
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
1268
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
1269
|
+
};
|
|
1270
|
+
imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
1271
|
+
const ret = debugString(arg1);
|
|
1272
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1273
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1274
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1275
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1276
|
+
};
|
|
1277
|
+
imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
|
|
1278
|
+
const ret = arg0 in arg1;
|
|
1279
|
+
return ret;
|
|
1280
|
+
};
|
|
1281
|
+
imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
|
|
1282
|
+
const val = arg0;
|
|
1283
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
1284
|
+
return ret;
|
|
1285
|
+
};
|
|
1286
|
+
imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
|
|
1287
|
+
const ret = typeof(arg0) === 'string';
|
|
1288
|
+
return ret;
|
|
1289
|
+
};
|
|
1290
|
+
imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
|
|
1291
|
+
const ret = arg0 === undefined;
|
|
1292
|
+
return ret;
|
|
1293
|
+
};
|
|
1294
|
+
imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
|
|
1295
|
+
const ret = arg0 == arg1;
|
|
1296
|
+
return ret;
|
|
1297
|
+
};
|
|
1298
|
+
imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
1299
|
+
const obj = arg1;
|
|
1300
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
1301
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
1302
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
1303
|
+
};
|
|
1304
|
+
imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
1305
|
+
const obj = arg1;
|
|
1306
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
1307
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1308
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1309
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1310
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1311
|
+
};
|
|
887
1312
|
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
888
1313
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
889
1314
|
};
|
|
1315
|
+
imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
|
|
1316
|
+
const ret = Object.entries(arg0);
|
|
1317
|
+
return ret;
|
|
1318
|
+
};
|
|
890
1319
|
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
891
1320
|
let deferred0_0;
|
|
892
1321
|
let deferred0_1;
|
|
@@ -898,6 +1327,46 @@ function __wbg_get_imports() {
|
|
|
898
1327
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
899
1328
|
}
|
|
900
1329
|
};
|
|
1330
|
+
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
1331
|
+
const ret = arg0[arg1 >>> 0];
|
|
1332
|
+
return ret;
|
|
1333
|
+
};
|
|
1334
|
+
imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
|
|
1335
|
+
const ret = arg0[arg1];
|
|
1336
|
+
return ret;
|
|
1337
|
+
};
|
|
1338
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
|
|
1339
|
+
let result;
|
|
1340
|
+
try {
|
|
1341
|
+
result = arg0 instanceof ArrayBuffer;
|
|
1342
|
+
} catch (_) {
|
|
1343
|
+
result = false;
|
|
1344
|
+
}
|
|
1345
|
+
const ret = result;
|
|
1346
|
+
return ret;
|
|
1347
|
+
};
|
|
1348
|
+
imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
|
|
1349
|
+
let result;
|
|
1350
|
+
try {
|
|
1351
|
+
result = arg0 instanceof Uint8Array;
|
|
1352
|
+
} catch (_) {
|
|
1353
|
+
result = false;
|
|
1354
|
+
}
|
|
1355
|
+
const ret = result;
|
|
1356
|
+
return ret;
|
|
1357
|
+
};
|
|
1358
|
+
imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
1359
|
+
const ret = arg0.length;
|
|
1360
|
+
return ret;
|
|
1361
|
+
};
|
|
1362
|
+
imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
|
|
1363
|
+
const ret = arg0.length;
|
|
1364
|
+
return ret;
|
|
1365
|
+
};
|
|
1366
|
+
imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
|
|
1367
|
+
const ret = new Uint8Array(arg0);
|
|
1368
|
+
return ret;
|
|
1369
|
+
};
|
|
901
1370
|
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
902
1371
|
const ret = new Error();
|
|
903
1372
|
return ret;
|
|
@@ -906,6 +1375,9 @@ function __wbg_get_imports() {
|
|
|
906
1375
|
const ret = PolygonizerWasmError.__wrap(arg0);
|
|
907
1376
|
return ret;
|
|
908
1377
|
};
|
|
1378
|
+
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
1379
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1380
|
+
};
|
|
909
1381
|
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
910
1382
|
const ret = arg1.stack;
|
|
911
1383
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -913,6 +1385,11 @@ function __wbg_get_imports() {
|
|
|
913
1385
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
914
1386
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
915
1387
|
};
|
|
1388
|
+
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
1389
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1390
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
1391
|
+
return ret;
|
|
1392
|
+
};
|
|
916
1393
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
917
1394
|
const table = wasm.__wbindgen_externrefs;
|
|
918
1395
|
const offset = table.grow(4);
|
|
@@ -992,6 +1469,9 @@ var simdExports = /*#__PURE__*/Object.freeze({
|
|
|
992
1469
|
default: __wbg_init,
|
|
993
1470
|
initSync: initSync,
|
|
994
1471
|
polygonize: polygonize,
|
|
1472
|
+
polygonizeGeoArrowWithOptions: polygonizeGeoArrowWithOptions,
|
|
1473
|
+
polygonizeWithOptions: polygonizeWithOptions,
|
|
1474
|
+
polygonizeWithOptionsBuffer: polygonizeWithOptionsBuffer,
|
|
995
1475
|
polygonize_buffers: polygonize_buffers,
|
|
996
1476
|
polygonize_geoarrow: polygonize_geoarrow
|
|
997
1477
|
});
|
|
@@ -1018,4 +1498,4 @@ async function initBest(scalarModule, simdModule) {
|
|
|
1018
1498
|
}
|
|
1019
1499
|
}
|
|
1020
1500
|
|
|
1021
|
-
export { PolygonizerWasmError$1 as PolygonizerWasmError, WasmPolygonResult$1 as WasmPolygonResult, initBest, initSync$1 as initSync, polygonize$1 as polygonize, polygonize_buffers$1 as polygonize_buffers, polygonize_geoarrow$1 as polygonize_geoarrow };
|
|
1501
|
+
export { PolygonizerWasmError$1 as PolygonizerWasmError, WasmPolygonResult$1 as WasmPolygonResult, initBest, initSync$1 as initSync, polygonize$1 as polygonize, polygonizeGeoArrowWithOptions$1 as polygonizeGeoArrowWithOptions, polygonizeWithOptions$1 as polygonizeWithOptions, polygonizeWithOptionsBuffer$1 as polygonizeWithOptionsBuffer, polygonize_buffers$1 as polygonize_buffers, polygonize_geoarrow$1 as polygonize_geoarrow };
|