@jupytergis/schema 0.4.5 → 0.6.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.
Files changed (49) hide show
  1. package/lib/_interface/forms.json +99 -32
  2. package/lib/_interface/processing/boundingBoxes.d.ts +16 -0
  3. package/lib/_interface/processing/centroids.d.ts +16 -0
  4. package/lib/_interface/processing/concaveHull.d.ts +23 -0
  5. package/lib/_interface/processing/convexHull.d.ts +16 -0
  6. package/lib/_interface/project/jgis.d.ts +3 -1
  7. package/lib/_interface/project/layers/stacLayer.d.ts +22 -0
  8. package/lib/_interface/project/layers/{vectorlayer.d.ts → vectorLayer.d.ts} +0 -4
  9. package/lib/_interface/project/layers/vectorTileLayer.d.ts +0 -4
  10. package/lib/_interface/project/layers/webGlLayer.d.ts +1 -0
  11. package/lib/_interface/version.d.ts +1 -0
  12. package/lib/_interface/version.js +1 -0
  13. package/lib/doc.js +4 -3
  14. package/lib/index.d.ts +3 -0
  15. package/lib/index.js +3 -0
  16. package/lib/interfaces.d.ts +10 -4
  17. package/lib/model.d.ts +13 -1
  18. package/lib/model.js +37 -9
  19. package/lib/processing/ProcessingMerge.d.ts +15 -0
  20. package/lib/processing/ProcessingMerge.js +9 -0
  21. package/lib/processing/_generated/exportProcessingSchema.d.ts +6 -0
  22. package/lib/processing/_generated/exportProcessingSchema.js +7 -0
  23. package/lib/processing/_generated/processingType.d.ts +2 -0
  24. package/lib/processing/_generated/processingType.js +8 -0
  25. package/lib/processing/_generated/processing_merge.json +75 -0
  26. package/lib/schema/processing/boundingBoxes.json +13 -0
  27. package/lib/schema/processing/centroids.json +13 -0
  28. package/lib/schema/processing/concaveHull.json +26 -0
  29. package/lib/schema/processing/convexHull.json +13 -0
  30. package/lib/schema/project/jgis.json +6 -1
  31. package/lib/schema/project/layers/stacLayer.json +21 -0
  32. package/lib/schema/project/layers/{vectorlayer.json → vectorLayer.json} +1 -7
  33. package/lib/schema/project/layers/vectorTileLayer.json +1 -7
  34. package/lib/schema/project/layers/webGlLayer.json +3 -0
  35. package/lib/types.d.ts +12 -11
  36. package/lib/types.js +12 -11
  37. package/package.json +4 -3
  38. /package/lib/_interface/export/{exportGeojson.d.ts → exportGeoJson.d.ts} +0 -0
  39. /package/lib/_interface/export/{exportGeotiff.d.ts → exportGeoTiff.d.ts} +0 -0
  40. /package/lib/_interface/{geojsonsource.d.ts → geoJsonSource.d.ts} +0 -0
  41. /package/lib/_interface/project/layers/{rasterlayer.d.ts → rasterLayer.d.ts} +0 -0
  42. /package/lib/_interface/project/sources/{rastersource.d.ts → rasterSource.d.ts} +0 -0
  43. /package/lib/_interface/project/sources/{vectortilesource.d.ts → vectorTileSource.d.ts} +0 -0
  44. /package/lib/schema/export/{exportGeojson.json → exportGeoJson.json} +0 -0
  45. /package/lib/schema/export/{exportGeotiff.json → exportGeoTiff.json} +0 -0
  46. /package/lib/schema/{geojsonsource.json → geoJsonSource.json} +0 -0
  47. /package/lib/schema/project/layers/{rasterlayer.json → rasterLayer.json} +0 -0
  48. /package/lib/schema/project/sources/{rastersource.json → rasterSource.json} +0 -0
  49. /package/lib/schema/project/sources/{vectortilesource.json → vectorTileSource.json} +0 -0
@@ -47,6 +47,19 @@
47
47
  }
48
48
  }
49
49
  },
50
+ "BoundingBoxes": {
51
+ "type": "object",
52
+ "required": [
53
+ "inputLayer"
54
+ ],
55
+ "additionalProperties": false,
56
+ "properties": {
57
+ "inputLayer": {
58
+ "type": "string",
59
+ "description": "The input layer for bounding boxes."
60
+ }
61
+ }
62
+ },
50
63
  "Buffer": {
51
64
  "type": "object",
52
65
  "required": [
@@ -71,6 +84,58 @@
71
84
  }
72
85
  }
73
86
  },
87
+ "Centroids": {
88
+ "type": "object",
89
+ "required": [
90
+ "inputLayer"
91
+ ],
92
+ "additionalProperties": false,
93
+ "properties": {
94
+ "inputLayer": {
95
+ "type": "string",
96
+ "description": "The input layer for centroids."
97
+ }
98
+ }
99
+ },
100
+ "ConcaveHull": {
101
+ "type": "object",
102
+ "required": [
103
+ "inputLayer"
104
+ ],
105
+ "additionalProperties": false,
106
+ "properties": {
107
+ "inputLayer": {
108
+ "type": "string",
109
+ "description": "The input layer for Concave Hull."
110
+ },
111
+ "pctconvex": {
112
+ "type": "number",
113
+ "description": "Controls the concaveness of the computed hull, vary from 0 to 1, 0 corresponds to the maximum concavity.",
114
+ "multipleOf": 0.1,
115
+ "minimum": 0,
116
+ "maximum": 1,
117
+ "default": 0.5
118
+ },
119
+ "allowHoles": {
120
+ "type": "boolean",
121
+ "title": "Allow holes in the hull",
122
+ "default": false
123
+ }
124
+ }
125
+ },
126
+ "ConvexHull": {
127
+ "type": "object",
128
+ "required": [
129
+ "inputLayer"
130
+ ],
131
+ "additionalProperties": false,
132
+ "properties": {
133
+ "inputLayer": {
134
+ "type": "string",
135
+ "description": "The input layer for Convex Hull."
136
+ }
137
+ }
138
+ },
74
139
  "Dissolve": {
75
140
  "type": "object",
76
141
  "required": [
@@ -216,35 +281,20 @@
216
281
  }
217
282
  }
218
283
  },
219
- "VectorTileLayer": {
284
+ "StacLayer": {
220
285
  "type": "object",
221
286
  "required": [
222
- "source",
223
- "type"
287
+ "data"
224
288
  ],
225
289
  "additionalProperties": false,
226
290
  "properties": {
227
- "source": {
228
- "type": "string",
229
- "description": "The id of the source"
230
- },
231
- "type": {
232
- "type": "string",
233
- "enum": [
234
- "circle",
235
- "fill",
236
- "line"
237
- ],
238
- "default": "line",
239
- "description": "The type of vector layer"
240
- },
241
- "color": {
291
+ "data": {
242
292
  "type": "object",
243
- "description": "The color of the the object"
293
+ "description": "The data of the source"
244
294
  },
245
295
  "opacity": {
246
296
  "type": "number",
247
- "description": "The opacity of the the object",
297
+ "description": "The opacity of the source",
248
298
  "default": 1,
249
299
  "multipleOf": 0.1,
250
300
  "minimum": 0,
@@ -255,8 +305,7 @@
255
305
  "VectorLayer": {
256
306
  "type": "object",
257
307
  "required": [
258
- "source",
259
- "type"
308
+ "source"
260
309
  ],
261
310
  "additionalProperties": false,
262
311
  "properties": {
@@ -264,16 +313,6 @@
264
313
  "type": "string",
265
314
  "description": "The id of the source"
266
315
  },
267
- "type": {
268
- "type": "string",
269
- "enum": [
270
- "circle",
271
- "fill",
272
- "line"
273
- ],
274
- "default": "line",
275
- "description": "The type of vector layer"
276
- },
277
316
  "color": {
278
317
  "type": "object",
279
318
  "description": "The color of the the object"
@@ -335,6 +374,31 @@
335
374
  }
336
375
  }
337
376
  },
377
+ "VectorTileLayer": {
378
+ "type": "object",
379
+ "required": [
380
+ "source"
381
+ ],
382
+ "additionalProperties": false,
383
+ "properties": {
384
+ "source": {
385
+ "type": "string",
386
+ "description": "The id of the source"
387
+ },
388
+ "color": {
389
+ "type": "object",
390
+ "description": "The color of the the object"
391
+ },
392
+ "opacity": {
393
+ "type": "number",
394
+ "description": "The opacity of the the object",
395
+ "default": 1,
396
+ "multipleOf": 0.1,
397
+ "minimum": 0,
398
+ "maximum": 1
399
+ }
400
+ }
401
+ },
338
402
  "WebGlLayer": {
339
403
  "type": "object",
340
404
  "required": [
@@ -426,6 +490,9 @@
426
490
  "blueBand": {
427
491
  "type": "number"
428
492
  },
493
+ "alphaBand": {
494
+ "type": "number"
495
+ },
429
496
  "interpolation": {
430
497
  "type": "string",
431
498
  "enum": [
@@ -0,0 +1,16 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * BoundingBoxes
10
+ */
11
+ export interface IBoundingBoxes {
12
+ /**
13
+ * The input layer for bounding boxes.
14
+ */
15
+ inputLayer: string;
16
+ }
@@ -0,0 +1,16 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * Centroids
10
+ */
11
+ export interface ICentroids {
12
+ /**
13
+ * The input layer for centroids.
14
+ */
15
+ inputLayer: string;
16
+ }
@@ -0,0 +1,23 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export type AllowHolesInTheHull = boolean;
9
+
10
+ /**
11
+ * ConcaveHull
12
+ */
13
+ export interface IConcaveHull {
14
+ /**
15
+ * The input layer for Concave Hull.
16
+ */
17
+ inputLayer: string;
18
+ /**
19
+ * Controls the concaveness of the computed hull, vary from 0 to 1, 0 corresponds to the maximum concavity.
20
+ */
21
+ pctconvex?: number;
22
+ allowHoles?: AllowHolesInTheHull;
23
+ }
@@ -0,0 +1,16 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * ConvexHull
10
+ */
11
+ export interface IConvexHull {
12
+ /**
13
+ * The input layer for Convex Hull.
14
+ */
15
+ inputLayer: string;
16
+ }
@@ -16,7 +16,8 @@ export type LayerType =
16
16
  | "HillshadeLayer"
17
17
  | "WebGlLayer"
18
18
  | "ImageLayer"
19
- | "HeatmapLayer";
19
+ | "HeatmapLayer"
20
+ | "StacLayer";
20
21
  /**
21
22
  * This interface was referenced by `IJGISContent`'s JSON-Schema
22
23
  * via the `definition` "sourceType".
@@ -42,6 +43,7 @@ export type IJGISLayerItem = string | IJGISLayerGroup;
42
43
  export type IJGISLayerTree = IJGISLayerItem[];
43
44
 
44
45
  export interface IJGISContent {
46
+ schemaVersion?: string;
45
47
  layers: IJGISLayers;
46
48
  sources: IJGISSources;
47
49
  layerTree?: IJGISLayerTree;
@@ -0,0 +1,22 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * StacLayer
10
+ */
11
+ export interface IStacLayer {
12
+ /**
13
+ * The data of the source
14
+ */
15
+ data: {
16
+ [k: string]: any;
17
+ };
18
+ /**
19
+ * The opacity of the source
20
+ */
21
+ opacity?: number;
22
+ }
@@ -13,10 +13,6 @@ export interface IVectorLayer {
13
13
  * The id of the source
14
14
  */
15
15
  source: string;
16
- /**
17
- * The type of vector layer
18
- */
19
- type: "circle" | "fill" | "line";
20
16
  /**
21
17
  * The color of the the object
22
18
  */
@@ -13,10 +13,6 @@ export interface IVectorTileLayer {
13
13
  * The id of the source
14
14
  */
15
15
  source: string;
16
- /**
17
- * The type of vector layer
18
- */
19
- type: "circle" | "fill" | "line";
20
16
  /**
21
17
  * The color of the the object
22
18
  */
@@ -30,6 +30,7 @@ export interface IWebGlLayer {
30
30
  redBand?: number;
31
31
  greenBand?: number;
32
32
  blueBand?: number;
33
+ alphaBand?: number;
33
34
  interpolation?: "discrete" | "linear" | "exact";
34
35
  colorRamp?: string;
35
36
  nClasses?: string;
@@ -0,0 +1 @@
1
+ export declare const SCHEMA_VERSION = '0.5.0';
@@ -0,0 +1 @@
1
+ export const SCHEMA_VERSION = '0.5.0';
package/lib/doc.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { YDocument } from '@jupyter/ydoc';
2
2
  import { JSONExt } from '@lumino/coreutils';
3
3
  import { Signal } from '@lumino/signaling';
4
+ import { SCHEMA_VERSION } from './_interface/version';
4
5
  export class JupyterGISDoc extends YDocument {
5
6
  constructor() {
6
7
  super();
@@ -66,7 +67,7 @@ export class JupyterGISDoc extends YDocument {
66
67
  super.dispose();
67
68
  }
68
69
  get version() {
69
- return '0.1.0';
70
+ return SCHEMA_VERSION;
70
71
  }
71
72
  get layers() {
72
73
  return JSONExt.deepCopy(this._layers.toJSON());
@@ -260,7 +261,7 @@ export class JupyterGISDoc extends YDocument {
260
261
  changes.push({
261
262
  id: key,
262
263
  oldValue: change.oldValue,
263
- newValue: JSONExt.deepCopy(event.target.toJSON()[key])
264
+ newValue: JSONExt.deepCopy(event.target.toJSON()[key]),
264
265
  });
265
266
  });
266
267
  });
@@ -283,7 +284,7 @@ export class JupyterGISDoc extends YDocument {
283
284
  }
284
285
  changes.push({
285
286
  id: key,
286
- newValue: JSONExt.deepCopy(event.target.toJSON()[key])
287
+ newValue: JSONExt.deepCopy(event.target.toJSON()[key]),
287
288
  });
288
289
  });
289
290
  });
package/lib/index.d.ts CHANGED
@@ -2,3 +2,6 @@ export * from './interfaces';
2
2
  export * from './model';
3
3
  export * from './token';
4
4
  export * from './doc';
5
+ export { SCHEMA_VERSION } from './_interface/version';
6
+ export { ProcessingMerge, ProcessingCommandIDs, ProcessingLogicType, } from './processing/ProcessingMerge';
7
+ export * from './processing/_generated/processingType';
package/lib/index.js CHANGED
@@ -2,3 +2,6 @@ export * from './interfaces';
2
2
  export * from './model';
3
3
  export * from './token';
4
4
  export * from './doc';
5
+ export { SCHEMA_VERSION } from './_interface/version';
6
+ export { ProcessingMerge, ProcessingCommandIDs, ProcessingLogicType, } from './processing/ProcessingMerge';
7
+ export * from './processing/_generated/processingType';
@@ -8,8 +8,8 @@ import { JSONObject } from '@lumino/coreutils';
8
8
  import { ISignal, Signal } from '@lumino/signaling';
9
9
  import { SplitPanel } from '@lumino/widgets';
10
10
  import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerItem, IJGISLayers, IJGISLayerTree, IJGISOptions, IJGISSource, IJGISSources, SourceType } from './_interface/project/jgis';
11
- import { IRasterSource } from './_interface/project/sources/rastersource';
12
- export { IGeoJSONSource } from './_interface/geojsonsource';
11
+ import { IRasterSource } from './_interface/project/sources/rasterSource';
12
+ export { IGeoJSONSource } from './_interface/geoJsonSource';
13
13
  export type JgisCoordinates = {
14
14
  x: number;
15
15
  y: number;
@@ -104,8 +104,8 @@ export interface IJupyterGISDoc extends YDocument<IJupyterGISDocChange> {
104
104
  getObject(id: string): IJGISLayer | IJGISSource | undefined;
105
105
  getOption(key: keyof IJGISOptions): IDict | undefined;
106
106
  setOption(key: keyof IJGISOptions, value: IDict): void;
107
- getMetadata(key: string): string | undefined;
108
- setMetadata(key: string, value: string): void;
107
+ getMetadata(key: string): string | IAnnotation | undefined;
108
+ setMetadata(key: string, value: string | IAnnotation): void;
109
109
  removeMetadata(key: string): void;
110
110
  optionsChanged: ISignal<IJupyterGISDoc, MapChange>;
111
111
  layersChanged: ISignal<IJupyterGISDoc, IJGISLayerDocChange>;
@@ -144,8 +144,11 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
144
144
  geolocationChanged: Signal<IJupyterGISModel, JgisCoordinates>;
145
145
  flyToGeometrySignal: Signal<IJupyterGISModel, any>;
146
146
  highlightFeatureSignal: Signal<IJupyterGISModel, any>;
147
+ updateBboxSignal: Signal<IJupyterGISModel, any>;
147
148
  contentsManager: Contents.IManager | undefined;
148
149
  filePath: string;
150
+ pathChanged: ISignal<IJupyterGISModel, string>;
151
+ getSettings(): IJupyterGISSettings;
149
152
  getContent(): IJGISContent;
150
153
  getLayers(): IJGISLayers;
151
154
  getLayer(id: string): IJGISLayer | undefined;
@@ -279,3 +282,6 @@ export interface IAnnotation {
279
282
  parent: string;
280
283
  open: boolean;
281
284
  }
285
+ export interface IJupyterGISSettings {
286
+ proxyUrl: string;
287
+ }
package/lib/model.d.ts CHANGED
@@ -2,18 +2,25 @@ import { MapChange } from '@jupyter/ydoc';
2
2
  import { IChangedArgs } from '@jupyterlab/coreutils';
3
3
  import { DocumentRegistry } from '@jupyterlab/docregistry';
4
4
  import { Contents } from '@jupyterlab/services';
5
+ import { ISettingRegistry } from '@jupyterlab/settingregistry';
5
6
  import { PartialJSONObject } from '@lumino/coreutils';
6
7
  import { ISignal, Signal } from '@lumino/signaling';
7
8
  import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerTree, IJGISLayers, IJGISOptions, IJGISSource, IJGISSources } from './_interface/project/jgis';
8
- import { IAnnotationModel, IDict, IJGISLayerDocChange, IJGISLayerTreeDocChange, IJGISSourceDocChange, IJupyterGISClientState, IJupyterGISDoc, IJupyterGISModel, ISelection, IUserData, IViewPortState, JgisCoordinates, Pointer } from './interfaces';
9
+ import { IAnnotationModel, IDict, IJGISLayerDocChange, IJGISLayerTreeDocChange, IJGISSourceDocChange, IJupyterGISClientState, IJupyterGISDoc, IJupyterGISModel, ISelection, IUserData, IViewPortState, JgisCoordinates, Pointer, IJupyterGISSettings } from './interfaces';
9
10
  export declare class JupyterGISModel implements IJupyterGISModel {
10
11
  constructor(options: JupyterGISModel.IOptions);
12
+ /**
13
+ * Initialize custom settings for JupyterLab.
14
+ */
15
+ initSettings(): Promise<void>;
16
+ getSettings(): IJupyterGISSettings;
11
17
  private _onSharedModelChanged;
12
18
  readonly collaborative: boolean;
13
19
  get sharedModel(): IJupyterGISDoc;
14
20
  get isDisposed(): boolean;
15
21
  get contentChanged(): ISignal<this, void>;
16
22
  get stateChanged(): ISignal<this, IChangedArgs<any, any, string>>;
23
+ get pathChanged(): ISignal<IJupyterGISModel, string>;
17
24
  get themeChanged(): Signal<this, IChangedArgs<string, string | null, string>>;
18
25
  get currentUserId(): number | undefined;
19
26
  get users(): IUserData[];
@@ -48,6 +55,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
48
55
  getWorker(): Worker;
49
56
  readonly flyToGeometrySignal: Signal<this, any>;
50
57
  readonly highlightFeatureSignal: Signal<this, any>;
58
+ readonly updateBboxSignal: Signal<this, any>;
51
59
  getContent(): IJGISContent;
52
60
  /**
53
61
  * Getter for the contents manager.
@@ -151,6 +159,8 @@ export declare class JupyterGISModel implements IJupyterGISModel {
151
159
  readonly defaultKernelName: string;
152
160
  readonly defaultKernelLanguage: string;
153
161
  readonly annotationModel?: IAnnotationModel;
162
+ readonly settingRegistry?: ISettingRegistry;
163
+ private _settings;
154
164
  private _sharedModel;
155
165
  private _filePath;
156
166
  private _contentsManager?;
@@ -159,6 +169,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
159
169
  private _isDisposed;
160
170
  private _userChanged;
161
171
  private _usersMap?;
172
+ private _pathChanged;
162
173
  private _disposed;
163
174
  private _contentChanged;
164
175
  private _stateChanged;
@@ -181,5 +192,6 @@ export declare namespace JupyterGISModel {
181
192
  function getOrderedLayerIds(model: IJupyterGISModel): string[];
182
193
  interface IOptions extends DocumentRegistry.IModelOptions<IJupyterGISDoc> {
183
194
  annotationModel?: IAnnotationModel;
195
+ settingRegistry?: ISettingRegistry;
184
196
  }
185
197
  }
package/lib/model.js CHANGED
@@ -2,6 +2,7 @@ import { Signal } from '@lumino/signaling';
2
2
  import Ajv from 'ajv';
3
3
  import { JupyterGISDoc } from './doc';
4
4
  import jgisSchema from './schema/project/jgis.json';
5
+ const SETTINGS_ID = '@jupytergis/jupytergis-core:jupytergis-settings';
5
6
  export class JupyterGISModel {
6
7
  constructor(options) {
7
8
  this._onSharedModelChanged = (sender, changes) => {
@@ -14,6 +15,7 @@ export class JupyterGISModel {
14
15
  this.collaborative = document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;
15
16
  this.flyToGeometrySignal = new Signal(this);
16
17
  this.highlightFeatureSignal = new Signal(this);
18
+ this.updateBboxSignal = new Signal(this);
17
19
  this._onClientStateChanged = (changed) => {
18
20
  const clients = this.sharedModel.awareness.getStates();
19
21
  this._clientStateChanged.emit(clients);
@@ -45,7 +47,7 @@ export class JupyterGISModel {
45
47
  this._isIdentifying = false;
46
48
  this._isTemporalControllerActive = false;
47
49
  this._geolocationChanged = new Signal(this);
48
- const { annotationModel, sharedModel } = options;
50
+ const { annotationModel, sharedModel, settingRegistry } = options;
49
51
  if (sharedModel) {
50
52
  this._sharedModel = sharedModel;
51
53
  }
@@ -56,6 +58,24 @@ export class JupyterGISModel {
56
58
  this.sharedModel.awareness.on('change', this._onClientStateChanged);
57
59
  this._sharedModel.metadataChanged.connect(this._metadataChangedHandler, this);
58
60
  this.annotationModel = annotationModel;
61
+ this.settingRegistry = settingRegistry;
62
+ this._pathChanged = new Signal(this);
63
+ }
64
+ /**
65
+ * Initialize custom settings for JupyterLab.
66
+ */
67
+ async initSettings() {
68
+ if (this.settingRegistry) {
69
+ const setting = await this.settingRegistry.load(SETTINGS_ID);
70
+ this._settings = setting.composite;
71
+ setting.changed.connect(() => {
72
+ this._settings = setting.composite;
73
+ console.log('JupyterGIS Settings updated:', this._settings);
74
+ });
75
+ }
76
+ }
77
+ getSettings() {
78
+ return this._settings;
59
79
  }
60
80
  get sharedModel() {
61
81
  return this._sharedModel;
@@ -69,6 +89,9 @@ export class JupyterGISModel {
69
89
  get stateChanged() {
70
90
  return this._stateChanged;
71
91
  }
92
+ get pathChanged() {
93
+ return this._pathChanged;
94
+ }
72
95
  get themeChanged() {
73
96
  return this._themeChanged;
74
97
  }
@@ -188,7 +211,7 @@ export class JupyterGISModel {
188
211
  zoom: 0,
189
212
  bearing: 0,
190
213
  pitch: 0,
191
- projection: 'EPSG:3857'
214
+ projection: 'EPSG:3857',
192
215
  };
193
216
  this.sharedModel.metadata = (_e = jsonData.metadata) !== null && _e !== void 0 ? _e : {};
194
217
  });
@@ -212,7 +235,7 @@ export class JupyterGISModel {
212
235
  layers: this.sharedModel.layers,
213
236
  layerTree: this.sharedModel.layerTree,
214
237
  options: this.sharedModel.options,
215
- metadata: this.sharedModel.metadata
238
+ metadata: this.sharedModel.metadata,
216
239
  };
217
240
  }
218
241
  /**
@@ -239,6 +262,7 @@ export class JupyterGISModel {
239
262
  */
240
263
  set filePath(path) {
241
264
  this._filePath = path;
265
+ this._pathChanged.emit(path);
242
266
  }
243
267
  getLayers() {
244
268
  return this.sharedModel.layers;
@@ -302,7 +326,7 @@ export class JupyterGISModel {
302
326
  }
303
327
  const item = {
304
328
  name,
305
- layers: []
329
+ layers: [],
306
330
  };
307
331
  this._addLayerTreeItem(item, groupName, position);
308
332
  }
@@ -323,8 +347,12 @@ export class JupyterGISModel {
323
347
  this._addLayerTreeItem(id, groupName, position);
324
348
  }
325
349
  removeLayer(layer_id) {
350
+ var _a;
351
+ const layer = this._sharedModel.getLayer(layer_id);
352
+ const source_id = (_a = layer === null || layer === void 0 ? void 0 : layer.parameters) === null || _a === void 0 ? void 0 : _a.source;
326
353
  this._removeLayerTreeLayer(this.getLayerTree(), layer_id);
327
354
  this.sharedModel.removeLayer(layer_id);
355
+ this.sharedModel.removeSource(source_id);
328
356
  }
329
357
  setOptions(value) {
330
358
  this._sharedModel.options = value;
@@ -335,25 +363,25 @@ export class JupyterGISModel {
335
363
  syncViewport(viewport, emitter) {
336
364
  this.sharedModel.awareness.setLocalStateField('viewportState', {
337
365
  value: viewport,
338
- emitter
366
+ emitter,
339
367
  });
340
368
  }
341
369
  syncPointer(pointer, emitter) {
342
370
  this.sharedModel.awareness.setLocalStateField('pointer', {
343
371
  value: pointer,
344
- emitter
372
+ emitter,
345
373
  });
346
374
  }
347
375
  syncSelected(value, emitter) {
348
376
  this.sharedModel.awareness.setLocalStateField('selected', {
349
377
  value,
350
- emitter
378
+ emitter,
351
379
  });
352
380
  }
353
381
  syncIdentifiedFeatures(features, emitter) {
354
382
  this.sharedModel.awareness.setLocalStateField('identifiedFeatures', {
355
383
  value: features,
356
- emitter
384
+ emitter,
357
385
  });
358
386
  }
359
387
  setUserToFollow(userId) {
@@ -534,7 +562,7 @@ export class JupyterGISModel {
534
562
  return {
535
563
  mainGroup,
536
564
  workingGroup,
537
- mainGroupIndex
565
+ mainGroupIndex,
538
566
  };
539
567
  }
540
568
  get addFeatureAsMsSignal() {
@@ -0,0 +1,15 @@
1
+ import { IDict } from '../interfaces';
2
+ type ProcessingElement = {
3
+ description: string;
4
+ name: string;
5
+ operationParams: string[];
6
+ label: string;
7
+ type: string;
8
+ operations: any;
9
+ };
10
+ export declare const ProcessingLogicType: {
11
+ vector: string;
12
+ };
13
+ export declare const ProcessingMerge: ProcessingElement[];
14
+ export declare const ProcessingCommandIDs: IDict;
15
+ export {};
@@ -0,0 +1,9 @@
1
+ import _ProcessingMerge from './_generated/processing_merge.json';
2
+ export const ProcessingLogicType = {
3
+ vector: 'vector',
4
+ };
5
+ export const ProcessingMerge = _ProcessingMerge;
6
+ export const ProcessingCommandIDs = {};
7
+ for (const e of ProcessingMerge) {
8
+ ProcessingCommandIDs[e.name] = `jupytergis:${e.name}`;
9
+ }
@@ -0,0 +1,6 @@
1
+ export * from '../../_interface/processing/buffer';
2
+ export * from '../../_interface/processing/dissolve';
3
+ export * from '../../_interface/processing/centroids';
4
+ export * from '../../_interface/processing/convexHull';
5
+ export * from '../../_interface/processing/concaveHull';
6
+ export * from '../../_interface/processing/boundingBoxes';
@@ -0,0 +1,7 @@
1
+ //Generated automatically please don't modify directly
2
+ export * from '../../_interface/processing/buffer';
3
+ export * from '../../_interface/processing/dissolve';
4
+ export * from '../../_interface/processing/centroids';
5
+ export * from '../../_interface/processing/convexHull';
6
+ export * from '../../_interface/processing/concaveHull';
7
+ export * from '../../_interface/processing/boundingBoxes';
@@ -0,0 +1,2 @@
1
+ export type ProcessingType = 'Buffer' | 'Dissolve' | 'Centroids' | 'ConvexHull' | 'ConcaveHull' | 'BoundingBoxes';
2
+ export declare const processingList: string[];
@@ -0,0 +1,8 @@
1
+ export const processingList = [
2
+ 'Buffer',
3
+ 'Dissolve',
4
+ 'Centroids',
5
+ 'ConvexHull',
6
+ 'ConcaveHull',
7
+ 'BoundingBoxes',
8
+ ];
@@ -0,0 +1,75 @@
1
+ [
2
+ {
3
+ "description": "Buffer",
4
+ "name": "buffer",
5
+ "label": "Buffer",
6
+ "operationParams": [
7
+ "bufferDistance"
8
+ ],
9
+ "operations": {
10
+ "gdalFunction": "ogr2ogr",
11
+ "sql": "SELECT ST_Union(ST_Buffer(geometry, {bufferDistance})) AS geometry, * FROM \"{layerName}\""
12
+ },
13
+ "type": "vector"
14
+ },
15
+ {
16
+ "description": "Dissolve",
17
+ "name": "dissolve",
18
+ "operationParams": [
19
+ "dissolveField"
20
+ ],
21
+ "label": "Dissolve",
22
+ "operations": {
23
+ "gdalFunction": "ogr2ogr",
24
+ "sql": "SELECT ST_Union(geometry) AS geometry, {dissolveField} FROM \"{layerName}\" GROUP BY {dissolveField}"
25
+ },
26
+ "type": "vector"
27
+ },
28
+ {
29
+ "description": "Centroids",
30
+ "name": "centroids",
31
+ "operationParams": [],
32
+ "label": "Centroids",
33
+ "operations": {
34
+ "gdalFunction": "ogr2ogr",
35
+ "sql": "SELECT ST_Centroid(geometry) AS geometry, * FROM \"{layerName}\""
36
+ },
37
+ "type": "vector"
38
+ },
39
+ {
40
+ "description": "ConvexHull",
41
+ "name": "convexHull",
42
+ "operationParams": [],
43
+ "label": "Convex Hull",
44
+ "operations": {
45
+ "sql": "SELECT ST_ConvexHull(geometry) AS geometry, * FROM \"{layerName}\"",
46
+ "gdalFunction": "ogr2ogr"
47
+ },
48
+ "type": "vector"
49
+ },
50
+ {
51
+ "description": "ConcaveHull",
52
+ "name": "concaveHull",
53
+ "operationParams": [
54
+ "pctconvex",
55
+ "allowHoles"
56
+ ],
57
+ "label": "Concave Hull",
58
+ "operations": {
59
+ "sql": "SELECT ST_ConcaveHull(geometry,{pctconvex},{allowHoles}) AS geometry, * FROM \"{layerName}\"",
60
+ "gdalFunction": "ogr2ogr"
61
+ },
62
+ "type": "vector"
63
+ },
64
+ {
65
+ "description": "BoundingBoxes",
66
+ "name": "boundingBoxes",
67
+ "operationParams": [],
68
+ "label": "Bounding Boxes",
69
+ "operations": {
70
+ "sql": "SELECT ST_Envelope(geometry) AS geometry, * FROM \"{layerName}\"",
71
+ "gdalFunction": "ogr2ogr"
72
+ },
73
+ "type": "vector"
74
+ }
75
+ ]
@@ -0,0 +1,13 @@
1
+ {
2
+ "type": "object",
3
+ "description": "BoundingBoxes",
4
+ "title": "IBoundingBoxes",
5
+ "required": ["inputLayer"],
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "inputLayer": {
9
+ "type": "string",
10
+ "description": "The input layer for bounding boxes."
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "type": "object",
3
+ "description": "Centroids",
4
+ "title": "ICentroids",
5
+ "required": ["inputLayer"],
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "inputLayer": {
9
+ "type": "string",
10
+ "description": "The input layer for centroids."
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "type": "object",
3
+ "description": "ConcaveHull",
4
+ "title": "IConcaveHull",
5
+ "required": ["inputLayer"],
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "inputLayer": {
9
+ "type": "string",
10
+ "description": "The input layer for Concave Hull."
11
+ },
12
+ "pctconvex": {
13
+ "type": "number",
14
+ "description": "Controls the concaveness of the computed hull, vary from 0 to 1, 0 corresponds to the maximum concavity.",
15
+ "multipleOf": 0.1,
16
+ "minimum": 0,
17
+ "maximum": 1,
18
+ "default": 0.5
19
+ },
20
+ "allowHoles": {
21
+ "type": "boolean",
22
+ "title": "Allow holes in the hull",
23
+ "default": false
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "type": "object",
3
+ "description": "ConvexHull",
4
+ "title": "IConvexHull",
5
+ "required": ["inputLayer"],
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "inputLayer": {
9
+ "type": "string",
10
+ "description": "The input layer for Convex Hull."
11
+ }
12
+ }
13
+ }
@@ -4,6 +4,10 @@
4
4
  "required": ["layers", "sources"],
5
5
  "additionalProperties": false,
6
6
  "properties": {
7
+ "schemaVersion": {
8
+ "type": "string",
9
+ "default": "0.5.0"
10
+ },
7
11
  "layers": {
8
12
  "$ref": "#/definitions/jGISLayers"
9
13
  },
@@ -36,7 +40,8 @@
36
40
  "HillshadeLayer",
37
41
  "WebGlLayer",
38
42
  "ImageLayer",
39
- "HeatmapLayer"
43
+ "HeatmapLayer",
44
+ "StacLayer"
40
45
  ]
41
46
  },
42
47
  "sourceType": {
@@ -0,0 +1,21 @@
1
+ {
2
+ "type": "object",
3
+ "description": "StacLayer",
4
+ "title": "IStacLayer",
5
+ "required": ["data"],
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "data": {
9
+ "type": "object",
10
+ "description": "The data of the source"
11
+ },
12
+ "opacity": {
13
+ "type": "number",
14
+ "description": "The opacity of the source",
15
+ "default": 1,
16
+ "multipleOf": 0.1,
17
+ "minimum": 0,
18
+ "maximum": 1
19
+ }
20
+ }
21
+ }
@@ -2,19 +2,13 @@
2
2
  "type": "object",
3
3
  "description": "VectorLayer",
4
4
  "title": "IVectorLayer",
5
- "required": ["source", "type"],
5
+ "required": ["source"],
6
6
  "additionalProperties": false,
7
7
  "properties": {
8
8
  "source": {
9
9
  "type": "string",
10
10
  "description": "The id of the source"
11
11
  },
12
- "type": {
13
- "type": "string",
14
- "enum": ["circle", "fill", "line"],
15
- "default": "line",
16
- "description": "The type of vector layer"
17
- },
18
12
  "color": {
19
13
  "type": "object",
20
14
  "description": "The color of the the object"
@@ -2,19 +2,13 @@
2
2
  "type": "object",
3
3
  "description": "VectorTileLayer",
4
4
  "title": "IVectorTileLayer",
5
- "required": ["source", "type"],
5
+ "required": ["source"],
6
6
  "additionalProperties": false,
7
7
  "properties": {
8
8
  "source": {
9
9
  "type": "string",
10
10
  "description": "The id of the source"
11
11
  },
12
- "type": {
13
- "type": "string",
14
- "enum": ["circle", "fill", "line"],
15
- "default": "line",
16
- "description": "The type of vector layer"
17
- },
18
12
  "color": {
19
13
  "type": "object",
20
14
  "description": "The color of the the object"
@@ -68,6 +68,9 @@
68
68
  "blueBand": {
69
69
  "type": "number"
70
70
  },
71
+ "alphaBand": {
72
+ "type": "number"
73
+ },
71
74
  "interpolation": {
72
75
  "type": "string",
73
76
  "enum": ["discrete", "linear", "exact"]
package/lib/types.d.ts CHANGED
@@ -1,24 +1,25 @@
1
1
  export * from './_interface/project/jgis';
2
+ export * from './_interface/geoJsonSource';
2
3
  export * from './_interface/project/sources/geoTiffSource';
3
- export * from './_interface/geojsonsource';
4
4
  export * from './_interface/project/sources/imageSource';
5
5
  export * from './_interface/project/sources/rasterDemSource';
6
- export * from './_interface/project/sources/rastersource';
6
+ export * from './_interface/project/sources/rasterSource';
7
7
  export * from './_interface/project/sources/shapefileSource';
8
- export * from './_interface/project/sources/vectortilesource';
8
+ export * from './_interface/project/sources/vectorTileSource';
9
9
  export * from './_interface/project/sources/videoSource';
10
+ export * from './_interface/project/layers/heatmapLayer';
10
11
  export * from './_interface/project/layers/hillshadeLayer';
11
- export * from './_interface/project/layers/rasterlayer';
12
- export * from './_interface/project/layers/vectorlayer';
12
+ export * from './_interface/project/layers/rasterLayer';
13
+ export * from './_interface/project/layers/vectorLayer';
14
+ export * from './_interface/project/layers/imageLayer';
15
+ export * from './_interface/project/layers/stacLayer';
13
16
  export * from './_interface/project/layers/vectorTileLayer';
14
17
  export * from './_interface/project/layers/webGlLayer';
15
- export * from './_interface/project/layers/imageLayer';
16
- export * from './_interface/project/layers/heatmapLayer';
17
- export * from './_interface/processing/buffer';
18
- export * from './_interface/processing/dissolve';
19
- export * from './_interface/export/exportGeojson';
20
- export * from './_interface/export/exportGeotiff';
18
+ export * from './processing/_generated/exportProcessingSchema';
19
+ export * from './_interface/export/exportGeoJson';
20
+ export * from './_interface/export/exportGeoTiff';
21
21
  export * from './doc';
22
+ export * from './index';
22
23
  export * from './interfaces';
23
24
  export * from './model';
24
25
  export * from './token';
package/lib/types.js CHANGED
@@ -1,29 +1,30 @@
1
1
  export * from './_interface/project/jgis';
2
2
  // Sources
3
+ export * from './_interface/geoJsonSource';
3
4
  export * from './_interface/project/sources/geoTiffSource';
4
- export * from './_interface/geojsonsource';
5
5
  export * from './_interface/project/sources/imageSource';
6
6
  export * from './_interface/project/sources/rasterDemSource';
7
- export * from './_interface/project/sources/rastersource';
7
+ export * from './_interface/project/sources/rasterSource';
8
8
  export * from './_interface/project/sources/shapefileSource';
9
- export * from './_interface/project/sources/vectortilesource';
9
+ export * from './_interface/project/sources/vectorTileSource';
10
10
  export * from './_interface/project/sources/videoSource';
11
11
  // Layers
12
+ export * from './_interface/project/layers/heatmapLayer';
12
13
  export * from './_interface/project/layers/hillshadeLayer';
13
- export * from './_interface/project/layers/rasterlayer';
14
- export * from './_interface/project/layers/vectorlayer';
14
+ export * from './_interface/project/layers/rasterLayer';
15
+ export * from './_interface/project/layers/vectorLayer';
16
+ export * from './_interface/project/layers/imageLayer';
17
+ export * from './_interface/project/layers/stacLayer';
15
18
  export * from './_interface/project/layers/vectorTileLayer';
16
19
  export * from './_interface/project/layers/webGlLayer';
17
- export * from './_interface/project/layers/imageLayer';
18
- export * from './_interface/project/layers/heatmapLayer';
19
20
  // Processing
20
- export * from './_interface/processing/buffer';
21
- export * from './_interface/processing/dissolve';
21
+ export * from './processing/_generated/exportProcessingSchema';
22
22
  // exportLayer
23
- export * from './_interface/export/exportGeojson';
24
- export * from './_interface/export/exportGeotiff';
23
+ export * from './_interface/export/exportGeoJson';
24
+ export * from './_interface/export/exportGeoTiff';
25
25
  // Other
26
26
  export * from './doc';
27
+ export * from './index';
27
28
  export * from './interfaces';
28
29
  export * from './model';
29
30
  export * from './token';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupytergis/schema",
3
- "version": "0.4.5",
3
+ "version": "0.6.0",
4
4
  "description": "A JupyterGIS schema package.",
5
5
  "keywords": [
6
6
  "jupytergis"
@@ -26,9 +26,10 @@
26
26
  },
27
27
  "scripts": {
28
28
  "build": "jlpm build:schema && jlpm build:lib",
29
- "build:schema": "node ./cacheGeoJSONSchema.js && jlpm build:schema:js && jlpm build:schema:py",
29
+ "build:schema": "jlpm run build:processing && node ./cacheGeoJSONSchema.js && jlpm build:schema:js && jlpm build:schema:py",
30
+ "build:processing": "python scripts/process.py",
30
31
  "build:schema:js": "json2ts -i src/schema -o src/_interface --no-unknownAny --unreachableDefinitions --cwd ./src/schema && cd src/schema && node ../../schema.js",
31
- "build:schema:py": "datamodel-codegen --input ./src/schema --output ../../python/jupytergis_lab/jupytergis_lab/notebook/objects/_schema --output-model-type pydantic_v2.BaseModel --input-file-type jsonschema",
32
+ "build:schema:py": "datamodel-codegen --input ./src/schema --output ../../python/jupytergis_core/jupytergis_core/schema/interfaces --output-model-type pydantic_v2.BaseModel --input-file-type jsonschema",
32
33
  "build:prod": "jlpm run clean && jlpm build:schema && jlpm run build:lib",
33
34
  "build:lib": "tsc -b",
34
35
  "build:dev": "jlpm run build",