@loaders.gl/flatgeobuf 4.3.2 → 4.4.0-alpha.1

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.
@@ -0,0 +1,10 @@
1
+ /** flatgeobuf format */
2
+ export declare const FlatGeobufFormat: {
3
+ readonly id: "flatgeobuf";
4
+ readonly name: "FlatGeobuf";
5
+ readonly module: "flatgeobuf";
6
+ readonly extensions: ["fgb"];
7
+ readonly mimeTypes: ["application/octet-stream"];
8
+ readonly category: "geometry";
9
+ };
10
+ //# sourceMappingURL=flatgeobuf-format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatgeobuf-format.d.ts","sourceRoot":"","sources":["../src/flatgeobuf-format.ts"],"names":[],"mappings":"AAMA,wBAAwB;AACxB,eAAO,MAAM,gBAAgB;;;;;;;CAOF,CAAC"}
@@ -0,0 +1,12 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ /** flatgeobuf format */
5
+ export const FlatGeobufFormat = {
6
+ id: 'flatgeobuf',
7
+ name: 'FlatGeobuf',
8
+ module: 'flatgeobuf',
9
+ extensions: ['fgb'],
10
+ mimeTypes: ['application/octet-stream'],
11
+ category: 'geometry'
12
+ };
@@ -15,14 +15,8 @@ export type FlatGeobufLoaderOptions = LoaderOptions & {
15
15
  export declare const FlatGeobufWorkerLoader: {
16
16
  readonly dataType: any;
17
17
  readonly batchType: any;
18
- readonly id: "flatgeobuf";
19
- readonly name: "FlatGeobuf";
20
- readonly module: "flatgeobuf";
21
18
  readonly version: any;
22
19
  readonly worker: true;
23
- readonly extensions: ["fgb"];
24
- readonly mimeTypes: ["application/octet-stream"];
25
- readonly category: "geometry";
26
20
  readonly tests: [ArrayBufferLike];
27
21
  readonly options: {
28
22
  readonly flatgeobuf: {
@@ -32,6 +26,12 @@ export declare const FlatGeobufWorkerLoader: {
32
26
  readonly reproject: false;
33
27
  };
34
28
  };
29
+ readonly id: "flatgeobuf";
30
+ readonly name: "FlatGeobuf";
31
+ readonly module: "flatgeobuf";
32
+ readonly extensions: ["fgb"];
33
+ readonly mimeTypes: ["application/octet-stream"];
34
+ readonly category: "geometry";
35
35
  };
36
36
  export declare const FlatGeobufLoader: {
37
37
  readonly parse: (arrayBuffer: ArrayBuffer, options?: FlatGeobufLoaderOptions) => Promise<import("@loaders.gl/schema").Table>;
@@ -40,14 +40,8 @@ export declare const FlatGeobufLoader: {
40
40
  readonly binary: true;
41
41
  readonly dataType: any;
42
42
  readonly batchType: any;
43
- readonly id: "flatgeobuf";
44
- readonly name: "FlatGeobuf";
45
- readonly module: "flatgeobuf";
46
43
  readonly version: any;
47
44
  readonly worker: true;
48
- readonly extensions: ["fgb"];
49
- readonly mimeTypes: ["application/octet-stream"];
50
- readonly category: "geometry";
51
45
  readonly tests: [ArrayBufferLike];
52
46
  readonly options: {
53
47
  readonly flatgeobuf: {
@@ -57,6 +51,12 @@ export declare const FlatGeobufLoader: {
57
51
  readonly reproject: false;
58
52
  };
59
53
  };
54
+ readonly id: "flatgeobuf";
55
+ readonly name: "FlatGeobuf";
56
+ readonly module: "flatgeobuf";
57
+ readonly extensions: ["fgb"];
58
+ readonly mimeTypes: ["application/octet-stream"];
59
+ readonly category: "geometry";
60
60
  };
61
61
  declare function parseSync(arrayBuffer: ArrayBuffer, options?: FlatGeobufLoaderOptions): import("@loaders.gl/schema").Table;
62
62
  declare function parseInBatchesFromStream(stream: any, options: FlatGeobufLoaderOptions): any[] | AsyncGenerator<import("./flatgeobuf/3.27.2").IFeature, any, any> | AsyncGenerator<any, void, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"flatgeobuf-loader.d.ts","sourceRoot":"","sources":["../src/flatgeobuf-loader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAA2B,aAAa,EAAC,MAAM,0BAA0B,CAAC;AActF,MAAM,MAAM,uBAAuB,GAAG,aAAa,GAAG;IACpD,UAAU,CAAC,EAAE;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,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,kCAAkC;AAClC,eAAO,MAAM,sBAAsB;uBAGf,GAAG;wBACF,GAAG;;;;;;;;;;;;;;;;;;CAYyE,CAAC;AAElG,eAAO,MAAM,gBAAgB;kCAEA,WAAW,YAAW,uBAAuB;;;;uBAjBtD,GAAG;wBACF,GAAG;;;;;;;;;;;;;;;;;;CAsBgD,CAAC;AAEzE,iBAAS,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,GAAE,uBAA4B,sCAEjF;AAED,iBAAS,wBAAwB,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,uBAAuB,iHAE9E"}
@@ -2,23 +2,19 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
  import { parseFlatGeobuf, parseFlatGeobufInBatches } from "./lib/parse-flatgeobuf.js";
5
+ import { FlatGeobufFormat } from "./flatgeobuf-format.js";
5
6
  // __VERSION__ is injected by babel-plugin-version-inline
6
7
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "4.3.1" !== 'undefined' ? "4.3.1" : 'latest';
8
+ const VERSION = typeof "4.4.0-alpha.0" !== 'undefined' ? "4.4.0-alpha.0" : 'latest';
8
9
  // FGB\3FGB\1
9
10
  const FGB_MAGIC_NUMBER = [0x66, 0x67, 0x62, 0x03, 0x66, 0x67, 0x62, 0x01];
10
11
  /** Load flatgeobuf on a worker */
11
12
  export const FlatGeobufWorkerLoader = {
13
+ ...FlatGeobufFormat,
12
14
  dataType: null,
13
15
  batchType: null,
14
- id: 'flatgeobuf',
15
- name: 'FlatGeobuf',
16
- module: 'flatgeobuf',
17
16
  version: VERSION,
18
17
  worker: true,
19
- extensions: ['fgb'],
20
- mimeTypes: ['application/octet-stream'],
21
- category: 'geometry',
22
18
  tests: [new Uint8Array(FGB_MAGIC_NUMBER).buffer],
23
19
  options: {
24
20
  flatgeobuf: {
@@ -0,0 +1,42 @@
1
+ import { Schema, GeoJSONTable } from '@loaders.gl/schema';
2
+ import type { DataSourceOptions, VectorSourceMetadata, GetFeaturesParameters } from '@loaders.gl/loader-utils';
3
+ import { DataSource, VectorSource } from '@loaders.gl/loader-utils';
4
+ export type FlatGeobufSourceOptions = DataSourceOptions & {
5
+ flatgeobuf?: {};
6
+ };
7
+ /**
8
+ * FlatGeobufSource
9
+ * Incrementally load bounding boxes from a spatially indexed FlatGeobuf file
10
+ * @ndeprecated This is a WIP, not fully implemented
11
+ */
12
+ export declare const FlatGeobufSource: {
13
+ readonly version: "0.0.0";
14
+ readonly type: "flatgeobuf-server";
15
+ readonly fromUrl: true;
16
+ readonly fromBlob: false;
17
+ readonly defaultOptions: {
18
+ readonly flatgeobuf: {};
19
+ };
20
+ readonly testURL: (url: string) => boolean;
21
+ readonly createDataSource: (url: string, options: FlatGeobufSourceOptions) => FlatGeobufVectorSource;
22
+ readonly id: "flatgeobuf";
23
+ readonly name: "FlatGeobuf";
24
+ readonly module: "flatgeobuf";
25
+ readonly extensions: ["fgb"];
26
+ readonly mimeTypes: ["application/octet-stream"];
27
+ readonly category: "geometry";
28
+ };
29
+ /**
30
+ * FlatGeobufVectorSource
31
+ */
32
+ export declare class FlatGeobufVectorSource extends DataSource<string, FlatGeobufSourceOptions> implements VectorSource {
33
+ protected formatSpecificMetadata: Promise<any> | null;
34
+ constructor(data: string, options: FlatGeobufSourceOptions);
35
+ /** TODO - not yet clear if we can find schema information in the FeatureServer metadata or if we need to request a feature */
36
+ getSchema(): Promise<Schema>;
37
+ getMetadata(options: {
38
+ formatSpecificMetadata: any;
39
+ }): Promise<VectorSourceMetadata>;
40
+ getFeatures(parameters: GetFeaturesParameters): Promise<GeoJSONTable>;
41
+ }
42
+ //# sourceMappingURL=flatgeobuf-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatgeobuf-source.d.ts","sourceRoot":"","sources":["../src/flatgeobuf-source.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAS,UAAU,EAAE,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAK1E,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG;IACxD,UAAU,CAAC,EAAE,EAAE,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;4BAWZ,MAAM,KAAG,OAAO;qCACP,MAAM,WAAW,uBAAuB,KAAG,sBAAsB;;;;;;;CAExC,CAAC;AAEpD;;GAEG;AACH,qBAAa,sBACX,SAAQ,UAAU,CAAC,MAAM,EAAE,uBAAuB,CAClD,YAAW,YAAY;IAEvB,SAAS,CAAC,sBAAsB,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;gBAEjD,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB;IAK1D,8HAA8H;IACxH,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAK5B,WAAW,CAAC,OAAO,EAAE;QAAC,sBAAsB,MAAA;KAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAgB7E,WAAW,CAAC,UAAU,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC;CAU5E"}
@@ -1,45 +1,33 @@
1
1
  // loaders.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
- import { VectorSource } from '@loaders.gl/loader-utils';
4
+ import { DataSource } from '@loaders.gl/loader-utils';
5
5
  import { FlatGeobufLoader } from "./flatgeobuf-loader.js";
6
+ import { FlatGeobufFormat } from "./flatgeobuf-format.js";
6
7
  /**
8
+ * FlatGeobufSource
9
+ * Incrementally load bounding boxes from a spatially indexed FlatGeobuf file
7
10
  * @ndeprecated This is a WIP, not fully implemented
8
- * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
9
11
  */
10
12
  export const FlatGeobufSource = {
11
- name: 'FlatGeobuf',
12
- id: 'flatgeobuf-server',
13
- module: 'wms',
13
+ ...FlatGeobufFormat,
14
14
  version: '0.0.0',
15
- extensions: [],
16
- mimeTypes: [],
17
- options: {
18
- url: undefined,
19
- 'flatgeobuf-server': {
20
- /** Tabular loaders, normally the GeoJSONLoader */
21
- loaders: []
22
- }
23
- },
24
15
  type: 'flatgeobuf-server',
25
16
  fromUrl: true,
26
17
  fromBlob: false, // TODO check if supported by library?
18
+ defaultOptions: {
19
+ flatgeobuf: {}
20
+ },
27
21
  testURL: (url) => url.toLowerCase().includes('FeatureServer'),
28
- createDataSource: (url, props) => new FlatGeobufVectorSource(props)
22
+ createDataSource: (url, options) => new FlatGeobufVectorSource(url, options)
29
23
  };
30
24
  /**
31
- * ArcGIS ImageServer
32
- * Note - exports a big API, that could be exposed here if there is a use case
33
- * @see https://developers.arcgis.com/rest/services-reference/enterprise/feature-service.htm
25
+ * FlatGeobufVectorSource
34
26
  */
35
- export class FlatGeobufVectorSource extends VectorSource {
36
- data;
37
- url;
27
+ export class FlatGeobufVectorSource extends DataSource {
38
28
  formatSpecificMetadata = null;
39
- constructor(props) {
40
- super(props);
41
- this.data = props.url;
42
- this.url = props.url;
29
+ constructor(data, options) {
30
+ super(data, options, FlatGeobufSource.defaultOptions);
43
31
  // this.formatSpecificMetadata = this._getFormatSpecificMetadata();
44
32
  }
45
33
  /** TODO - not yet clear if we can find schema information in the FeatureServer metadata or if we need to request a feature */
@@ -65,7 +53,7 @@ export class FlatGeobufVectorSource extends VectorSource {
65
53
  const arrayBuffer = await response.arrayBuffer();
66
54
  // TODO - hack - done to avoid pulling in selectLoader from core
67
55
  const table = await FlatGeobufLoader.parse(arrayBuffer, {});
68
- // const loader = this.props['flatgeobuf-server']?.loaders?.[0];
56
+ // const loader = this.options['flatgeobuf-server']?.loaders?.[0];
69
57
  // const table = loader?.parse(arrayBuffer);
70
58
  return table;
71
59
  }