@loaders.gl/wkt 4.0.2 → 4.0.3

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.
@@ -1,4 +1,4 @@
1
- import type { Writer, WriterOptions } from '@loaders.gl/loader-utils';
1
+ import type { WriterWithEncoder, WriterOptions } from '@loaders.gl/loader-utils';
2
2
  import type { Geometry, Feature } from '@loaders.gl/schema';
3
3
  export type WKBWriterOptions = WriterOptions & {
4
4
  wkb?: {
@@ -13,5 +13,5 @@ export type WKBWriterOptions = WriterOptions & {
13
13
  /**
14
14
  * WKB exporter
15
15
  */
16
- export declare const WKBWriter: Writer<Geometry | Feature, never, WriterOptions>;
16
+ export declare const WKBWriter: WriterWithEncoder<Geometry | Feature, never, WriterOptions>;
17
17
  //# sourceMappingURL=wkb-writer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wkb-writer.d.ts","sourceRoot":"","sources":["../src/wkb-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAGpE,OAAO,KAAK,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE;QACJ,4CAA4C;QAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;QAEf,4CAA4C;QAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;QAEf,0CAA0C;QAC1C,IAAI,CAAC,EAAE,GAAG,CAAC;KACZ,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,GAAG,OAAO,EAAE,KAAK,EAAE,aAAa,CAkBtE,CAAC"}
1
+ {"version":3,"file":"wkb-writer.d.ts","sourceRoot":"","sources":["../src/wkb-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAG/E,OAAO,KAAK,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE;QACJ,4CAA4C;QAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;QAEf,4CAA4C;QAC5C,IAAI,CAAC,EAAE,OAAO,CAAC;QAEf,0CAA0C;QAC1C,IAAI,CAAC,EAAE,GAAG,CAAC;KACZ,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,iBAAiB,CAAC,QAAQ,GAAG,OAAO,EAAE,KAAK,EAAE,aAAa,CAkBjF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wkb-writer.js","names":["VERSION","encodeWKB","WKBWriter","name","id","module","version","extensions","options","wkb","hasZ","hasM","encode","data","encodeSync"],"sources":["../src/wkb-writer.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {Writer, WriterOptions} from '@loaders.gl/loader-utils';\nimport {VERSION} from './lib/utils/version';\nimport {encodeWKB} from './lib/encode-wkb';\nimport type {Geometry, Feature} from '@loaders.gl/schema';\n\nexport type WKBWriterOptions = WriterOptions & {\n wkb?: {\n /** Does the GeoJSON input have Z values? */\n hasZ?: boolean;\n\n /** Does the GeoJSON input have M values? */\n hasM?: boolean;\n\n /** Spatial reference for input GeoJSON */\n srid?: any;\n };\n};\n\n/**\n * WKB exporter\n */\nexport const WKBWriter: Writer<Geometry | Feature, never, WriterOptions> = {\n name: 'WKB (Well Known Binary)',\n id: 'wkb',\n module: 'wkt',\n version: VERSION,\n extensions: ['wkb'],\n options: {\n wkb: {\n hasZ: false,\n hasM: false\n }\n },\n async encode(data: Geometry | Feature, options?: WriterOptions): Promise<ArrayBuffer> {\n return encodeWKB(data, options?.wkb);\n },\n encodeSync(data: Geometry | Feature, options?: WriterOptions): ArrayBuffer {\n return encodeWKB(data, options?.wkb);\n }\n};\n"],"mappings":"SAIQA,OAAO;AAAA,SACPC,SAAS;AAmBjB,OAAO,MAAMC,SAA2D,GAAG;EACzEC,IAAI,EAAE,yBAAyB;EAC/BC,EAAE,EAAE,KAAK;EACTC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACPC,GAAG,EAAE;MACHC,IAAI,EAAE,KAAK;MACXC,IAAI,EAAE;IACR;EACF,CAAC;EACD,MAAMC,MAAMA,CAACC,IAAwB,EAAEL,OAAuB,EAAwB;IACpF,OAAOP,SAAS,CAACY,IAAI,EAAEL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EACtC,CAAC;EACDK,UAAUA,CAACD,IAAwB,EAAEL,OAAuB,EAAe;IACzE,OAAOP,SAAS,CAACY,IAAI,EAAEL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EACtC;AACF,CAAC"}
1
+ {"version":3,"file":"wkb-writer.js","names":["VERSION","encodeWKB","WKBWriter","name","id","module","version","extensions","options","wkb","hasZ","hasM","encode","data","encodeSync"],"sources":["../src/wkb-writer.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';\nimport {VERSION} from './lib/utils/version';\nimport {encodeWKB} from './lib/encode-wkb';\nimport type {Geometry, Feature} from '@loaders.gl/schema';\n\nexport type WKBWriterOptions = WriterOptions & {\n wkb?: {\n /** Does the GeoJSON input have Z values? */\n hasZ?: boolean;\n\n /** Does the GeoJSON input have M values? */\n hasM?: boolean;\n\n /** Spatial reference for input GeoJSON */\n srid?: any;\n };\n};\n\n/**\n * WKB exporter\n */\nexport const WKBWriter: WriterWithEncoder<Geometry | Feature, never, WriterOptions> = {\n name: 'WKB (Well Known Binary)',\n id: 'wkb',\n module: 'wkt',\n version: VERSION,\n extensions: ['wkb'],\n options: {\n wkb: {\n hasZ: false,\n hasM: false\n }\n },\n async encode(data: Geometry | Feature, options?: WriterOptions): Promise<ArrayBuffer> {\n return encodeWKB(data, options?.wkb);\n },\n encodeSync(data: Geometry | Feature, options?: WriterOptions): ArrayBuffer {\n return encodeWKB(data, options?.wkb);\n }\n};\n"],"mappings":"SAIQA,OAAO;AAAA,SACPC,SAAS;AAmBjB,OAAO,MAAMC,SAAsE,GAAG;EACpFC,IAAI,EAAE,yBAAyB;EAC/BC,EAAE,EAAE,KAAK;EACTC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEN,OAAO;EAChBO,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE;IACPC,GAAG,EAAE;MACHC,IAAI,EAAE,KAAK;MACXC,IAAI,EAAE;IACR;EACF,CAAC;EACD,MAAMC,MAAMA,CAACC,IAAwB,EAAEL,OAAuB,EAAwB;IACpF,OAAOP,SAAS,CAACY,IAAI,EAAEL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EACtC,CAAC;EACDK,UAAUA,CAACD,IAAwB,EAAEL,OAAuB,EAAe;IACzE,OAAOP,SAAS,CAACY,IAAI,EAAEL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,GAAG,CAAC;EACtC;AACF,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Writer, WriterOptions } from '@loaders.gl/loader-utils';
1
+ import type { WriterWithEncoder, WriterOptions } from '@loaders.gl/loader-utils';
2
2
  import type { WKTCRS } from './lib/parse-wkt-crs';
3
3
  import type { EncodeWKTCRSOptions } from './lib/encode-wkt-crs';
4
4
  export type WKTCRSWriterOptions = WriterOptions & {
@@ -9,5 +9,5 @@ export type WKTCRSWriterOptions = WriterOptions & {
9
9
  * @see OGC Standard: https://www.ogc.org/standards/wkt-crs
10
10
  * @see Wikipedia Page: https://en.wikipedia.org/wiki/Well-known_text_representation_of_coordinate_reference_systems
11
11
  */
12
- export declare const WKTCRSWriter: Writer<WKTCRS, never, WKTCRSWriterOptions>;
12
+ export declare const WKTCRSWriter: WriterWithEncoder<WKTCRS, never, WKTCRSWriterOptions>;
13
13
  //# sourceMappingURL=wkt-crs-writer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wkt-crs-writer.d.ts","sourceRoot":"","sources":["../src/wkt-crs-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAGpE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAG9D,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,mBAAmB,CAkBnE,CAAC"}
1
+ {"version":3,"file":"wkt-crs-writer.d.ts","sourceRoot":"","sources":["../src/wkt-crs-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAG/E,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AAG9D,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,SAAS,CAAC,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE,mBAAmB,CAkB9E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wkt-crs-writer.js","names":["VERSION","encodeWKTCRS","WKTCRSWriter","name","id","module","version","worker","extensions","mimeTypes","text","options","encode","wktcrs","TextEncoder","encodeSync","encodeTextSync"],"sources":["../src/wkt-crs-writer.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {Writer, WriterOptions} from '@loaders.gl/loader-utils';\nimport {VERSION} from './lib/utils/version';\n\nimport type {WKTCRS} from './lib/parse-wkt-crs';\nimport type {EncodeWKTCRSOptions} from './lib/encode-wkt-crs';\nimport {encodeWKTCRS} from './lib/encode-wkt-crs';\n\nexport type WKTCRSWriterOptions = WriterOptions & {\n 'wkt-crs'?: EncodeWKTCRSOptions;\n};\n\n/**\n * Well-Known text CRS loader\n * @see OGC Standard: https://www.ogc.org/standards/wkt-crs\n * @see Wikipedia Page: https://en.wikipedia.org/wiki/Well-known_text_representation_of_coordinate_reference_systems\n */\nexport const WKTCRSWriter: Writer<WKTCRS, never, WKTCRSWriterOptions> = {\n name: 'WKT CRS (Well-Known Text Coordinate Reference System)',\n id: 'wkt-crs',\n module: 'wkt-crs',\n version: VERSION,\n worker: true,\n extensions: [],\n mimeTypes: ['text/plain'],\n // category: 'json',\n text: true,\n options: {\n 'wkt-crs': {}\n },\n encode: async (wktcrs, options) =>\n new TextEncoder().encode(encodeWKTCRS(wktcrs, options?.['wkt-crs'])),\n encodeSync: (wktcrs, options) =>\n new TextEncoder().encode(encodeWKTCRS(wktcrs, options?.['wkt-crs'])),\n encodeTextSync: (wktcrs, options) => encodeWKTCRS(wktcrs, options?.['wkt-crs'])\n};\n"],"mappings":"SAIQA,OAAO;AAAA,SAIPC,YAAY;AAWpB,OAAO,MAAMC,YAAwD,GAAG;EACtEC,IAAI,EAAE,uDAAuD;EAC7DC,EAAE,EAAE,SAAS;EACbC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAEN,OAAO;EAChBO,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,EAAE;EACdC,SAAS,EAAE,CAAC,YAAY,CAAC;EAEzBC,IAAI,EAAE,IAAI;EACVC,OAAO,EAAE;IACP,SAAS,EAAE,CAAC;EACd,CAAC;EACDC,MAAM,EAAE,MAAAA,CAAOC,MAAM,EAAEF,OAAO,KAC5B,IAAIG,WAAW,CAAC,CAAC,CAACF,MAAM,CAACX,YAAY,CAACY,MAAM,EAAEF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAG,SAAS,CAAC,CAAC,CAAC;EACtEI,UAAU,EAAEA,CAACF,MAAM,EAAEF,OAAO,KAC1B,IAAIG,WAAW,CAAC,CAAC,CAACF,MAAM,CAACX,YAAY,CAACY,MAAM,EAAEF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAG,SAAS,CAAC,CAAC,CAAC;EACtEK,cAAc,EAAEA,CAACH,MAAM,EAAEF,OAAO,KAAKV,YAAY,CAACY,MAAM,EAAEF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAG,SAAS,CAAC;AAChF,CAAC"}
1
+ {"version":3,"file":"wkt-crs-writer.js","names":["VERSION","encodeWKTCRS","WKTCRSWriter","name","id","module","version","worker","extensions","mimeTypes","text","options","encode","wktcrs","TextEncoder","encodeSync","encodeTextSync"],"sources":["../src/wkt-crs-writer.ts"],"sourcesContent":["// loaders.gl, MIT license\n// Copyright (c) vis.gl contributors\n\nimport type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';\nimport {VERSION} from './lib/utils/version';\n\nimport type {WKTCRS} from './lib/parse-wkt-crs';\nimport type {EncodeWKTCRSOptions} from './lib/encode-wkt-crs';\nimport {encodeWKTCRS} from './lib/encode-wkt-crs';\n\nexport type WKTCRSWriterOptions = WriterOptions & {\n 'wkt-crs'?: EncodeWKTCRSOptions;\n};\n\n/**\n * Well-Known text CRS loader\n * @see OGC Standard: https://www.ogc.org/standards/wkt-crs\n * @see Wikipedia Page: https://en.wikipedia.org/wiki/Well-known_text_representation_of_coordinate_reference_systems\n */\nexport const WKTCRSWriter: WriterWithEncoder<WKTCRS, never, WKTCRSWriterOptions> = {\n name: 'WKT CRS (Well-Known Text Coordinate Reference System)',\n id: 'wkt-crs',\n module: 'wkt-crs',\n version: VERSION,\n worker: true,\n extensions: [],\n mimeTypes: ['text/plain'],\n // category: 'json',\n text: true,\n options: {\n 'wkt-crs': {}\n },\n encode: async (wktcrs, options) =>\n new TextEncoder().encode(encodeWKTCRS(wktcrs, options?.['wkt-crs'])),\n encodeSync: (wktcrs, options) =>\n new TextEncoder().encode(encodeWKTCRS(wktcrs, options?.['wkt-crs'])),\n encodeTextSync: (wktcrs, options) => encodeWKTCRS(wktcrs, options?.['wkt-crs'])\n};\n"],"mappings":"SAIQA,OAAO;AAAA,SAIPC,YAAY;AAWpB,OAAO,MAAMC,YAAmE,GAAG;EACjFC,IAAI,EAAE,uDAAuD;EAC7DC,EAAE,EAAE,SAAS;EACbC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAEN,OAAO;EAChBO,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,EAAE;EACdC,SAAS,EAAE,CAAC,YAAY,CAAC;EAEzBC,IAAI,EAAE,IAAI;EACVC,OAAO,EAAE;IACP,SAAS,EAAE,CAAC;EACd,CAAC;EACDC,MAAM,EAAE,MAAAA,CAAOC,MAAM,EAAEF,OAAO,KAC5B,IAAIG,WAAW,CAAC,CAAC,CAACF,MAAM,CAACX,YAAY,CAACY,MAAM,EAAEF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAG,SAAS,CAAC,CAAC,CAAC;EACtEI,UAAU,EAAEA,CAACF,MAAM,EAAEF,OAAO,KAC1B,IAAIG,WAAW,CAAC,CAAC,CAACF,MAAM,CAACX,YAAY,CAACY,MAAM,EAAEF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAG,SAAS,CAAC,CAAC,CAAC;EACtEK,cAAc,EAAEA,CAACH,MAAM,EAAEF,OAAO,KAAKV,YAAY,CAACY,MAAM,EAAEF,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAG,SAAS,CAAC;AAChF,CAAC"}
@@ -208,7 +208,7 @@
208
208
  }
209
209
 
210
210
  // src/lib/utils/version.ts
211
- var VERSION = true ? "4.0.2" : "latest";
211
+ var VERSION = true ? "4.0.3" : "latest";
212
212
 
213
213
  // src/lib/parse-wkt.ts
214
214
  var numberRegexp = /[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loaders.gl/wkt",
3
3
  "description": "Loader and Writer for the WKT (Well Known Text) Format",
4
- "version": "4.0.2",
4
+ "version": "4.0.3",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "publishConfig": {
@@ -43,8 +43,8 @@
43
43
  "fuzzer": "^0.2.1"
44
44
  },
45
45
  "dependencies": {
46
- "@loaders.gl/loader-utils": "4.0.2",
47
- "@loaders.gl/schema": "4.0.2"
46
+ "@loaders.gl/loader-utils": "4.0.3",
47
+ "@loaders.gl/schema": "4.0.3"
48
48
  },
49
- "gitHead": "471058d109d5652f28c32c1f296fd632f9a5c806"
49
+ "gitHead": "03c871839b36c997249dabae1844df53a35d3760"
50
50
  }
package/src/wkb-writer.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // loaders.gl, MIT license
2
2
  // Copyright (c) vis.gl contributors
3
3
 
4
- import type {Writer, WriterOptions} from '@loaders.gl/loader-utils';
4
+ import type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';
5
5
  import {VERSION} from './lib/utils/version';
6
6
  import {encodeWKB} from './lib/encode-wkb';
7
7
  import type {Geometry, Feature} from '@loaders.gl/schema';
@@ -22,7 +22,7 @@ export type WKBWriterOptions = WriterOptions & {
22
22
  /**
23
23
  * WKB exporter
24
24
  */
25
- export const WKBWriter: Writer<Geometry | Feature, never, WriterOptions> = {
25
+ export const WKBWriter: WriterWithEncoder<Geometry | Feature, never, WriterOptions> = {
26
26
  name: 'WKB (Well Known Binary)',
27
27
  id: 'wkb',
28
28
  module: 'wkt',
@@ -1,7 +1,7 @@
1
1
  // loaders.gl, MIT license
2
2
  // Copyright (c) vis.gl contributors
3
3
 
4
- import type {Writer, WriterOptions} from '@loaders.gl/loader-utils';
4
+ import type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';
5
5
  import {VERSION} from './lib/utils/version';
6
6
 
7
7
  import type {WKTCRS} from './lib/parse-wkt-crs';
@@ -17,7 +17,7 @@ export type WKTCRSWriterOptions = WriterOptions & {
17
17
  * @see OGC Standard: https://www.ogc.org/standards/wkt-crs
18
18
  * @see Wikipedia Page: https://en.wikipedia.org/wiki/Well-known_text_representation_of_coordinate_reference_systems
19
19
  */
20
- export const WKTCRSWriter: Writer<WKTCRS, never, WKTCRSWriterOptions> = {
20
+ export const WKTCRSWriter: WriterWithEncoder<WKTCRS, never, WKTCRSWriterOptions> = {
21
21
  name: 'WKT CRS (Well-Known Text Coordinate Reference System)',
22
22
  id: 'wkt-crs',
23
23
  module: 'wkt-crs',