@jupytergis/schema 0.7.0 → 0.8.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.
- package/lib/interfaces.d.ts +8 -0
- package/lib/model.d.ts +9 -0
- package/lib/model.js +13 -0
- package/lib/processing/_generated/exportProcessingSchema.d.ts +2 -2
- package/lib/processing/_generated/exportProcessingSchema.js +2 -2
- package/lib/processing/_generated/processingType.d.ts +1 -1
- package/lib/processing/_generated/processingType.js +2 -2
- package/lib/processing/_generated/processing_merge.json +16 -16
- package/package.json +1 -1
package/lib/interfaces.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { Contents, User } from '@jupyterlab/services';
|
|
|
7
7
|
import { JSONObject } from '@lumino/coreutils';
|
|
8
8
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
9
9
|
import { SplitPanel } from '@lumino/widgets';
|
|
10
|
+
import { FeatureLike } from 'ol/Feature';
|
|
10
11
|
import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerItem, IJGISLayers, IJGISLayerTree, IJGISOptions, IJGISSource, IJGISSources, SourceType } from './_interface/project/jgis';
|
|
11
12
|
import { IRasterSource } from './_interface/project/sources/rasterSource';
|
|
12
13
|
export { IGeoJSONSource } from './_interface/project/sources/geoJsonSource';
|
|
@@ -148,6 +149,13 @@ export interface IJupyterGISModel extends DocumentRegistry.IModel {
|
|
|
148
149
|
contentsManager: Contents.IManager | undefined;
|
|
149
150
|
filePath: string;
|
|
150
151
|
pathChanged: ISignal<IJupyterGISModel, string>;
|
|
152
|
+
getFeaturesForCurrentTile: ({ sourceId, }: {
|
|
153
|
+
sourceId: string;
|
|
154
|
+
}) => FeatureLike[];
|
|
155
|
+
syncTileFeatures: ({ sourceId, features, }: {
|
|
156
|
+
sourceId: string;
|
|
157
|
+
features: FeatureLike[];
|
|
158
|
+
}) => void;
|
|
151
159
|
getSettings(): IJupyterGISSettings;
|
|
152
160
|
getContent(): IJGISContent;
|
|
153
161
|
getLayers(): IJGISLayers;
|
package/lib/model.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Contents } from '@jupyterlab/services';
|
|
|
5
5
|
import { ISettingRegistry } from '@jupyterlab/settingregistry';
|
|
6
6
|
import { PartialJSONObject } from '@lumino/coreutils';
|
|
7
7
|
import { ISignal, Signal } from '@lumino/signaling';
|
|
8
|
+
import { FeatureLike } from 'ol/Feature';
|
|
8
9
|
import { IJGISContent, IJGISLayer, IJGISLayerGroup, IJGISLayerTree, IJGISLayers, IJGISOptions, IJGISSource, IJGISSources } from './_interface/project/jgis';
|
|
9
10
|
import { IAnnotationModel, IDict, IJGISLayerDocChange, IJGISLayerTreeDocChange, IJGISSourceDocChange, IJupyterGISClientState, IJupyterGISDoc, IJupyterGISModel, ISelection, IUserData, IViewPortState, JgisCoordinates, Pointer, IJupyterGISSettings } from './interfaces';
|
|
10
11
|
export declare class JupyterGISModel implements IJupyterGISModel {
|
|
@@ -14,6 +15,13 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
14
15
|
*/
|
|
15
16
|
initSettings(): Promise<void>;
|
|
16
17
|
getSettings(): IJupyterGISSettings;
|
|
18
|
+
getFeaturesForCurrentTile({ sourceId }: {
|
|
19
|
+
sourceId: string;
|
|
20
|
+
}): FeatureLike[];
|
|
21
|
+
syncTileFeatures({ sourceId, features, }: {
|
|
22
|
+
sourceId: string;
|
|
23
|
+
features: FeatureLike[];
|
|
24
|
+
}): void;
|
|
17
25
|
private _onSharedModelChanged;
|
|
18
26
|
readonly collaborative: boolean;
|
|
19
27
|
get sharedModel(): IJupyterGISDoc;
|
|
@@ -184,6 +192,7 @@ export declare class JupyterGISModel implements IJupyterGISModel {
|
|
|
184
192
|
static worker: Worker;
|
|
185
193
|
private _geolocation;
|
|
186
194
|
private _geolocationChanged;
|
|
195
|
+
private _tileFeatureCache;
|
|
187
196
|
}
|
|
188
197
|
export declare namespace JupyterGISModel {
|
|
189
198
|
/**
|
package/lib/model.js
CHANGED
|
@@ -47,6 +47,7 @@ export class JupyterGISModel {
|
|
|
47
47
|
this._isIdentifying = false;
|
|
48
48
|
this._isTemporalControllerActive = false;
|
|
49
49
|
this._geolocationChanged = new Signal(this);
|
|
50
|
+
this._tileFeatureCache = new Map();
|
|
50
51
|
const { annotationModel, sharedModel, settingRegistry } = options;
|
|
51
52
|
if (sharedModel) {
|
|
52
53
|
this._sharedModel = sharedModel;
|
|
@@ -77,6 +78,18 @@ export class JupyterGISModel {
|
|
|
77
78
|
getSettings() {
|
|
78
79
|
return this._settings;
|
|
79
80
|
}
|
|
81
|
+
getFeaturesForCurrentTile({ sourceId }) {
|
|
82
|
+
var _a;
|
|
83
|
+
return Array.from((_a = this._tileFeatureCache.get(sourceId)) !== null && _a !== void 0 ? _a : []);
|
|
84
|
+
}
|
|
85
|
+
syncTileFeatures({ sourceId, features, }) {
|
|
86
|
+
let featureSet = this._tileFeatureCache.get(sourceId);
|
|
87
|
+
if (!featureSet) {
|
|
88
|
+
featureSet = new Set();
|
|
89
|
+
this._tileFeatureCache.set(sourceId, featureSet);
|
|
90
|
+
}
|
|
91
|
+
features.forEach(feature => featureSet.add(feature));
|
|
92
|
+
}
|
|
80
93
|
get sharedModel() {
|
|
81
94
|
return this._sharedModel;
|
|
82
95
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export * from '../../_interface/processing/centroids';
|
|
1
2
|
export * from '../../_interface/processing/buffer';
|
|
2
3
|
export * from '../../_interface/processing/concaveHull';
|
|
3
|
-
export * from '../../_interface/processing/
|
|
4
|
+
export * from '../../_interface/processing/boundingBoxes';
|
|
4
5
|
export * from '../../_interface/processing/convexHull';
|
|
5
6
|
export * from '../../_interface/processing/dissolve';
|
|
6
|
-
export * from '../../_interface/processing/boundingBoxes';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//Generated automatically please don't modify directly
|
|
2
|
+
export * from '../../_interface/processing/centroids';
|
|
2
3
|
export * from '../../_interface/processing/buffer';
|
|
3
4
|
export * from '../../_interface/processing/concaveHull';
|
|
4
|
-
export * from '../../_interface/processing/
|
|
5
|
+
export * from '../../_interface/processing/boundingBoxes';
|
|
5
6
|
export * from '../../_interface/processing/convexHull';
|
|
6
7
|
export * from '../../_interface/processing/dissolve';
|
|
7
|
-
export * from '../../_interface/processing/boundingBoxes';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type ProcessingType = '
|
|
1
|
+
export type ProcessingType = 'Centroids' | 'Buffer' | 'ConcaveHull' | 'BoundingBoxes' | 'ConvexHull' | 'Dissolve';
|
|
2
2
|
export declare const processingList: string[];
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"description": "Centroids",
|
|
4
|
+
"name": "centroids",
|
|
5
|
+
"operationParams": [],
|
|
6
|
+
"label": "Centroids",
|
|
7
|
+
"operations": {
|
|
8
|
+
"gdalFunction": "ogr2ogr",
|
|
9
|
+
"sql": "SELECT ST_Centroid(geometry) AS geometry, * FROM \"{layerName}\""
|
|
10
|
+
},
|
|
11
|
+
"type": "vector"
|
|
12
|
+
},
|
|
2
13
|
{
|
|
3
14
|
"description": "Buffer",
|
|
4
15
|
"name": "buffer",
|
|
@@ -27,13 +38,13 @@
|
|
|
27
38
|
"type": "vector"
|
|
28
39
|
},
|
|
29
40
|
{
|
|
30
|
-
"description": "
|
|
31
|
-
"name": "
|
|
41
|
+
"description": "BoundingBoxes",
|
|
42
|
+
"name": "boundingBoxes",
|
|
32
43
|
"operationParams": [],
|
|
33
|
-
"label": "
|
|
44
|
+
"label": "Bounding Boxes",
|
|
34
45
|
"operations": {
|
|
35
|
-
"
|
|
36
|
-
"
|
|
46
|
+
"sql": "SELECT ST_Envelope(geometry) AS geometry, * FROM \"{layerName}\"",
|
|
47
|
+
"gdalFunction": "ogr2ogr"
|
|
37
48
|
},
|
|
38
49
|
"type": "vector"
|
|
39
50
|
},
|
|
@@ -60,16 +71,5 @@
|
|
|
60
71
|
"sql": "SELECT ST_Union(geometry) AS geometry, {dissolveField} FROM \"{layerName}\" GROUP BY {dissolveField}"
|
|
61
72
|
},
|
|
62
73
|
"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
74
|
}
|
|
75
75
|
]
|