@geogirafe/lib-geoportal 1.1.0-dev.2443899282 → 1.1.0-dev.2450198337
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.1.0-dev.
|
|
1
|
+
{"version":"1.1.0-dev.2450198337", "build":"2450198337", "date":"13/04/2026"}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// POC demo variables
|
|
3
3
|
import ServerOgc from '../../models/serverogc.js';
|
|
4
|
+
const SITN_SERVER = new ServerOgc('gmf', {
|
|
5
|
+
url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/wfs3',
|
|
6
|
+
wfsSupport: false,
|
|
7
|
+
urlWfs: '',
|
|
8
|
+
oapifSupport: true,
|
|
9
|
+
urlOapif: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/wfs3',
|
|
10
|
+
// @ts-expect-error Defining a new type of server here to be able to catch some miss-configuration
|
|
11
|
+
// of the GMF demo server, see ogcapifeaturesclientgmf.ts
|
|
12
|
+
type: 'gmf',
|
|
13
|
+
imageType: ''
|
|
14
|
+
});
|
|
4
15
|
export const DEMO_LAYERS = {
|
|
5
16
|
GEORAMA: {
|
|
6
17
|
url: 'https://demo.georama.io/features/api',
|
|
@@ -39,5 +50,50 @@ export const DEMO_LAYERS = {
|
|
|
39
50
|
type: 'gmf',
|
|
40
51
|
imageType: ''
|
|
41
52
|
})
|
|
53
|
+
},
|
|
54
|
+
SITN_Point: {
|
|
55
|
+
url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/wfs3',
|
|
56
|
+
displayName: 'SITN point',
|
|
57
|
+
collectionId: 'demo01_edit_point',
|
|
58
|
+
collectionTitle: null,
|
|
59
|
+
geometryType: 'Point',
|
|
60
|
+
serverType: 'gmf',
|
|
61
|
+
server: SITN_SERVER
|
|
62
|
+
},
|
|
63
|
+
SITN_LineString: {
|
|
64
|
+
url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/wfs3',
|
|
65
|
+
displayName: 'SITN line',
|
|
66
|
+
collectionId: 'demo02_edit_line',
|
|
67
|
+
collectionTitle: null,
|
|
68
|
+
geometryType: 'LineString',
|
|
69
|
+
serverType: 'gmf',
|
|
70
|
+
server: SITN_SERVER
|
|
71
|
+
},
|
|
72
|
+
SITN_Polygon: {
|
|
73
|
+
url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/wfs3',
|
|
74
|
+
displayName: 'SITN polygon',
|
|
75
|
+
collectionId: 'demo03_edit_polygon',
|
|
76
|
+
collectionTitle: null,
|
|
77
|
+
geometryType: 'Polygon',
|
|
78
|
+
serverType: 'gmf',
|
|
79
|
+
server: SITN_SERVER
|
|
80
|
+
},
|
|
81
|
+
SITN_MultiLineString: {
|
|
82
|
+
url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/wfs3',
|
|
83
|
+
displayName: 'SITN multiline',
|
|
84
|
+
collectionId: 'demo04_edit_multiline',
|
|
85
|
+
collectionTitle: null,
|
|
86
|
+
geometryType: 'MultiLineString',
|
|
87
|
+
serverType: 'gmf',
|
|
88
|
+
server: SITN_SERVER
|
|
89
|
+
},
|
|
90
|
+
SITN_MultiPolygon: {
|
|
91
|
+
url: 'https://sitn.ne.ch/mapserv_proxy/qgisserver/wfs3',
|
|
92
|
+
displayName: 'SITN multipolygon',
|
|
93
|
+
collectionId: 'demo05_edit_multipolygon',
|
|
94
|
+
collectionTitle: null,
|
|
95
|
+
geometryType: 'MultiPolygon',
|
|
96
|
+
serverType: 'gmf',
|
|
97
|
+
server: SITN_SERVER
|
|
42
98
|
}
|
|
43
99
|
};
|
|
@@ -11,16 +11,18 @@ export default class OgcApiFeaturesClientGmf extends OgcApiFeaturesClient {
|
|
|
11
11
|
async getSchema(collectionId) {
|
|
12
12
|
const items = await this.getItems(collectionId, undefined, undefined, 1);
|
|
13
13
|
const item = items[0];
|
|
14
|
-
const properties = Object.fromEntries(Object.entries(item.getProperties())
|
|
15
|
-
.filter(([key, _value]) => ['fid', 'name', 'type'].includes(key))
|
|
16
|
-
.map(([key, value]) => [key, { type: typeof value }]));
|
|
14
|
+
const properties = Object.fromEntries(Object.entries(item.getProperties()).map(([key, value]) => [key, { type: typeof value }]));
|
|
17
15
|
// Add geometry information
|
|
18
16
|
properties['geometry'] = {
|
|
19
17
|
'format': `geometry-${item.getGeometry().getType().toLowerCase()}`,
|
|
20
18
|
'x-ogc-role': 'primary-geometry'
|
|
21
19
|
};
|
|
22
|
-
// mark fid as primary key
|
|
23
|
-
|
|
20
|
+
// mark fid or id as primary key
|
|
21
|
+
['fid', 'id'].forEach((key) => {
|
|
22
|
+
if (properties[key]) {
|
|
23
|
+
properties[key]['x-ogc-role'] = 'id';
|
|
24
|
+
}
|
|
25
|
+
});
|
|
24
26
|
return {
|
|
25
27
|
properties: properties
|
|
26
28
|
};
|