proj4rs 0.1.8 → 0.1.11

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/README.md CHANGED
@@ -1,7 +1,13 @@
1
+ [![Crates.io](https://img.shields.io/crates/v/proj4rs)](https://crates.io/crates/proj4rs)
1
2
  [![Crates.io](https://img.shields.io/crates/d/proj4rs)](https://crates.io/crates/proj4rs)
3
+ [![License](https://img.shields.io/badge/license-MIT_OR_Apache_2.0-blue.svg)](https://github.com/image-rs/imageproc/blob/master/LICENSE)
2
4
  [![Documentation](https://img.shields.io/badge/Documentation-Published-green)](https://docs.rs/proj4rs/latest/proj4rs/)
3
5
  [![Demo](https://img.shields.io/badge/Demo-Published-green)](https://docs.3liz.org/proj4rs/)
4
6
 
7
+
8
+
9
+
10
+
5
11
  ---
6
12
 
7
13
  Rust library for transforming geographic point coordinates
@@ -101,4 +107,4 @@ Proj.transform(from, to, point);
101
107
 
102
108
  ## Contributing
103
109
 
104
- You can contribute to this library by going on the [proj4rs](https://github.com/3liz/proj4rs/blob/main/CONTRIBUTING.md) repository
110
+ You can contribute to this library by going on the [proj4rs](./CONTRIBUTING.md) repository
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "David Marteau <dmarteau@3liz.com>"
6
6
  ],
7
7
  "description": "Rust adaptation of Proj4",
8
- "version": "0.1.8",
8
+ "version": "0.1.11",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",
package/proj4.js CHANGED
@@ -6,7 +6,8 @@
6
6
  //
7
7
 
8
8
  // Initialize the proj4rs module
9
- import * as Proj from "./proj4rs.js";
9
+ import init, * as Proj from "./pkg/proj4rs.js";
10
+ await init();
10
11
 
11
12
  /// Used as factory for creating projection alias
12
13
  function defs(name) {
@@ -107,7 +108,7 @@ function transformer(from, to, coords) {
107
108
  return [transformed.x, transformed.y];
108
109
  }
109
110
  } else {
110
- keys = Object.keys(coords);
111
+ let keys = Object.keys(coords);
111
112
  if (keys.length > 2) {
112
113
  keys.forEach(function (key) {
113
114
  if (key !== 'x' && key !== 'y' && (key !== 'z' || geocent)) {
package/proj4rs.d.ts CHANGED
@@ -1,66 +1,27 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- * Read a binary NTv2 from Dataview.
5
- *
6
- * Note: only NTv2 file format are supported.
7
- * @param {string} key
8
- * @param {DataView} view
9
- */
10
- export function add_nadgrid(key: string, view: DataView): void;
11
- /**
12
- * @param {Projection} src
13
- * @param {Projection} dst
14
- * @param {Point} point
15
- */
16
3
  export function transform(src: Projection, dst: Projection, point: Point): void;
17
4
  /**
18
- */
5
+ * Read a binary NTv2 from Dataview.
6
+ *
7
+ * Note: only NTv2 file format are supported.
8
+ */
9
+ export function add_nadgrid(key: string, view: DataView): void;
19
10
  export class Point {
20
11
  free(): void;
21
- /**
22
- * @param {number} x
23
- * @param {number} y
24
- * @param {number} z
25
- */
26
12
  constructor(x: number, y: number, z: number);
27
- /**
28
- */
29
13
  x: number;
30
- /**
31
- */
32
14
  y: number;
33
- /**
34
- */
35
15
  z: number;
36
16
  }
37
- /**
38
- */
39
17
  export class Projection {
40
18
  free(): void;
41
- /**
42
- * @param {string} defn
43
- */
44
19
  constructor(defn: string);
45
- /**
46
- */
47
- readonly axis: string;
48
- /**
49
- */
50
20
  readonly isGeocentric: boolean;
51
- /**
52
- */
53
21
  readonly isLatlon: boolean;
54
- /**
55
- */
56
22
  readonly isNormalizedAxis: boolean;
57
- /**
58
- */
23
+ readonly axis: string;
24
+ readonly units: string;
59
25
  readonly projName: string;
60
- /**
61
- */
62
26
  readonly to_meter: number;
63
- /**
64
- */
65
- readonly units: string;
66
27
  }
package/proj4rs.js CHANGED
@@ -1,5 +1,5 @@
1
-
2
1
  import * as wasm from "./proj4rs_bg.wasm";
2
+ export * from "./proj4rs_bg.js";
3
3
  import { __wbg_set_wasm } from "./proj4rs_bg.js";
4
4
  __wbg_set_wasm(wasm);
5
- export * from "./proj4rs_bg.js";
5
+ wasm.__wbindgen_start();
package/proj4rs_bg.js CHANGED
@@ -24,23 +24,6 @@ function getStringFromWasm0(ptr, len) {
24
24
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
25
25
  }
26
26
 
27
- const heap = new Array(128).fill(undefined);
28
-
29
- heap.push(undefined, null, true, false);
30
-
31
- let heap_next = heap.length;
32
-
33
- function addHeapObject(obj) {
34
- if (heap_next === heap.length) heap.push(heap.length + 1);
35
- const idx = heap_next;
36
- heap_next = heap[idx];
37
-
38
- heap[idx] = obj;
39
- return idx;
40
- }
41
-
42
- function getObject(idx) { return heap[idx]; }
43
-
44
27
  let WASM_VECTOR_LEN = 0;
45
28
 
46
29
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
@@ -112,82 +95,52 @@ function getDataViewMemory0() {
112
95
  return cachedDataViewMemory0;
113
96
  }
114
97
 
115
- function dropObject(idx) {
116
- if (idx < 132) return;
117
- heap[idx] = heap_next;
118
- heap_next = idx;
119
- }
120
-
121
- function takeObject(idx) {
122
- const ret = getObject(idx);
123
- dropObject(idx);
124
- return ret;
125
- }
126
-
127
- let stack_pointer = 128;
128
-
129
- function addBorrowedObject(obj) {
130
- if (stack_pointer == 1) throw new Error('out of js stack');
131
- heap[--stack_pointer] = obj;
132
- return stack_pointer;
133
- }
134
- /**
135
- * Read a binary NTv2 from Dataview.
136
- *
137
- * Note: only NTv2 file format are supported.
138
- * @param {string} key
139
- * @param {DataView} view
140
- */
141
- export function add_nadgrid(key, view) {
142
- try {
143
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
144
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
145
- const len0 = WASM_VECTOR_LEN;
146
- wasm.add_nadgrid(retptr, ptr0, len0, addBorrowedObject(view));
147
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
148
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
149
- if (r1) {
150
- throw takeObject(r0);
151
- }
152
- } finally {
153
- wasm.__wbindgen_add_to_stack_pointer(16);
154
- heap[stack_pointer++] = undefined;
155
- }
98
+ function takeFromExternrefTable0(idx) {
99
+ const value = wasm.__wbindgen_export_0.get(idx);
100
+ wasm.__externref_table_dealloc(idx);
101
+ return value;
156
102
  }
157
103
 
158
104
  function _assertClass(instance, klass) {
159
105
  if (!(instance instanceof klass)) {
160
106
  throw new Error(`expected instance of ${klass.name}`);
161
107
  }
162
- return instance.ptr;
163
108
  }
164
109
  /**
165
- * @param {Projection} src
166
- * @param {Projection} dst
167
- * @param {Point} point
168
- */
110
+ * @param {Projection} src
111
+ * @param {Projection} dst
112
+ * @param {Point} point
113
+ */
169
114
  export function transform(src, dst, point) {
170
- try {
171
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
172
- _assertClass(src, Projection);
173
- _assertClass(dst, Projection);
174
- _assertClass(point, Point);
175
- wasm.transform(retptr, src.__wbg_ptr, dst.__wbg_ptr, point.__wbg_ptr);
176
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
177
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
178
- if (r1) {
179
- throw takeObject(r0);
180
- }
181
- } finally {
182
- wasm.__wbindgen_add_to_stack_pointer(16);
115
+ _assertClass(src, Projection);
116
+ _assertClass(dst, Projection);
117
+ _assertClass(point, Point);
118
+ const ret = wasm.transform(src.__wbg_ptr, dst.__wbg_ptr, point.__wbg_ptr);
119
+ if (ret[1]) {
120
+ throw takeFromExternrefTable0(ret[0]);
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Read a binary NTv2 from Dataview.
126
+ *
127
+ * Note: only NTv2 file format are supported.
128
+ * @param {string} key
129
+ * @param {DataView} view
130
+ */
131
+ export function add_nadgrid(key, view) {
132
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
133
+ const len0 = WASM_VECTOR_LEN;
134
+ const ret = wasm.add_nadgrid(ptr0, len0, view);
135
+ if (ret[1]) {
136
+ throw takeFromExternrefTable0(ret[0]);
183
137
  }
184
138
  }
185
139
 
186
140
  const PointFinalization = (typeof FinalizationRegistry === 'undefined')
187
141
  ? { register: () => {}, unregister: () => {} }
188
142
  : new FinalizationRegistry(ptr => wasm.__wbg_point_free(ptr >>> 0, 1));
189
- /**
190
- */
143
+
191
144
  export class Point {
192
145
 
193
146
  __destroy_into_raw() {
@@ -202,49 +155,49 @@ export class Point {
202
155
  wasm.__wbg_point_free(ptr, 0);
203
156
  }
204
157
  /**
205
- * @returns {number}
206
- */
158
+ * @returns {number}
159
+ */
207
160
  get x() {
208
161
  const ret = wasm.__wbg_get_point_x(this.__wbg_ptr);
209
162
  return ret;
210
163
  }
211
164
  /**
212
- * @param {number} arg0
213
- */
165
+ * @param {number} arg0
166
+ */
214
167
  set x(arg0) {
215
168
  wasm.__wbg_set_point_x(this.__wbg_ptr, arg0);
216
169
  }
217
170
  /**
218
- * @returns {number}
219
- */
171
+ * @returns {number}
172
+ */
220
173
  get y() {
221
174
  const ret = wasm.__wbg_get_point_y(this.__wbg_ptr);
222
175
  return ret;
223
176
  }
224
177
  /**
225
- * @param {number} arg0
226
- */
178
+ * @param {number} arg0
179
+ */
227
180
  set y(arg0) {
228
181
  wasm.__wbg_set_point_y(this.__wbg_ptr, arg0);
229
182
  }
230
183
  /**
231
- * @returns {number}
232
- */
184
+ * @returns {number}
185
+ */
233
186
  get z() {
234
187
  const ret = wasm.__wbg_get_point_z(this.__wbg_ptr);
235
188
  return ret;
236
189
  }
237
190
  /**
238
- * @param {number} arg0
239
- */
191
+ * @param {number} arg0
192
+ */
240
193
  set z(arg0) {
241
194
  wasm.__wbg_set_point_z(this.__wbg_ptr, arg0);
242
195
  }
243
196
  /**
244
- * @param {number} x
245
- * @param {number} y
246
- * @param {number} z
247
- */
197
+ * @param {number} x
198
+ * @param {number} y
199
+ * @param {number} z
200
+ */
248
201
  constructor(x, y, z) {
249
202
  const ret = wasm.point_new(x, y, z);
250
203
  this.__wbg_ptr = ret >>> 0;
@@ -256,8 +209,7 @@ export class Point {
256
209
  const ProjectionFinalization = (typeof FinalizationRegistry === 'undefined')
257
210
  ? { register: () => {}, unregister: () => {} }
258
211
  : new FinalizationRegistry(ptr => wasm.__wbg_projection_free(ptr >>> 0, 1));
259
- /**
260
- */
212
+
261
213
  export class Projection {
262
214
 
263
215
  __destroy_into_raw() {
@@ -272,170 +224,157 @@ export class Projection {
272
224
  wasm.__wbg_projection_free(ptr, 0);
273
225
  }
274
226
  /**
275
- * @param {string} defn
276
- */
277
- constructor(defn) {
278
- try {
279
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
280
- const ptr0 = passStringToWasm0(defn, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
281
- const len0 = WASM_VECTOR_LEN;
282
- wasm.projection_new(retptr, ptr0, len0);
283
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
284
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
285
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
286
- if (r2) {
287
- throw takeObject(r1);
288
- }
289
- this.__wbg_ptr = r0 >>> 0;
290
- ProjectionFinalization.register(this, this.__wbg_ptr, this);
291
- return this;
292
- } finally {
293
- wasm.__wbindgen_add_to_stack_pointer(16);
294
- }
295
- }
296
- /**
297
- * @returns {string}
298
- */
299
- get projName() {
300
- let deferred1_0;
301
- let deferred1_1;
302
- try {
303
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
304
- wasm.projection_projName(retptr, this.__wbg_ptr);
305
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
306
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
307
- deferred1_0 = r0;
308
- deferred1_1 = r1;
309
- return getStringFromWasm0(r0, r1);
310
- } finally {
311
- wasm.__wbindgen_add_to_stack_pointer(16);
312
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
313
- }
227
+ * @returns {boolean}
228
+ */
229
+ get isGeocentric() {
230
+ const ret = wasm.projection_isGeocentric(this.__wbg_ptr);
231
+ return ret !== 0;
314
232
  }
315
233
  /**
316
- * @returns {boolean}
317
- */
234
+ * @returns {boolean}
235
+ */
318
236
  get isLatlon() {
319
237
  const ret = wasm.projection_isLatlon(this.__wbg_ptr);
320
238
  return ret !== 0;
321
239
  }
322
240
  /**
323
- * @returns {boolean}
324
- */
325
- get isGeocentric() {
326
- const ret = wasm.projection_isGeocentric(this.__wbg_ptr);
241
+ * @returns {boolean}
242
+ */
243
+ get isNormalizedAxis() {
244
+ const ret = wasm.projection_isNormalizedAxis(this.__wbg_ptr);
327
245
  return ret !== 0;
328
246
  }
329
247
  /**
330
- * @returns {string}
331
- */
248
+ * @param {string} defn
249
+ */
250
+ constructor(defn) {
251
+ const ptr0 = passStringToWasm0(defn, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
252
+ const len0 = WASM_VECTOR_LEN;
253
+ const ret = wasm.projection_new(ptr0, len0);
254
+ if (ret[2]) {
255
+ throw takeFromExternrefTable0(ret[1]);
256
+ }
257
+ this.__wbg_ptr = ret[0] >>> 0;
258
+ ProjectionFinalization.register(this, this.__wbg_ptr, this);
259
+ return this;
260
+ }
261
+ /**
262
+ * @returns {string}
263
+ */
332
264
  get axis() {
333
265
  let deferred1_0;
334
266
  let deferred1_1;
335
267
  try {
336
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
337
- wasm.projection_axis(retptr, this.__wbg_ptr);
338
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
339
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
340
- deferred1_0 = r0;
341
- deferred1_1 = r1;
342
- return getStringFromWasm0(r0, r1);
268
+ const ret = wasm.projection_axis(this.__wbg_ptr);
269
+ deferred1_0 = ret[0];
270
+ deferred1_1 = ret[1];
271
+ return getStringFromWasm0(ret[0], ret[1]);
343
272
  } finally {
344
- wasm.__wbindgen_add_to_stack_pointer(16);
345
273
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
346
274
  }
347
275
  }
348
276
  /**
349
- * @returns {boolean}
350
- */
351
- get isNormalizedAxis() {
352
- const ret = wasm.projection_isNormalizedAxis(this.__wbg_ptr);
353
- return ret !== 0;
354
- }
355
- /**
356
- * @returns {number}
357
- */
358
- get to_meter() {
359
- const ret = wasm.projection_to_meter(this.__wbg_ptr);
360
- return ret;
277
+ * @returns {string}
278
+ */
279
+ get units() {
280
+ let deferred1_0;
281
+ let deferred1_1;
282
+ try {
283
+ const ret = wasm.projection_units(this.__wbg_ptr);
284
+ deferred1_0 = ret[0];
285
+ deferred1_1 = ret[1];
286
+ return getStringFromWasm0(ret[0], ret[1]);
287
+ } finally {
288
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
289
+ }
361
290
  }
362
291
  /**
363
- * @returns {string}
364
- */
365
- get units() {
292
+ * @returns {string}
293
+ */
294
+ get projName() {
366
295
  let deferred1_0;
367
296
  let deferred1_1;
368
297
  try {
369
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
370
- wasm.projection_units(retptr, this.__wbg_ptr);
371
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
372
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
373
- deferred1_0 = r0;
374
- deferred1_1 = r1;
375
- return getStringFromWasm0(r0, r1);
298
+ const ret = wasm.projection_projName(this.__wbg_ptr);
299
+ deferred1_0 = ret[0];
300
+ deferred1_1 = ret[1];
301
+ return getStringFromWasm0(ret[0], ret[1]);
376
302
  } finally {
377
- wasm.__wbindgen_add_to_stack_pointer(16);
378
303
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
379
304
  }
380
305
  }
306
+ /**
307
+ * @returns {number}
308
+ */
309
+ get to_meter() {
310
+ const ret = wasm.projection_to_meter(this.__wbg_ptr);
311
+ return ret;
312
+ }
381
313
  }
382
314
 
383
- export function __wbindgen_error_new(arg0, arg1) {
384
- const ret = new Error(getStringFromWasm0(arg0, arg1));
385
- return addHeapObject(ret);
315
+ export function __wbg_buffer_e6c6daaa78528d53(arg0) {
316
+ const ret = arg0.buffer;
317
+ return ret;
386
318
  };
387
319
 
388
- export function __wbindgen_string_get(arg0, arg1) {
389
- const obj = getObject(arg1);
390
- const ret = typeof(obj) === 'string' ? obj : undefined;
391
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
392
- var len1 = WASM_VECTOR_LEN;
393
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
394
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
320
+ export function __wbg_getFloat32_e0872364daa466bb(arg0, arg1, arg2) {
321
+ const ret = arg0.getFloat32(arg1 >>> 0, arg2 !== 0);
322
+ return ret;
395
323
  };
396
324
 
397
- export function __wbindgen_object_drop_ref(arg0) {
398
- takeObject(arg0);
325
+ export function __wbg_getFloat64_3c55a5d18420aa12(arg0, arg1, arg2) {
326
+ const ret = arg0.getFloat64(arg1 >>> 0, arg2 !== 0);
327
+ return ret;
399
328
  };
400
329
 
401
- export function __wbg_parseInt_d764958c60f6d3fb(arg0, arg1, arg2) {
402
- const ret = parseInt(getStringFromWasm0(arg0, arg1), arg2);
330
+ export function __wbg_getInt32_6ea30555a7e6366d(arg0, arg1, arg2) {
331
+ const ret = arg0.getInt32(arg1 >>> 0, arg2 !== 0);
403
332
  return ret;
404
333
  };
405
334
 
406
- export function __wbg_parseFloat_b1b04fcaf22971b0(arg0, arg1) {
407
- const ret = parseFloat(getStringFromWasm0(arg0, arg1));
335
+ export function __wbg_getUint32_78580012d2915dec(arg0, arg1, arg2) {
336
+ const ret = arg0.getUint32(arg1 >>> 0, arg2 !== 0);
408
337
  return ret;
409
338
  };
410
339
 
411
- export function __wbg_slice_f2eec3f5b3eba38d(arg0, arg1, arg2) {
412
- const ret = getObject(arg0).slice(arg1 >>> 0, arg2 >>> 0);
413
- return addHeapObject(ret);
340
+ export function __wbg_parseFloat_40655e71a57d91e0(arg0, arg1) {
341
+ const ret = parseFloat(getStringFromWasm0(arg0, arg1));
342
+ return ret;
414
343
  };
415
344
 
416
- export function __wbg_buffer_cb1b140b7c25c485(arg0) {
417
- const ret = getObject(arg0).buffer;
418
- return addHeapObject(ret);
345
+ export function __wbg_parseInt_7deceafc75400ae4(arg0, arg1, arg2) {
346
+ const ret = parseInt(getStringFromWasm0(arg0, arg1), arg2);
347
+ return ret;
419
348
  };
420
349
 
421
- export function __wbg_getInt32_15561582072bf5e9(arg0, arg1, arg2) {
422
- const ret = getObject(arg0).getInt32(arg1 >>> 0, arg2 !== 0);
350
+ export function __wbg_slice_ab0b7e3d75dccdee(arg0, arg1, arg2) {
351
+ const ret = arg0.slice(arg1 >>> 0, arg2 >>> 0);
423
352
  return ret;
424
353
  };
425
354
 
426
- export function __wbg_getUint32_0aebf6b991eb16be(arg0, arg1, arg2) {
427
- const ret = getObject(arg0).getUint32(arg1 >>> 0, arg2 !== 0);
355
+ export function __wbindgen_error_new(arg0, arg1) {
356
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
428
357
  return ret;
429
358
  };
430
359
 
431
- export function __wbg_getFloat32_3028134421611c5d(arg0, arg1, arg2) {
432
- const ret = getObject(arg0).getFloat32(arg1 >>> 0, arg2 !== 0);
433
- return ret;
360
+ export function __wbindgen_init_externref_table() {
361
+ const table = wasm.__wbindgen_export_0;
362
+ const offset = table.grow(4);
363
+ table.set(0, undefined);
364
+ table.set(offset + 0, undefined);
365
+ table.set(offset + 1, null);
366
+ table.set(offset + 2, true);
367
+ table.set(offset + 3, false);
368
+ ;
434
369
  };
435
370
 
436
- export function __wbg_getFloat64_41ed54ab83a47d2b(arg0, arg1, arg2) {
437
- const ret = getObject(arg0).getFloat64(arg1 >>> 0, arg2 !== 0);
438
- return ret;
371
+ export function __wbindgen_string_get(arg0, arg1) {
372
+ const obj = arg1;
373
+ const ret = typeof(obj) === 'string' ? obj : undefined;
374
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
375
+ var len1 = WASM_VECTOR_LEN;
376
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
377
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
439
378
  };
440
379
 
441
380
  export function __wbindgen_throw(arg0, arg1) {
package/proj4rs_bg.wasm CHANGED
Binary file
@@ -1,26 +1,28 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function add_nadgrid(a: number, b: number, c: number, d: number): void;
5
- export function __wbg_projection_free(a: number, b: number): void;
6
- export function projection_new(a: number, b: number, c: number): void;
7
- export function projection_projName(a: number, b: number): void;
8
- export function projection_isLatlon(a: number): number;
9
- export function projection_isGeocentric(a: number): number;
10
- export function projection_axis(a: number, b: number): void;
11
- export function projection_isNormalizedAxis(a: number): number;
12
- export function projection_to_meter(a: number): number;
13
- export function projection_units(a: number, b: number): void;
14
- export function __wbg_point_free(a: number, b: number): void;
15
- export function __wbg_get_point_x(a: number): number;
16
- export function __wbg_set_point_x(a: number, b: number): void;
17
- export function __wbg_get_point_y(a: number): number;
18
- export function __wbg_set_point_y(a: number, b: number): void;
19
- export function __wbg_get_point_z(a: number): number;
20
- export function __wbg_set_point_z(a: number, b: number): void;
21
- export function point_new(a: number, b: number, c: number): number;
22
- export function transform(a: number, b: number, c: number, d: number): void;
23
- export function __wbindgen_malloc(a: number, b: number): number;
24
- export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
25
- export function __wbindgen_add_to_stack_pointer(a: number): number;
26
- export function __wbindgen_free(a: number, b: number, c: number): void;
4
+ export const __wbg_get_point_x: (a: number) => number;
5
+ export const __wbg_get_point_y: (a: number) => number;
6
+ export const __wbg_get_point_z: (a: number) => number;
7
+ export const __wbg_point_free: (a: number, b: number) => void;
8
+ export const __wbg_projection_free: (a: number, b: number) => void;
9
+ export const __wbg_set_point_x: (a: number, b: number) => void;
10
+ export const __wbg_set_point_y: (a: number, b: number) => void;
11
+ export const __wbg_set_point_z: (a: number, b: number) => void;
12
+ export const add_nadgrid: (a: number, b: number, c: any) => [number, number];
13
+ export const point_new: (a: number, b: number, c: number) => number;
14
+ export const projection_axis: (a: number) => [number, number];
15
+ export const projection_isGeocentric: (a: number) => number;
16
+ export const projection_isLatlon: (a: number) => number;
17
+ export const projection_isNormalizedAxis: (a: number) => number;
18
+ export const projection_new: (a: number, b: number) => [number, number, number];
19
+ export const projection_projName: (a: number) => [number, number];
20
+ export const projection_to_meter: (a: number) => number;
21
+ export const projection_units: (a: number) => [number, number];
22
+ export const transform: (a: number, b: number, c: number) => [number, number];
23
+ export const __wbindgen_export_0: WebAssembly.Table;
24
+ export const __wbindgen_malloc: (a: number, b: number) => number;
25
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
26
+ export const __externref_table_dealloc: (a: number) => void;
27
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
28
+ export const __wbindgen_start: () => void;