@jupytergis/schema 0.5.0 → 0.6.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.
Files changed (47) 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 +2 -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/doc.js +2 -2
  12. package/lib/index.d.ts +2 -0
  13. package/lib/index.js +2 -0
  14. package/lib/interfaces.d.ts +6 -4
  15. package/lib/model.d.ts +4 -1
  16. package/lib/model.js +14 -8
  17. package/lib/processing/ProcessingMerge.d.ts +15 -0
  18. package/lib/processing/ProcessingMerge.js +9 -0
  19. package/lib/processing/_generated/exportProcessingSchema.d.ts +6 -0
  20. package/lib/processing/_generated/exportProcessingSchema.js +7 -0
  21. package/lib/processing/_generated/processingType.d.ts +2 -0
  22. package/lib/processing/_generated/processingType.js +8 -0
  23. package/lib/processing/_generated/processing_merge.json +75 -0
  24. package/lib/schema/processing/boundingBoxes.json +13 -0
  25. package/lib/schema/processing/centroids.json +13 -0
  26. package/lib/schema/processing/concaveHull.json +26 -0
  27. package/lib/schema/processing/convexHull.json +13 -0
  28. package/lib/schema/project/jgis.json +2 -1
  29. package/lib/schema/project/layers/stacLayer.json +21 -0
  30. package/lib/schema/project/layers/{vectorlayer.json → vectorLayer.json} +1 -7
  31. package/lib/schema/project/layers/vectorTileLayer.json +1 -7
  32. package/lib/schema/project/layers/webGlLayer.json +3 -0
  33. package/lib/types.d.ts +12 -12
  34. package/lib/types.js +12 -12
  35. package/package.json +6 -4
  36. /package/lib/_interface/export/{exportGeojson.d.ts → exportGeoJson.d.ts} +0 -0
  37. /package/lib/_interface/export/{exportGeotiff.d.ts → exportGeoTiff.d.ts} +0 -0
  38. /package/lib/_interface/project/layers/{rasterlayer.d.ts → rasterLayer.d.ts} +0 -0
  39. /package/lib/_interface/{geojsonsource.d.ts → project/sources/geoJsonSource.d.ts} +0 -0
  40. /package/lib/_interface/project/sources/{rastersource.d.ts → rasterSource.d.ts} +0 -0
  41. /package/lib/_interface/project/sources/{vectortilesource.d.ts → vectorTileSource.d.ts} +0 -0
  42. /package/lib/schema/export/{exportGeojson.json → exportGeoJson.json} +0 -0
  43. /package/lib/schema/export/{exportGeotiff.json → exportGeoTiff.json} +0 -0
  44. /package/lib/schema/project/layers/{rasterlayer.json → rasterLayer.json} +0 -0
  45. /package/lib/schema/{geojsonsource.json → project/sources/geoJsonSource.json} +0 -0
  46. /package/lib/schema/project/sources/{rastersource.json → rasterSource.json} +0 -0
  47. /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".
@@ -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;
package/lib/doc.js CHANGED
@@ -261,7 +261,7 @@ export class JupyterGISDoc extends YDocument {
261
261
  changes.push({
262
262
  id: key,
263
263
  oldValue: change.oldValue,
264
- newValue: JSONExt.deepCopy(event.target.toJSON()[key])
264
+ newValue: JSONExt.deepCopy(event.target.toJSON()[key]),
265
265
  });
266
266
  });
267
267
  });
@@ -284,7 +284,7 @@ export class JupyterGISDoc extends YDocument {
284
284
  }
285
285
  changes.push({
286
286
  id: key,
287
- newValue: JSONExt.deepCopy(event.target.toJSON()[key])
287
+ newValue: JSONExt.deepCopy(event.target.toJSON()[key]),
288
288
  });
289
289
  });
290
290
  });
package/lib/index.d.ts CHANGED
@@ -3,3 +3,5 @@ export * from './model';
3
3
  export * from './token';
4
4
  export * from './doc';
5
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
@@ -3,3 +3,5 @@ export * from './model';
3
3
  export * from './token';
4
4
  export * from './doc';
5
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/project/sources/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,10 @@ 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>;
149
151
  getSettings(): IJupyterGISSettings;
150
152
  getContent(): IJGISContent;
151
153
  getLayers(): IJGISLayers;
package/lib/model.d.ts CHANGED
@@ -2,11 +2,11 @@ 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
9
  import { IAnnotationModel, IDict, IJGISLayerDocChange, IJGISLayerTreeDocChange, IJGISSourceDocChange, IJupyterGISClientState, IJupyterGISDoc, IJupyterGISModel, ISelection, IUserData, IViewPortState, JgisCoordinates, Pointer, IJupyterGISSettings } from './interfaces';
9
- import { ISettingRegistry } from '@jupyterlab/settingregistry';
10
10
  export declare class JupyterGISModel implements IJupyterGISModel {
11
11
  constructor(options: JupyterGISModel.IOptions);
12
12
  /**
@@ -20,6 +20,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
20
20
  get isDisposed(): boolean;
21
21
  get contentChanged(): ISignal<this, void>;
22
22
  get stateChanged(): ISignal<this, IChangedArgs<any, any, string>>;
23
+ get pathChanged(): ISignal<IJupyterGISModel, string>;
23
24
  get themeChanged(): Signal<this, IChangedArgs<string, string | null, string>>;
24
25
  get currentUserId(): number | undefined;
25
26
  get users(): IUserData[];
@@ -54,6 +55,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
54
55
  getWorker(): Worker;
55
56
  readonly flyToGeometrySignal: Signal<this, any>;
56
57
  readonly highlightFeatureSignal: Signal<this, any>;
58
+ readonly updateBboxSignal: Signal<this, any>;
57
59
  getContent(): IJGISContent;
58
60
  /**
59
61
  * Getter for the contents manager.
@@ -167,6 +169,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
167
169
  private _isDisposed;
168
170
  private _userChanged;
169
171
  private _usersMap?;
172
+ private _pathChanged;
170
173
  private _disposed;
171
174
  private _contentChanged;
172
175
  private _stateChanged;
package/lib/model.js CHANGED
@@ -15,6 +15,7 @@ export class JupyterGISModel {
15
15
  this.collaborative = document.querySelectorAll('[data-jupyter-lite-root]')[0] === undefined;
16
16
  this.flyToGeometrySignal = new Signal(this);
17
17
  this.highlightFeatureSignal = new Signal(this);
18
+ this.updateBboxSignal = new Signal(this);
18
19
  this._onClientStateChanged = (changed) => {
19
20
  const clients = this.sharedModel.awareness.getStates();
20
21
  this._clientStateChanged.emit(clients);
@@ -58,6 +59,7 @@ export class JupyterGISModel {
58
59
  this._sharedModel.metadataChanged.connect(this._metadataChangedHandler, this);
59
60
  this.annotationModel = annotationModel;
60
61
  this.settingRegistry = settingRegistry;
62
+ this._pathChanged = new Signal(this);
61
63
  }
62
64
  /**
63
65
  * Initialize custom settings for JupyterLab.
@@ -87,6 +89,9 @@ export class JupyterGISModel {
87
89
  get stateChanged() {
88
90
  return this._stateChanged;
89
91
  }
92
+ get pathChanged() {
93
+ return this._pathChanged;
94
+ }
90
95
  get themeChanged() {
91
96
  return this._themeChanged;
92
97
  }
@@ -206,7 +211,7 @@ export class JupyterGISModel {
206
211
  zoom: 0,
207
212
  bearing: 0,
208
213
  pitch: 0,
209
- projection: 'EPSG:3857'
214
+ projection: 'EPSG:3857',
210
215
  };
211
216
  this.sharedModel.metadata = (_e = jsonData.metadata) !== null && _e !== void 0 ? _e : {};
212
217
  });
@@ -230,7 +235,7 @@ export class JupyterGISModel {
230
235
  layers: this.sharedModel.layers,
231
236
  layerTree: this.sharedModel.layerTree,
232
237
  options: this.sharedModel.options,
233
- metadata: this.sharedModel.metadata
238
+ metadata: this.sharedModel.metadata,
234
239
  };
235
240
  }
236
241
  /**
@@ -257,6 +262,7 @@ export class JupyterGISModel {
257
262
  */
258
263
  set filePath(path) {
259
264
  this._filePath = path;
265
+ this._pathChanged.emit(path);
260
266
  }
261
267
  getLayers() {
262
268
  return this.sharedModel.layers;
@@ -320,7 +326,7 @@ export class JupyterGISModel {
320
326
  }
321
327
  const item = {
322
328
  name,
323
- layers: []
329
+ layers: [],
324
330
  };
325
331
  this._addLayerTreeItem(item, groupName, position);
326
332
  }
@@ -357,25 +363,25 @@ export class JupyterGISModel {
357
363
  syncViewport(viewport, emitter) {
358
364
  this.sharedModel.awareness.setLocalStateField('viewportState', {
359
365
  value: viewport,
360
- emitter
366
+ emitter,
361
367
  });
362
368
  }
363
369
  syncPointer(pointer, emitter) {
364
370
  this.sharedModel.awareness.setLocalStateField('pointer', {
365
371
  value: pointer,
366
- emitter
372
+ emitter,
367
373
  });
368
374
  }
369
375
  syncSelected(value, emitter) {
370
376
  this.sharedModel.awareness.setLocalStateField('selected', {
371
377
  value,
372
- emitter
378
+ emitter,
373
379
  });
374
380
  }
375
381
  syncIdentifiedFeatures(features, emitter) {
376
382
  this.sharedModel.awareness.setLocalStateField('identifiedFeatures', {
377
383
  value: features,
378
- emitter
384
+ emitter,
379
385
  });
380
386
  }
381
387
  setUserToFollow(userId) {
@@ -556,7 +562,7 @@ export class JupyterGISModel {
556
562
  return {
557
563
  mainGroup,
558
564
  workingGroup,
559
- mainGroupIndex
565
+ mainGroupIndex,
560
566
  };
561
567
  }
562
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/concaveHull';
3
+ export * from '../../_interface/processing/centroids';
4
+ export * from '../../_interface/processing/convexHull';
5
+ export * from '../../_interface/processing/dissolve';
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/concaveHull';
4
+ export * from '../../_interface/processing/centroids';
5
+ export * from '../../_interface/processing/convexHull';
6
+ export * from '../../_interface/processing/dissolve';
7
+ export * from '../../_interface/processing/boundingBoxes';
@@ -0,0 +1,2 @@
1
+ export type ProcessingType = 'Buffer' | 'ConcaveHull' | 'Centroids' | 'ConvexHull' | 'Dissolve' | 'BoundingBoxes';
2
+ export declare const processingList: string[];
@@ -0,0 +1,8 @@
1
+ export const processingList = [
2
+ 'Buffer',
3
+ 'ConcaveHull',
4
+ 'Centroids',
5
+ 'ConvexHull',
6
+ 'Dissolve',
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": "ConcaveHull",
17
+ "name": "concaveHull",
18
+ "operationParams": [
19
+ "pctconvex",
20
+ "allowHoles"
21
+ ],
22
+ "label": "Concave Hull",
23
+ "operations": {
24
+ "sql": "SELECT ST_ConcaveHull(geometry,{pctconvex},{allowHoles}) AS geometry, * FROM \"{layerName}\"",
25
+ "gdalFunction": "ogr2ogr"
26
+ },
27
+ "type": "vector"
28
+ },
29
+ {
30
+ "description": "Centroids",
31
+ "name": "centroids",
32
+ "operationParams": [],
33
+ "label": "Centroids",
34
+ "operations": {
35
+ "gdalFunction": "ogr2ogr",
36
+ "sql": "SELECT ST_Centroid(geometry) AS geometry, * FROM \"{layerName}\""
37
+ },
38
+ "type": "vector"
39
+ },
40
+ {
41
+ "description": "ConvexHull",
42
+ "name": "convexHull",
43
+ "operationParams": [],
44
+ "label": "Convex Hull",
45
+ "operations": {
46
+ "sql": "SELECT ST_ConvexHull(geometry) AS geometry, * FROM \"{layerName}\"",
47
+ "gdalFunction": "ogr2ogr"
48
+ },
49
+ "type": "vector"
50
+ },
51
+ {
52
+ "description": "Dissolve",
53
+ "name": "dissolve",
54
+ "operationParams": [
55
+ "dissolveField"
56
+ ],
57
+ "label": "Dissolve",
58
+ "operations": {
59
+ "gdalFunction": "ogr2ogr",
60
+ "sql": "SELECT ST_Union(geometry) AS geometry, {dissolveField} FROM \"{layerName}\" GROUP BY {dissolveField}"
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
+ }
@@ -40,7 +40,8 @@
40
40
  "HillshadeLayer",
41
41
  "WebGlLayer",
42
42
  "ImageLayer",
43
- "HeatmapLayer"
43
+ "HeatmapLayer",
44
+ "StacLayer"
44
45
  ]
45
46
  },
46
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,25 +1,25 @@
1
1
  export * from './_interface/project/jgis';
2
+ export * from './_interface/project/sources/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';
25
- export * from './index';
package/lib/types.js CHANGED
@@ -1,30 +1,30 @@
1
1
  export * from './_interface/project/jgis';
2
2
  // Sources
3
+ export * from './_interface/project/sources/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';
30
- export * from './index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupytergis/schema",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "A JupyterGIS schema package.",
5
5
  "keywords": [
6
6
  "jupytergis"
@@ -26,9 +26,11 @@
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",
30
- "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_core/jupytergis_core/schema/interfaces --output-model-type pydantic_v2.BaseModel --input-file-type jsonschema",
29
+ "build:schema": "jlpm run build:processing && node ./cacheGeoJSONSchema.js && jlpm build:schema:registry && jlpm build:schema:js && jlpm build:schema:py",
30
+ "build:processing": "python scripts/process.py",
31
+ "build:schema:registry": "echo 'Generating combined schema file for schema registry...' && cd src/schema && node ../../scripts/dereference-and-combine-schemas-for-registry.js",
32
+ "build:schema:js": "echo 'Generating TypeScript types from schema...' && json2ts -i src/schema -o src/_interface --no-unknownAny --unreachableDefinitions --cwd ./src/schema && node ./scripts/add-schema-version.js && cp -R ./src/_interface/* ./lib/_interface/.",
33
+ "build:schema:py": "echo 'Generating Python types from schema...' && node scripts/preprocess-schemas-for-python-type-generation.js && datamodel-codegen --input ./temp-schema --output ../../python/jupytergis_core/jupytergis_core/schema/interfaces --output-model-type pydantic_v2.BaseModel --input-file-type jsonschema && rm -rf ./temp-schema",
32
34
  "build:prod": "jlpm run clean && jlpm build:schema && jlpm run build:lib",
33
35
  "build:lib": "tsc -b",
34
36
  "build:dev": "jlpm run build",