ogcopenapis 0.0.12 → 1.0.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 (60) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +310 -72
  3. package/lib/OgcOpenApiCrsTools.d.ts +10 -9
  4. package/lib/OgcOpenApiCrsTools.d.ts.map +1 -0
  5. package/lib/OgcOpenApiCrsTools.js +40 -39
  6. package/lib/OgcOpenApiCrsTools.js.map +1 -0
  7. package/lib/OgcOpenApiFeatureStore.d.ts +94 -93
  8. package/lib/OgcOpenApiFeatureStore.d.ts.map +1 -0
  9. package/lib/OgcOpenApiFeatureStore.js +200 -244
  10. package/lib/OgcOpenApiFeatureStore.js.map +1 -0
  11. package/lib/OgcOpenApiFetchTools.d.ts +37 -30
  12. package/lib/OgcOpenApiFetchTools.d.ts.map +1 -0
  13. package/lib/OgcOpenApiFetchTools.js +68 -50
  14. package/lib/OgcOpenApiFetchTools.js.map +1 -0
  15. package/lib/OgcOpenApiGetCapabilities.d.ts +209 -112
  16. package/lib/OgcOpenApiGetCapabilities.d.ts.map +1 -0
  17. package/lib/OgcOpenApiGetCapabilities.js +424 -277
  18. package/lib/OgcOpenApiGetCapabilities.js.map +1 -0
  19. package/lib/OgcOpenApiMapsModel.d.ts +41 -36
  20. package/lib/OgcOpenApiMapsModel.d.ts.map +1 -0
  21. package/lib/OgcOpenApiMapsModel.js +88 -75
  22. package/lib/OgcOpenApiMapsModel.js.map +1 -0
  23. package/lib/OgcOpenApiMvtTools.d.ts +12 -0
  24. package/lib/OgcOpenApiMvtTools.d.ts.map +1 -0
  25. package/lib/OgcOpenApiMvtTools.js +100 -0
  26. package/lib/OgcOpenApiMvtTools.js.map +1 -0
  27. package/lib/OgcOpenApiStyleTools.d.ts +51 -0
  28. package/lib/OgcOpenApiStyleTools.d.ts.map +1 -0
  29. package/lib/OgcOpenApiStyleTools.js +155 -0
  30. package/lib/OgcOpenApiStyleTools.js.map +1 -0
  31. package/lib/OgcOpenApiTileMatrixTools.d.ts +41 -0
  32. package/lib/OgcOpenApiTileMatrixTools.d.ts.map +1 -0
  33. package/lib/OgcOpenApiTileMatrixTools.js +88 -0
  34. package/lib/OgcOpenApiTileMatrixTools.js.map +1 -0
  35. package/lib/OgcOpenApiTilesModel.d.ts +56 -31
  36. package/lib/OgcOpenApiTilesModel.d.ts.map +1 -0
  37. package/lib/OgcOpenApiTilesModel.js +167 -128
  38. package/lib/OgcOpenApiTilesModel.js.map +1 -0
  39. package/lib/OgcOpenApiVectorTilesModel.d.ts +39 -0
  40. package/lib/OgcOpenApiVectorTilesModel.d.ts.map +1 -0
  41. package/lib/OgcOpenApiVectorTilesModel.js +122 -0
  42. package/lib/OgcOpenApiVectorTilesModel.js.map +1 -0
  43. package/lib/OgcOpenApiWmtsTools.d.ts +30 -0
  44. package/lib/OgcOpenApiWmtsTools.d.ts.map +1 -0
  45. package/lib/OgcOpenApiWmtsTools.js +89 -0
  46. package/lib/OgcOpenApiWmtsTools.js.map +1 -0
  47. package/package.json +56 -27
  48. package/src/OgcOpenApiCrsTools.ts +40 -0
  49. package/src/OgcOpenApiFeatureStore.ts +296 -0
  50. package/src/OgcOpenApiFetchTools.ts +84 -0
  51. package/src/OgcOpenApiGetCapabilities.ts +641 -0
  52. package/src/OgcOpenApiMapsModel.ts +128 -0
  53. package/src/OgcOpenApiMvtTools.ts +104 -0
  54. package/src/OgcOpenApiStyleTools.ts +187 -0
  55. package/src/OgcOpenApiTileMatrixTools.ts +111 -0
  56. package/src/OgcOpenApiTilesModel.ts +214 -0
  57. package/src/OgcOpenApiVectorTilesModel.ts +141 -0
  58. package/src/OgcOpenApiWmtsTools.ts +114 -0
  59. package/lib/OgcOpenApiGetCollectionTiles.d.ts +0 -7
  60. package/lib/OgcOpenApiGetCollectionTiles.js +0 -7
@@ -1,244 +1,200 @@
1
- import { EventedSupport } from '@luciad/ria/util/EventedSupport';
2
- import { createBounds } from '@luciad/ria/shape/ShapeFactory';
3
- import { getReference } from "@luciad/ria/reference/ReferenceProvider";
4
- import { createTransformation } from "@luciad/ria/transformation/TransformationFactory";
5
- import { OgcOpenApiCrsTools } from "./OgcOpenApiCrsTools";
6
- import { GeoJsonCodec } from "@luciad/ria/model/codec/GeoJsonCodec";
7
- import { GMLCodec } from "@luciad/ria/model/codec/GMLCodec";
8
- import { OgcOpenApiFetchTools } from "./OgcOpenApiFetchTools";
9
- export class OgcOpenApiFeatureStore {
10
- constructor(options) {
11
- // console.log(options);
12
- this.swapAxes = options.swapAxes;
13
- this.useCrs84Bounds = typeof options.useCrs84Bounds !== "undefined" ? options.useCrs84Bounds : false;
14
- this.dataUrl = options.dataUrl;
15
- this.outputFormat = options.outputFormat;
16
- const predictedFeatureUrl = this.dataUrl.replace(/\.[^/.]+$/, "");
17
- this.featureUrl = options.featureUrl ? OgcOpenApiFeatureStore.cleanUrl(options.featureUrl, true) : OgcOpenApiFeatureStore.cleanUrl(predictedFeatureUrl, true);
18
- this.baseUrl = OgcOpenApiFeatureStore.cleanUrl(this.dataUrl);
19
- this.dataFormat = OgcOpenApiFeatureStore.dataFormatInQuery(this.dataUrl);
20
- this.customCrs = options.crs === "http://www.opengis.net/def/crs/OGC/1.3/CRS84" ? undefined : options.crs;
21
- this.codec = options.codec;
22
- this.eventedSupport = new EventedSupport();
23
- this.requestHeaders = options.requestHeaders ? options.requestHeaders : {};
24
- const referenceName = OgcOpenApiCrsTools.getReferenceName(options.crs);
25
- this.reference = getReference(referenceName);
26
- this.proxy = options.proxify;
27
- this.credentials = options.credentials;
28
- this.serverOptions = OgcOpenApiFetchTools.createFetchOptions({ originalUrl: this.dataUrl, proxify: options.proxify });
29
- if (options.extent &&
30
- options.extent.spatial &&
31
- options.extent.spatial.bbox &&
32
- options.extent.spatial.bbox.length > 0) {
33
- const bbox = options.extent.spatial.bbox[0];
34
- const WGS84 = getReference("CRS:84");
35
- const tmpBounds = createBounds(WGS84, [
36
- bbox[0],
37
- bbox[2] - bbox[0],
38
- bbox[1],
39
- bbox[3] - bbox[1],
40
- ]);
41
- this.bounds = OgcOpenApiFeatureStore.targetBounds(tmpBounds, this.reference);
42
- }
43
- }
44
- on(event, callback, context, options) {
45
- return this.eventedSupport.on(event, callback, context, options);
46
- }
47
- get(id, optionsInput) {
48
- return new Promise((resolve) => {
49
- const options = optionsInput ? Object.assign({}, optionsInput) : {};
50
- options.query = (options.query ? options.query : {});
51
- options.query.f = options.query.f ? options.query.f : this.dataFormat;
52
- options.query.crs = options.query.crs ? options.query.crs : this.customCrs;
53
- // Mod starta
54
- const itemsAccept = typeof this.requestHeaders.accept !== 'undefined'
55
- ? this.requestHeaders.accept.split(';')
56
- : typeof this.requestHeaders.Accept !== 'undefined'
57
- ? this.requestHeaders.Accept.split(';')
58
- : [];
59
- itemsAccept.push(this.outputFormat);
60
- const accept = itemsAccept.join(';');
61
- // Mod end
62
- let request = this.featureUrl + id;
63
- const simpleQuery = [];
64
- if (options.query.f)
65
- simpleQuery.push("f");
66
- if (options.query.crs)
67
- simpleQuery.push("crs");
68
- if (simpleQuery.length > 0) {
69
- const queryString = simpleQuery.map(k => "" + k + "=" + options.query[k]).join("&");
70
- request += "?" + queryString;
71
- }
72
- const headers = Object.assign(Object.assign({}, this.requestHeaders), { Accept: accept });
73
- OgcOpenApiFetchTools.fetch(request, {
74
- method: 'GET',
75
- credentials: this.credentials ? "same-origin" : "omit",
76
- headers,
77
- }, this.serverOptions).then((response) => {
78
- if (response.status === 200) {
79
- response.text().then((content) => {
80
- let contentType = response.headers.get('Content-Type');
81
- const contentCrs = response.headers.get('content-crs') ? response.headers.get('content-crs') : this.customCrs;
82
- const contentLengthStr = response.headers.get('Content-Length');
83
- const contentLength = Number(contentLengthStr);
84
- contentType = contentType ? contentType : 'text/plain';
85
- content = content
86
- .split('http://www.opengis.net/def/crs/OGC/1.3/CRS84')
87
- .join('urn:ogc:def:crs:OGC:1.3:CRS84');
88
- const codecOptions = {
89
- content, contentType, contentCrs, contentLength
90
- };
91
- let cursor = null;
92
- if (this.codec instanceof GeoJsonCodec || this.codec instanceof GMLCodec) {
93
- cursor = this.codec.decode(Object.assign(Object.assign({}, codecOptions), { reference: getReference(OgcOpenApiCrsTools.getReferenceName(contentCrs)) }));
94
- }
95
- else {
96
- cursor = this.codec.decode(codecOptions);
97
- }
98
- if (cursor && cursor.hasNext()) {
99
- const feaure = cursor.next();
100
- resolve(feaure);
101
- }
102
- else {
103
- resolve(null);
104
- }
105
- });
106
- }
107
- });
108
- });
109
- }
110
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
111
- query(receivedQuery, options) {
112
- return new Promise((resolve, reject) => {
113
- const query = receivedQuery ? Object.assign({}, receivedQuery) : {};
114
- query.f = query.f ? query.f : this.dataFormat;
115
- query.crs = query.crs ? query.crs : this.customCrs;
116
- query.limit = query.limit ? query.limit : undefined;
117
- let request = this.baseUrl;
118
- // Mod starta
119
- const itemsAccept = typeof this.requestHeaders.accept !== 'undefined'
120
- ? this.requestHeaders.accept.split(';')
121
- : typeof this.requestHeaders.Accept !== 'undefined'
122
- ? this.requestHeaders.Accept.split(';')
123
- : [];
124
- itemsAccept.push(this.outputFormat);
125
- const accept = itemsAccept.join(';');
126
- // Mod end
127
- const allKeys = Object.keys(query);
128
- if (allKeys.length > 0) {
129
- const filteredKeys = allKeys.filter(e => (typeof query[e] !== "undefined" && query[e] !== null));
130
- const indexOfFormat = filteredKeys.indexOf("f");
131
- if (indexOfFormat > -1) {
132
- filteredKeys.splice(indexOfFormat, 1);
133
- filteredKeys.unshift("f");
134
- }
135
- const queryString = filteredKeys.map(k => "" + k + "=" + query[k]).join("&");
136
- request += "?" + queryString;
137
- }
138
- const headers = Object.assign(Object.assign({}, this.requestHeaders), { Accept: accept });
139
- // const headers = { ...this.requestHeaders };
140
- OgcOpenApiFetchTools.fetch(request, {
141
- method: 'GET',
142
- credentials: this.credentials ? "same-origin" : "omit",
143
- headers,
144
- }, this.serverOptions).then((response) => {
145
- if (response.status === 200) {
146
- response.text().then((content) => {
147
- let contentType = response.headers.get('Content-Type');
148
- const contentCrs = response.headers.get('content-crs') ? response.headers.get('content-crs') : this.customCrs;
149
- const contentLengthStr = response.headers.get('Content-Length');
150
- const contentLength = Number(contentLengthStr);
151
- contentType = contentType ? contentType : 'text/plain';
152
- content = content
153
- .split('srsName="http://www.opengis.net/def/crs/OGC/1.3/CRS84"')
154
- .join('srsName="urn:ogc:def:crs:OGC:1.3:CRS84"');
155
- const codecOptions = {
156
- content, contentType, contentCrs, contentLength
157
- };
158
- if (this.codec instanceof GeoJsonCodec || this.codec instanceof GMLCodec) {
159
- const cursor = this.codec.decode(Object.assign(Object.assign({}, codecOptions), { reference: getReference(OgcOpenApiCrsTools.getReferenceName(contentCrs)) }));
160
- resolve(cursor);
161
- }
162
- else {
163
- const cursor = this.codec.decode(codecOptions);
164
- resolve(cursor);
165
- }
166
- });
167
- }
168
- else {
169
- reject();
170
- }
171
- }).catch(() => {
172
- reject();
173
- });
174
- });
175
- }
176
- spatialQuery(bounds, receivedQuery, options) {
177
- const query = (receivedQuery ? Object.assign({}, receivedQuery) : {});
178
- delete query.bbox;
179
- query.limit = query.limit ? query.limit : undefined;
180
- if (bounds) {
181
- if (this.useCrs84Bounds) {
182
- const crs84Bounds = OgcOpenApiFeatureStore.getCRS84BoundingBox(bounds);
183
- query.bbox = query.bbox
184
- ? query.bbox
185
- : [
186
- crs84Bounds.x,
187
- crs84Bounds.y,
188
- crs84Bounds.x + crs84Bounds.width,
189
- crs84Bounds.y + crs84Bounds.height,
190
- ];
191
- }
192
- else {
193
- query.bbox = query.bbox
194
- ? query.bbox
195
- : [
196
- bounds.x,
197
- bounds.y,
198
- bounds.x + bounds.width,
199
- bounds.y + bounds.height,
200
- ];
201
- if (this.customCrs) {
202
- query["bbox-crs"] = this.customCrs;
203
- }
204
- const referenceName = OgcOpenApiCrsTools.getReferenceName(this.customCrs);
205
- if (this.swapAxes && this.swapAxes.findIndex(f => f === referenceName) > -1) {
206
- query.bbox = [query.bbox[1], query.bbox[0], query.bbox[3], query.bbox[2]];
207
- }
208
- }
209
- }
210
- return this.query(query, options);
211
- }
212
- static getCRS84BoundingBox(shape) {
213
- const WGS84 = getReference("CRS:84");
214
- const bounds = shape.bounds;
215
- const toWgs84 = createTransformation(bounds.reference, WGS84);
216
- const newBounds = toWgs84.transformBounds(bounds);
217
- return newBounds;
218
- }
219
- static targetBounds(bounds, targetReferenceBounds) {
220
- const WGS84 = getReference("CRS:84");
221
- const toTargetReference = createTransformation(WGS84, targetReferenceBounds);
222
- const newBounds = toTargetReference.transformBounds(bounds);
223
- return newBounds;
224
- }
225
- static cleanUrl(dataUrl, addSlash = false) {
226
- const parts = dataUrl.split('?');
227
- return parts[0].endsWith('/') ? parts[0] : (addSlash ? parts[0] + '/' : parts[0]);
228
- }
229
- static dataFormatInQuery(dataUrl) {
230
- let format;
231
- const parts = dataUrl.split('?');
232
- if (parts.length > 1) {
233
- const query = parts[1];
234
- const qs = query.split('&');
235
- for (const q of qs) {
236
- if (q.startsWith('f=')) {
237
- format = q.substr(2);
238
- return format;
239
- }
240
- }
241
- }
242
- return format;
243
- }
244
- }
1
+ import { Store } from '@luciad/ria/model/store/Store.js';
2
+ import { Feature } from '@luciad/ria/model/feature/Feature.js';
3
+ import { Bounds } from '@luciad/ria/shape/Bounds.js';
4
+ import { Codec } from '@luciad/ria/model/codec/Codec.js';
5
+ import { createBounds } from '@luciad/ria/shape/ShapeFactory.js';
6
+ import { CoordinateReference } from '@luciad/ria/reference/CoordinateReference.js';
7
+ import { getReference } from "@luciad/ria/reference/ReferenceProvider.js";
8
+ import { createTransformation } from "@luciad/ria/transformation/TransformationFactory.js";
9
+ import { OgcOpenApiCrsTools } from "./OgcOpenApiCrsTools.js";
10
+ import { GeoJsonCodec } from "@luciad/ria/model/codec/GeoJsonCodec.js";
11
+ import { GMLCodec } from "@luciad/ria/model/codec/GMLCodec.js";
12
+ import { OgcOpenApiFetchTools } from "./OgcOpenApiFetchTools.js";
13
+ export class OgcOpenApiFeatureStore extends Store {
14
+ constructor(options) {
15
+ super();
16
+ // console.log(options);
17
+ this.swapAxes = options.swapAxes;
18
+ this.useCrs84Bounds = typeof options.useCrs84Bounds !== "undefined" ? options.useCrs84Bounds : false;
19
+ this.dataUrl = options.dataUrl;
20
+ this.outputFormat = options.outputFormat;
21
+ const predictedFeatureUrl = this.dataUrl.replace(/\.[^/.]+$/, "");
22
+ this.featureUrl = options.featureUrl ? OgcOpenApiFeatureStore.cleanUrl(options.featureUrl, true) : OgcOpenApiFeatureStore.cleanUrl(predictedFeatureUrl, true);
23
+ this.baseUrl = OgcOpenApiFeatureStore.cleanUrl(this.dataUrl);
24
+ this.dataFormat = OgcOpenApiFeatureStore.dataFormatInQuery(this.dataUrl);
25
+ this.customCrs = options.crs === "http://www.opengis.net/def/crs/OGC/1.3/CRS84" ? undefined : options.crs;
26
+ this.codec = options.codec;
27
+ this.requestHeaders = options.requestHeaders ? options.requestHeaders : {};
28
+ const referenceName = OgcOpenApiCrsTools.getReferenceName(options.crs);
29
+ this.reference = getReference(referenceName);
30
+ this.proxy = options.proxify;
31
+ this.credentials = options.credentials;
32
+ this.serverOptions = OgcOpenApiFetchTools.createFetchOptions({ originalUrl: this.dataUrl, proxify: options.proxify });
33
+ if (options.extent &&
34
+ options.extent.spatial &&
35
+ options.extent.spatial.bbox &&
36
+ options.extent.spatial.bbox.length > 0) {
37
+ const bbox = options.extent.spatial.bbox[0];
38
+ const WGS84 = getReference("CRS:84");
39
+ const tmpBounds = createBounds(WGS84, [
40
+ bbox[0],
41
+ bbox[2] - bbox[0],
42
+ bbox[1],
43
+ bbox[3] - bbox[1],
44
+ ]);
45
+ this.dataBounds = OgcOpenApiFeatureStore.targetBounds(tmpBounds, this.reference);
46
+ }
47
+ }
48
+ // Store defines bounds as a getter, the extent is kept in dataBounds
49
+ get bounds() {
50
+ return this.dataBounds;
51
+ }
52
+ isOperationSupported(methodName) {
53
+ return methodName === "get" || methodName === "spatialQuery";
54
+ }
55
+ get(id, optionsInput) {
56
+ const options = optionsInput ? { ...optionsInput } : {};
57
+ options.query = (options.query ? options.query : {});
58
+ options.query.f = options.query.f ? options.query.f : this.dataFormat;
59
+ options.query.crs = options.query.crs ? options.query.crs : this.customCrs;
60
+ let request = this.featureUrl + id;
61
+ const simpleQuery = [];
62
+ if (options.query.f)
63
+ simpleQuery.push("f");
64
+ if (options.query.crs)
65
+ simpleQuery.push("crs");
66
+ if (simpleQuery.length > 0) {
67
+ const queryString = simpleQuery.map(k => "" + k + "=" + options.query[k]).join("&");
68
+ request += "?" + queryString;
69
+ }
70
+ return this.fetchFeatures(request, options.abortSignal).then(cursor => cursor && cursor.hasNext() ? cursor.next() : null);
71
+ }
72
+ query(receivedQuery, options) {
73
+ const query = receivedQuery ? { ...receivedQuery } : {};
74
+ query.f = query.f ? query.f : this.dataFormat;
75
+ query.crs = query.crs ? query.crs : this.customCrs;
76
+ query.limit = query.limit ? query.limit : undefined;
77
+ let request = this.baseUrl;
78
+ const allKeys = Object.keys(query);
79
+ if (allKeys.length > 0) {
80
+ const filteredKeys = allKeys.filter(e => (typeof query[e] !== "undefined" && query[e] !== null));
81
+ const indexOfFormat = filteredKeys.indexOf("f");
82
+ if (indexOfFormat > -1) {
83
+ filteredKeys.splice(indexOfFormat, 1);
84
+ filteredKeys.unshift("f");
85
+ }
86
+ const queryString = filteredKeys.map(k => "" + k + "=" + query[k]).join("&");
87
+ request += "?" + queryString;
88
+ }
89
+ return this.fetchFeatures(request, options?.abortSignal);
90
+ }
91
+ // Fetches and decodes features. The promise always settles: it rejects with the reason when the request,
92
+ // the response or the decoding fails, and when LuciadRIA aborts the request through abortSignal.
93
+ fetchFeatures(request, abortSignal) {
94
+ // Mod starta
95
+ const itemsAccept = typeof this.requestHeaders.accept !== 'undefined'
96
+ ? this.requestHeaders.accept.split(';')
97
+ : typeof this.requestHeaders.Accept !== 'undefined'
98
+ ? this.requestHeaders.Accept.split(';')
99
+ : [];
100
+ itemsAccept.push(this.outputFormat);
101
+ const accept = itemsAccept.join(';');
102
+ // Mod end
103
+ const headers = { ...this.requestHeaders, Accept: accept };
104
+ return OgcOpenApiFetchTools.fetch(request, {
105
+ method: 'GET',
106
+ credentials: this.credentials ? "same-origin" : "omit",
107
+ headers,
108
+ signal: abortSignal,
109
+ }, this.serverOptions).then((response) => {
110
+ if (response.status !== 200) {
111
+ throw new Error("Invalid response: " + response.status + " for " + request);
112
+ }
113
+ return response.text().then((content) => {
114
+ let contentType = response.headers.get('Content-Type');
115
+ const contentCrs = response.headers.get('content-crs') ? response.headers.get('content-crs') : this.customCrs;
116
+ const contentLengthStr = response.headers.get('Content-Length');
117
+ const contentLength = Number(contentLengthStr);
118
+ contentType = contentType ? contentType : 'text/plain';
119
+ // GeoJsonCodec reads the CRS84 URI, GML is given the URN
120
+ content = content
121
+ .split('srsName="http://www.opengis.net/def/crs/OGC/1.3/CRS84"')
122
+ .join('srsName="urn:ogc:def:crs:OGC:1.3:CRS84"');
123
+ const codecOptions = {
124
+ content, contentType, contentCrs, contentLength
125
+ };
126
+ if (this.codec instanceof GeoJsonCodec || this.codec instanceof GMLCodec) {
127
+ return this.codec.decode({ ...codecOptions, reference: getReference(OgcOpenApiCrsTools.getReferenceName(contentCrs)) });
128
+ }
129
+ return this.codec.decode(codecOptions);
130
+ });
131
+ });
132
+ }
133
+ spatialQuery(bounds, receivedQuery, options) {
134
+ const query = (receivedQuery ? { ...receivedQuery } : {});
135
+ delete query.bbox;
136
+ query.limit = query.limit ? query.limit : undefined;
137
+ if (bounds) {
138
+ if (this.useCrs84Bounds) {
139
+ const crs84Bounds = OgcOpenApiFeatureStore.getCRS84BoundingBox(bounds);
140
+ query.bbox = query.bbox
141
+ ? query.bbox
142
+ : [
143
+ crs84Bounds.x,
144
+ crs84Bounds.y,
145
+ crs84Bounds.x + crs84Bounds.width,
146
+ crs84Bounds.y + crs84Bounds.height,
147
+ ];
148
+ }
149
+ else {
150
+ query.bbox = query.bbox
151
+ ? query.bbox
152
+ : [
153
+ bounds.x,
154
+ bounds.y,
155
+ bounds.x + bounds.width,
156
+ bounds.y + bounds.height,
157
+ ];
158
+ if (this.customCrs) {
159
+ query["bbox-crs"] = this.customCrs;
160
+ }
161
+ const referenceName = OgcOpenApiCrsTools.getReferenceName(this.customCrs);
162
+ if (this.swapAxes && this.swapAxes.findIndex(f => f === referenceName) > -1) {
163
+ query.bbox = [query.bbox[1], query.bbox[0], query.bbox[3], query.bbox[2]];
164
+ }
165
+ }
166
+ }
167
+ return this.query(query, options);
168
+ }
169
+ static getCRS84BoundingBox(shape) {
170
+ const WGS84 = getReference("CRS:84");
171
+ const bounds = shape.bounds;
172
+ const toWgs84 = createTransformation(bounds.reference, WGS84);
173
+ return toWgs84.transformBounds(bounds);
174
+ }
175
+ static targetBounds(bounds, targetReferenceBounds) {
176
+ const WGS84 = getReference("CRS:84");
177
+ const toTargetReference = createTransformation(WGS84, targetReferenceBounds);
178
+ return toTargetReference.transformBounds(bounds);
179
+ }
180
+ static cleanUrl(dataUrl, addSlash = false) {
181
+ const parts = dataUrl.split('?');
182
+ return parts[0].endsWith('/') ? parts[0] : (addSlash ? parts[0] + '/' : parts[0]);
183
+ }
184
+ static dataFormatInQuery(dataUrl) {
185
+ let format;
186
+ const parts = dataUrl.split('?');
187
+ if (parts.length > 1) {
188
+ const query = parts[1];
189
+ const qs = query.split('&');
190
+ for (const q of qs) {
191
+ if (q.startsWith('f=')) {
192
+ format = q.slice(2);
193
+ return format;
194
+ }
195
+ }
196
+ }
197
+ return format;
198
+ }
199
+ }
200
+ //# sourceMappingURL=OgcOpenApiFeatureStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OgcOpenApiFeatureStore.js","sourceRoot":"","sources":["../src/OgcOpenApiFeatureStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,EAA0B,MAAM,kCAAkC,CAAC;AAEnG,OAAO,EAAC,OAAO,EAAC,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAC,MAAM,EAAC,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CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;oBACpB,OAAO,MAAM,CAAC;gBAChB,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,30 +1,37 @@
1
- import { ProxifyFunction } from "./OgcOpenApiGetCapabilities";
2
- interface ExtFetchOptions {
3
- originalUrl: string;
4
- complete?: (url: string) => string;
5
- proxify?: ProxifyFunction;
6
- }
7
- export interface FetchServerOptions {
8
- proxy: (url: string, fetchOptions: any) => {
9
- fetchOptions: any;
10
- url: string;
11
- };
12
- hostname: string;
13
- complete: (url: string) => string;
14
- }
15
- declare class OgcOpenApiFetchTools {
16
- static createFetchOptions(options: ExtFetchOptions): {
17
- hostname: string;
18
- complete: (url: string) => string;
19
- proxy: (url: string, fetchOptions: any) => {
20
- url: string;
21
- fetchOptions: any;
22
- };
23
- };
24
- static fetch(input: string, options: RequestInit, serverOptions: FetchServerOptions): Promise<Response>;
25
- static addHostURL(url: string, HostUrl?: string): string;
26
- static cleanUrl(inputUrl: string): string;
27
- static cleanUrlToAsset(inputUrl: string): string;
28
- static getHostURL(fullUrl: string): string;
29
- }
30
- export { OgcOpenApiFetchTools };
1
+ import type { ProxifyFunction } from "./OgcOpenApiGetCapabilities.js";
2
+ interface ExtFetchOptions {
3
+ originalUrl: string;
4
+ complete?: (url: string) => string;
5
+ proxify?: ProxifyFunction;
6
+ }
7
+ export interface FetchServerOptions {
8
+ proxy: (url: string, fetchOptions: any) => {
9
+ fetchOptions: any;
10
+ url: string;
11
+ };
12
+ hostname: string;
13
+ complete: (url: string) => string;
14
+ }
15
+ declare class OgcOpenApiFetchTools {
16
+ static createFetchOptions(options: ExtFetchOptions): {
17
+ hostname: string;
18
+ complete: (url: string) => string;
19
+ proxy: (url: string, fetchOptions: any) => {
20
+ url: string;
21
+ fetchOptions: any;
22
+ };
23
+ };
24
+ static fetch(input: string, options: RequestInit, serverOptions: FetchServerOptions): Promise<Response>;
25
+ /**
26
+ * A link of a document, resolved against the URL of that document (RFC 3986): ./x, ../x, x, /x and //host/x.
27
+ * Absolute links are kept as they are. Without an absolute document URL, as behind a relative proxy path, the link
28
+ * is completed with the host of the server.
29
+ */
30
+ static resolveUrl(href: string, documentUrl: string, serverOptions: FetchServerOptions): string;
31
+ static addHostURL(url: string, HostUrl?: string): string;
32
+ static cleanUrl(inputUrl: string): string;
33
+ static cleanUrlToAsset(inputUrl: string): string;
34
+ static getHostURL(fullUrl: string): string;
35
+ }
36
+ export { OgcOpenApiFetchTools };
37
+ //# sourceMappingURL=OgcOpenApiFetchTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OgcOpenApiFetchTools.d.ts","sourceRoot":"","sources":["../src/OgcOpenApiFetchTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAEpE,UAAU,eAAe;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,OAAO,CAAC,EAAE,eAAe,CAAA;CAC5B;AACD,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,KAAA,KAAK;QAAE,YAAY,EAAE,GAAG,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CACpC;AAMD,cAAM,oBAAoB;WAER,kBAAkB,CAAC,OAAO,EAAE,eAAe;;wBAfxC,MAAM,KAAK,MAAM;qBAsB6C,MAAM;;;;;WAOvE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB;IAM1F;;;;OAIG;WACW,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,kBAAkB;WAQ/E,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;WAYxC,QAAQ,CAAC,QAAQ,EAAC,MAAM;WAIxB,eAAe,CAAC,QAAQ,EAAC,MAAM;WAI/B,UAAU,CAAC,OAAO,EAAE,MAAM;CAO3C;AAED,OAAO,EACH,oBAAoB,EACvB,CAAA"}