@types/coveragejson 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.
coveragejson/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
coveragejson/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # Installation
2
+ > `npm install --save @types/coveragejson`
3
+
4
+ # Summary
5
+ This package contains type definitions for coveragejson (https://www.ogc.org/standard/coveragejson/).
6
+
7
+ # Details
8
+ Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/coveragejson.
9
+
10
+ ### Additional Details
11
+ * Last updated: Fri, 21 Feb 2025 07:33:05 GMT
12
+ * Dependencies: none
13
+
14
+ # Credits
15
+ These definitions were written by [Edwin Gichuru](https://github.com/murithigeo).
@@ -0,0 +1,732 @@
1
+ /**
2
+ * @external http://www.opengis.net/doc/CS/covjson/1.0
3
+ */
4
+ export as namespace CoverageJSON;
5
+
6
+ /**
7
+ * CoverageJSON documents always consist of a single object. This object (referred to as the
8
+ * CoverageJSON object below) represents a domain, range, coverage, or collection of coverages
9
+ * The CoverageJSON object MAY have any number of members (name/value pairs).
10
+ * The CoverageJSON object MUST have a member with the name "type" whose value is one of: "Domain", "NdArray" (a range encoding), "TiledNdArray" (a range encoding), "Coverage", or "CoverageCollection".
11
+ * The case of the type member values MUST be as shown here.
12
+ */
13
+ export type CoverageJSON = Domain | CoverageCollection | Coverage | NdArray;
14
+ export type CoverageJsonTypes = CoverageJSON["type"];
15
+ export type DomainAxes = Domain["axes"];
16
+ export type DomainTypes = Domain["domainType"];
17
+
18
+ export type Domain =
19
+ | Grid
20
+ | Trajectory
21
+ | Point
22
+ | PointSeries
23
+ | MultiPoint
24
+ | MultiPointSeries
25
+ | Polygon
26
+ | PolygonSeries
27
+ | MultiPolygon
28
+ | MultiPolygonSeries
29
+ | VerticalProfile
30
+ | Section;
31
+
32
+ /**
33
+ * @description string in multiple languages with tags as defined in BCP 47, and the value is the string in that language. The special language tag "und" can be used to identify a value whose language is unknown or undetermined. [IETF BCP47]
34
+ * http://tools.ietf.org/html/bcp47
35
+ */
36
+ export interface I18N {
37
+ [key: string]: string;
38
+ }
39
+
40
+ /**
41
+ * @description Parameter objects represent metadata about the values of the coverage in terms of the observed property (like water temperature), the units, and others.
42
+ * A parameter object MUST NOT have a "unit" member if the "observedProperty" member has a "categories" member
43
+ */
44
+
45
+ export interface Parameter {
46
+ /** A parameter Object MAY have any number of members (name/value pairs) */
47
+ [key: string]: any;
48
+ /**A parameter object MUST have a member with the name "type" and the value must be "Parameter" */
49
+ type: "Parameter";
50
+ /**A parameter object MAY have a member with the name "id" where the value MUST be a
51
+ string and SHOULD be a common identifier. */
52
+ id?: string;
53
+ /**
54
+ * A parameter object MAY have a member with the name "label" where the value
55
+ * MUST be an i18n object that is the name of the parameter and which SHOULD be
56
+ * short. Note that this SHOULD be left out if it would be identical to the "label" of the
57
+ * "observedProperty" member */
58
+ label?: I18N;
59
+ /**
60
+ * A parameter object MAY have a member with the name "description" where the value
61
+ * MUST be an i18n object which is a, perhaps lengthy, textual description of the parameter
62
+ * Note that some tests using validators will fail if you use a string
63
+ */
64
+ description?: I18N;
65
+ /**
66
+ * A parameter object MUST have a member "observedProperty" where the value is an object
67
+ * which MUST have the member "label" and which MAY have the members "id", "description", and "categories".
68
+ * The value of the
69
+ */
70
+ observedProperty: ObservedProperty;
71
+ /**
72
+ * A parameter object MAY have a member with the name "categoryEncoding" where the value is an object where each key is equal to an "id" value of the "categories" array within the "observedProperty" member of the parameter object. There MUST be no duplicate keys. The value is either an integer or an array of integers where each integer MUST be unique within the object
73
+ */
74
+ categoryEncoding?: CategoryEncoding;
75
+
76
+ /**
77
+ * A parameter object MUST NOT have a "unit" member if the "observedProperty" member has a "categories" member
78
+ */
79
+ unit?: Unit;
80
+ }
81
+
82
+ /**
83
+ * Section 9.3
84
+ */
85
+ export interface ObservedProperty {
86
+ label: I18N;
87
+ id?: string;
88
+ description?: I18N;
89
+ /**MUST be a non-empty array of category objects */
90
+ categories?: [Category, ...Category[]];
91
+ categoryEnconding?: CategoryEncoding;
92
+ }
93
+
94
+ /**
95
+ * MUST have a id & label member
96
+ * MAY have a description member
97
+ */
98
+ export interface Category {
99
+ /**MUST be a i18n object of the name of the category */
100
+ label: I18N;
101
+ id: string;
102
+ /**If given, it should be a textual description of the category */
103
+ description?: I18N;
104
+ }
105
+
106
+ /**
107
+ * MAY have member "categoryEncoding" where value is an object where each key is equal to an id value of the categories array
108
+ * within the observedProperty member of the parameter object
109
+ * There MUST be no duplicate keys
110
+ * The value is either an integer or an array of integers where each integer MUST be unique within the object
111
+ */
112
+ export interface CategoryEncoding {
113
+ [key: string]: number | number[];
114
+ }
115
+
116
+ /**
117
+ * the value MUST have either or both the members "label" or/and "symbol" and which MAY have the member "id"
118
+ * If given, the value of "id" MUST be a string and SHOULD be a common identifier. It is recommended to reference a serialization scheme to allow automatic unit conversion
119
+ */
120
+ export type Unit =
121
+ & { id?: string }
122
+ & (
123
+ | { label: I18N; symbol: UnitSymbol }
124
+ | { label: I18N | string }
125
+ | { symbol: UnitSymbol }
126
+ );
127
+
128
+ /**
129
+ * MUST either be a string of the symbolic notation of the unit
130
+ * OR an object with the members "value" and "type" where "value" is the symbolic unit notation and "type" refernces the unit serialization scheme that is used
131
+ * "type" MUST have the value "http://www.opengis.net/def/uom/UCUM" if UCUM (http://unitsofmeasure.org/) is used or a custom value as recommended in section https://docs.ogc.org/cs/21-069r2/21-069r2.pdf#%5B%7B%22num%22%3A3041%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C99.212%2C338.319%2Cnull%5D
132
+ */
133
+ export type UnitSymbol =
134
+ | string
135
+ | { value: string; type: "http://www.opengis.net/def/uom/UCUM" | string };
136
+
137
+ /**
138
+ * @description Parameter group objects represent logical groups of parameters, for example vector quantities
139
+ * A parameter group object MUST have either or both the members "label" or/and "observedProperty".
140
+ */
141
+ export type ParameterGroup =
142
+ & {
143
+ /** MAY have any number of name/value pairs */
144
+ [key: string]: any;
145
+ /**MUST have member with name "type" and value "ParameterGroup" */
146
+ type: "ParameterGroup";
147
+
148
+ label?: I18N;
149
+ /**MAY have member "id" where value MUST be a string and SHOULD be a common identifier */
150
+ id?: string;
151
+ /**MAY have a member with the name "description" where the value MUST be an i18n object which is a, perhaps lengthy, textual description of the parameter group */
152
+ description?: I18N;
153
+ /**
154
+ * A parameter group object MUST have a member with the name "members" where the
155
+ * value is a non-empty array of parameter identifiers (see 6.3 Coverage objects).
156
+ */
157
+ members?: [string, ...string[]];
158
+ }
159
+ & (
160
+ | {
161
+ /**MAY have a member with the name "observedProperty" where the value is an object as specified for parameter objects */
162
+ observedProperty: ObservedProperty;
163
+ }
164
+ | {
165
+ /**
166
+ * MAY have member "label" which MUST be a i18n object and which SHOULD be short.
167
+ * Note that this SHOULD be left out if it would be identical to the "label" of the "observedProperty" member
168
+ */
169
+ label: I18N;
170
+ }
171
+ | {
172
+ observedProperty: ObservedProperty;
173
+ label: I18N;
174
+ }
175
+ );
176
+
177
+ /**
178
+ * @section 9.5
179
+ * @description Reference system objects are used to provide information about how to interpret coordinate
180
+ * values within the domain. Coordinates are usually geospatial or temporal in nature, but may also
181
+ * be categorical (based on identifiers). All reference system objects MUST have a member "type",
182
+ * the possible values of which are given in the sections below. Custom values MAY be used as
183
+ * detailed in the Extensions section.
184
+ */
185
+ export type ReferenceSystemObject =
186
+ | SpatialReferenceSystem
187
+ | IdentifierBasedReferenceSystem
188
+ | TemporalReferenceSystem;
189
+
190
+ export interface SpatialReferenceSystem {
191
+ [key: string]: any;
192
+ /**value of type MUST be "GeographicCRS" or "ProjectedCRS" or "VerticalCRS" */
193
+ type: "GeographicCRS" | "ProjectedCRS" | "VerticalCRS";
194
+ /**
195
+ * MAY have an id member whose value MUST be a string and SHOULD be a common identifier for the reference system
196
+ * Note that sometimes (e.g. for numerical model data) the exact CRS may not be known or may
197
+ * be undefined. In this case the "id" may be omitted, but the "type" still indicates that this is a
198
+ * geographic CRS
199
+ */
200
+ id?: string;
201
+ /**MAY have a "description" member which must be an i18n object but no standardized content is interpreted from this description */
202
+ description?: I18N;
203
+ }
204
+
205
+ /**
206
+ * If the calendar is based on years, months, days, then the referenced values SHOULD use
207
+ * one of the following ISO8601-based lexical representations:
208
+ * • YYYY
209
+ * • ±XYYYY (where X stands for extra year digits)
210
+ * • YYYY-MM
211
+ * • YYYY-MM-DD
212
+ * • YYYY-MM-DDTHH:MM:SS[.F]Z where Z is either “Z” or a time scale offset +|-HH:MM
213
+ * • If calendar dates with reduced precision are used in a lexical representation (e.g. "2016"),
214
+ * then a client SHOULD interpret those dates in that reduced precision.
215
+ * • If "type" is "TemporalRS" and "calendar" is "Gregorian", then the above lexical
216
+ * representation MUST be used
217
+ */
218
+ export interface TemporalReferenceSystem {
219
+ /** MUST have member "type". The only currently defined value of it is "TemporalRS" */
220
+ type: "TemporalRS";
221
+ /**
222
+ * MUST have member "calendar" with value "Gregorian" or an URI
223
+ * If Gregorian calendar is used, then "calendar" MUST have value "Gregorian" and cannot be an URI
224
+ */
225
+ calendar: "Gregorian" | string;
226
+ /**
227
+ * MAY have member "timeScale" with a URI as value
228
+ * If omitted, the timeScale defaults to UTC @external http://www.opengis.net/def/trs/BIPM/0/UTC.
229
+ * If timeScale is UTC, then "timeScale" member MUST be omitted
230
+ */
231
+ timeScale?: "UTC" | string;
232
+ }
233
+
234
+ /**
235
+ * @section 9.5.2
236
+ */
237
+
238
+ export interface IdentifierBasedReferenceSystem {
239
+ /**MUST have member "type" with value "IdentifierRS" */
240
+ type: "IdentifierRS";
241
+ /**MAY have member "id" where value MUST be a string and SHOULD be a common identifier for the RS */
242
+ id?: string;
243
+ /**MAY have member "label" which must be i18n */
244
+ label?: I18N;
245
+ targetConcept?: TargetConcept;
246
+ /**MAY have member "identifiers" where value is an object where each key is an identifier referenced by the identifierRS and each value is an object describing the referenced concept equal to "targetConcept" */
247
+ identifiers?: {
248
+ [key: string]: TargetConcept;
249
+ };
250
+ }
251
+ /**
252
+ * TargetConcept
253
+ * MAY have member "targetConcept" where value is an object that MUST have member "label" and MAY have member "description"
254
+ */
255
+ export interface TargetConcept {
256
+ label: I18N;
257
+ description?: I18N;
258
+ /**Not listed in the requirements but present in examples */
259
+ id?: string;
260
+ }
261
+ /**
262
+ * @description A domain object is a CoverageJSON object which defines a set of positions and their extent in one or more referencing systems.
263
+ * For interoperability reasons it is RECOMMENDED that a domain object has the
264
+ * member "domainType" with a string value to indicate that the domain follows a certain
265
+ * structure (e.g. a time series, a vertical profile, a spatio-temporal 4D grid). See the section
266
+ * Common Domain Types for details. Custom domain types may be used as recommended
267
+ * in the section Extensions
268
+ */
269
+
270
+ export interface DomainObject {
271
+ /** value of "type" MUST be "Domain" */
272
+ type: "Domain";
273
+
274
+ domainType: DomainTypes;
275
+ /**
276
+ * MUST have member "axes" which has as value an object where each key is an axis identifier and each value an axis object
277
+ * member "axes" MUST NOT be empty
278
+ */
279
+ axes: Domain["axes"];
280
+ /**
281
+ * MAY have member "referencing" where value is an an array of reference system connection objects
282
+ * MUST have "referencing" if the domain object is not part of a coverage collection or if the coverage collection does not have a "referencing" member.
283
+ */
284
+ referencing?: ReferenceSystemConnection[];
285
+ }
286
+
287
+ /**
288
+ * A reference system connection object creates a link between values within domain axes and a
289
+ * reference system to be able to interpret those values, e.g. as coordinates in a certain coordinate reference system.
290
+ */
291
+ export interface ReferenceSystemConnection {
292
+ /** MUST have member "coordinates" which has as value an array of coordinate identifiers that are referenced in this object
293
+ * Depending on type of referencing, the ordering of the identifiers MAY be relevant e.g. for 2D/3D CRS. In this case, the order of the identifiers MUST match the order of axes in the CRS
294
+ */
295
+ coordinates: string[];
296
+ /**
297
+ * A reference system connection MUST have a member "system" whose value MUST be a Reference System Object
298
+ */
299
+ system: ReferenceSystemObject;
300
+ }
301
+
302
+ export interface AxisObject {
303
+ /**
304
+ * An axis object MAY have axis value bounds defined in the member "bounds" where the
305
+ * value is an array of values of length len*2 with len being the length of the "values"
306
+ * array. For each axis value at array index i in the "values" array, a lower and upper
307
+ * bounding value at positions 2*i and 2*i+1, respectively, are given in the bounds array.
308
+ * If a domain axis object has no "bounds" member, then a bounds array MAY be derived automatically
309
+ */
310
+ bounds?: number[];
311
+ }
312
+ /**
313
+ * The values of "start" and "stop" MUST be numbers, and the value of "num" an integer
314
+ * greater than zero. If the value of "num" is 1, then "start" and "stop" MUST have
315
+ * identical values. For num > 1, the array elements of "values" MAY be reconstructed with
316
+ * the formula start + i * step where i is the ith element and in the interval [0, num-1]
317
+ * and step = (stop - start) / (num - 1). If num = 1 then "values" is [start]. Note
318
+ * that "start" can be greater than "stop" in which case the axis values are descending
319
+ * @todo review the usage of the RegularlySpacedAxis in a future Commit
320
+ */
321
+ export interface RegularlySpacedAxis {
322
+ start: number;
323
+ stop: number;
324
+ num: number;
325
+ }
326
+
327
+ export interface NdArrayObject {
328
+ type: "NdArray";
329
+ /**
330
+ * An NdArray object MAY have a member with the name "shape" where the value is an array of integers. For 0D arrays, "shape" MAY be omitted (defaulting to []). For >= 1D arrays it MUST be included.
331
+ * Where "shape" is present and non-empty, the product of its values MUST equal the number of elements in the "values" array.
332
+ */
333
+ shape?: number[];
334
+ /**
335
+ * MAY have a member with the name "axisNames" where the value is an array of strings of the same length as "shape", such that each string assigns a name to the corresponding dimension. For 0D arrays, "axisNames" MAY be omitted (defaulting to
336
+ * []). For >= 1D arrays it MUST be included.
337
+ */
338
+ axisNames?: string[];
339
+ }
340
+ /**
341
+ * A CoverageJSON object with the type "NdArray" is an NdArray object. It represents a multidimensional (>= 0D) array with named axes, encoded as a flat, one-dimensional JSON array in row-major order.
342
+ */
343
+ export type NdArray = StringNdArray | NumberNdArray | TiledNdArray;
344
+
345
+ export interface NumberNdArray extends NdArrayObject {
346
+ /**
347
+ * MUST have member with the name "values" where value is a non-empty array of numbers and nulls, or strings and nulls where nulls represent missing data
348
+ * 0D NdArrays must have exactly one item in the "values" array
349
+ * Within the "values" array, the elements MUST be ordered such that the last dimension in "axisNames" varies fastest, i.e. row-major order. (This mimics the approach taken in NetCDF; see the example below.)
350
+ * Note that common JSON implementations use IEEE 754-2008 64-bit (double precision) floating point numbers as the data type for "values". Users SHOULD be aware of the
351
+ * limitations in precision when encoding numbers in this way. For example, when encoding integers, users SHOULD be aware that only values within the range [-253+1, 253-1] can be represented in a way that will ensure exact interoperability among such implementations
352
+ * [IETF RFC 7159] @external https://datatracker.ietf.org/doc/html/rfc7159
353
+ */
354
+ values: [number | null, ...(number | null)[]];
355
+ /**
356
+ * MUST have member with name "dataType" where value is either "float", "integer" or "string"
357
+ * MUST correspond to the data type of non-null values in "values" array
358
+ */
359
+ dataType: "integer" | "float";
360
+ }
361
+ /**See above */
362
+ export interface StringNdArray extends NdArrayObject {
363
+ dataType: "string";
364
+ values: [string | null, ...(string | null)[]];
365
+ }
366
+
367
+ /**
368
+ * @description A CoverageJSON object with the type "TiledNdArray" is a TiledNdArray object. It represents
369
+ a multidimensional (>= 1D) array with named axes that is split up into sets of linked NdArray
370
+ OPEN GEOSPATIAL CONSORTIUM 21-069R2 35
371
+ documents. Each tileset typically covers a specific data access scenario, for example, loading a
372
+ single time slice of a grid vs. loading a time series of a spatial subset of a grid
373
+ */
374
+ export interface TiledNdArray {
375
+ type: "TiledNdArray";
376
+ dataType: "float" | "string" | "integer";
377
+ /**
378
+ * A TiledNdArray object MUST have a member with the name "shape" where the value is a non-empty array of integers
379
+ */
380
+ shape: [number, ...number[]];
381
+ /**MUST have member "tileSets" where value is a non-empty array of TileSet objects */
382
+ tileSets: [TileSet, ...TileSet[]];
383
+ /**
384
+ * A TiledNdArray object MUST have a member with the name "axisNames" where the value is a string array of the same length as "shape"
385
+ */
386
+ axisNames: string[];
387
+ }
388
+
389
+ /**
390
+ * @description
391
+ */
392
+ export interface TileSet {
393
+ /**
394
+ * MUST have member "tileShape" where value is an array of same length as "shape"
395
+ * and where each array element is either null or an integer lower or equal than the corresponding element in "shape"
396
+ * A null value denotes that the axis is not tiled
397
+ */
398
+ tileShape: (number | null)[];
399
+ /**
400
+ * MUST have member "urlTemplate" where value is a Level 1 URI template as defined in RFC 6570 @external https://tools.ietf.org/html/rfc6570
401
+ * The URI template MUST contain a variable for each axis name whose corresponding element in "tileShape" is not null
402
+ * A variable for an axis of total size totalSize (from "shape") and tile size tileSize (from "tileShape") and has as value one of the integers 0, 1, …, q + r - 1 where q and r are the quotient and remainder obtained by dividing totalSize by tileSize
403
+ * Each URI that can be generated from the URI template MUST resolve to an NdArray CoverageJSON document where the members "dataType" and "axisNames`" are identical to the ones of the
404
+ * TiledNdArray object, and where each value of `"shape" is an integer equal, or lower if an edge tile, to the corresponding element in "tileShape" while replacing null with the corresponding element of "shape" of the TiledNdArray.
405
+ */
406
+ urlTemplate: string;
407
+ }
408
+
409
+ /**
410
+ * @section 9.6.4
411
+ * A CoverageJSON object with the type "Coverage" is a coverage object
412
+ */
413
+ export interface Coverage<D extends Domain = Domain> {
414
+ /** */
415
+ type: "Coverage";
416
+
417
+ /**Common identifier SHOULD be included if possible */
418
+ id?: string;
419
+ /**
420
+ * MUST have member "domain" where value is either a domain object or a URL
421
+ */
422
+ domain: D | string;
423
+ /**
424
+ * If the value of "domain" is a URL and the referenced domain has a "domainType" member, * then the coverage object SHOULD have the member "domainType" where the value MUST equal that of the referenced domain
425
+ * If the coverage object is part of a coverage collection which has a "domainType" member then that member SHOULD be omitted in the coverage object.
426
+ */
427
+ domainType?: Domain["domainType"];
428
+ /**
429
+ * A coverage object MAY have a member with the name "parameters" where the value is an object where each member has as name a short identifier and as value a parameter
430
+ * object. The identifier corresponds to the commonly known concept of “variable name” and
431
+ * is merely used in clients for conveniently accessing the corresponding range object.
432
+ * A coverage object MUST have a "parameters" member if the coverage object is not part of a coverage collection or if the coverage collection does not have a "parameters" member.
433
+ */
434
+ parameters?: { [key: string]: Parameter };
435
+ /**
436
+ * A coverage object MAY have a member with the name "parameterGroups" where the value is an array of ParameterGroup objects.
437
+ */
438
+ parameterGroups?: ParameterGroup[];
439
+ /**
440
+ * A coverage object MUST have a member with the name "ranges" where the value is a range set object.
441
+ * Any member of a range set object has as name any of the names in a "parameters" object in scope and as value either an NdArray or TiledNdArray object or
442
+ * a URL resolving to a CoverageJSON document of such object. A "parameters" member
443
+ * in scope is either within the enclosing coverage object or, if part of a coverage collection,
444
+ * in the parent coverage collection object. The shape and axis names of each NdArray
445
+ * or TiledNdArray object MUST correspond to the domain axes defined by "domain",
446
+ * while single-valued axes MAY be omitted. If the referenced parameter object has a
447
+ * "categoryEncoding" member, then each non-null array element of the "values" member
448
+ * of the NdArray object, or the linked NdArray objects within a TiledNdArray object,
449
+ * MUST be equal to one of the values defined in the "categoryEncoding" object and be interpreted as the matching category
450
+ */
451
+ ranges: Ranges;
452
+ }
453
+
454
+ export interface Ranges {
455
+ [key: string]: NdArray;
456
+ }
457
+
458
+ /**
459
+ * @section 9.6.5
460
+ * @description A CoverageJSON object with the type "CoverageCollection" is a coverage collection object.
461
+ */
462
+
463
+ export interface CoverageCollection<C extends Coverage = Coverage> {
464
+ type: "CoverageCollection";
465
+ /**
466
+ * A coverage collection object MAY have the member "domainType" with a string value to indicate that the coverage collection only contains coverages of the given domain type.
467
+ * See the section Common Domain Types for details. Custom domain types may be used as recommended in the section Extensions @external https://docs.ogc.org/cs/21-069r2/21-069r2.pdf#%5B%7B%22num%22%3A3041%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C99.212%2C338.319%2Cnull%5D
468
+ */
469
+ domainType?: Domain["domainType"];
470
+ /**
471
+ * MUST have a member "coverages"
472
+ * The value corresponding to "coverages" is an array. Each element in the array is a coverage object as defined above
473
+ */
474
+ coverages: Array<C>;
475
+ /**
476
+ * A coverage collection object MAY have a member with the name "parameters" where the value is an object where each member has as name a short identifier and as value a parameter object.
477
+ */
478
+ parameters?: { [key: string]: Parameter };
479
+ /**
480
+ * A coverage collection object MAY have a member with the name "parameterGroups" where the value is an array of ParameterGroup objects.
481
+ */
482
+ parameterGroups?: ParameterGroup[];
483
+ /**
484
+ * A coverage collection object MAY have a member with t he name "referencing" where the value is an array of reference system connection objects
485
+ */
486
+ referencing?: ReferenceSystemConnection[];
487
+ }
488
+
489
+ /**
490
+ * @section 9.7 Extensions
491
+ * A CoverageJSON document can be extended with custom members and types in a robust and
492
+ interoperable way. For that, it makes use of absolute URIs and compact URIs (prefix:suffix)
493
+ in order to avoid conflicts with other extensions and future versions of the format. A central
494
+ registry of compact URI prefixes is provided which anyone can extend and which is a simple
495
+ mapping from compact URI prefix to namespace URI in order to avoid collisions with other
496
+ extensions that are based on compact URIs as well. Extensions that do not follow this
497
+ approach MAY use simple names instead of absolute or compact URIs but have to accept the
498
+ consequence of the document being less interoperable and future-proof. In certain use cases
499
+ this is not an issue and may be a preferred solution for simplicity reasons, for example, if such
500
+ CoverageJSON documents are only used internally and are not meant to be shared to a wider
501
+ audience.
502
+ */
503
+
504
+ /**
505
+ * MUST have the axes "x","y"
506
+ * MAY have axes "z" and "t"
507
+ * The usage of regularlyspacedaxis is subject to change
508
+ */
509
+ export interface Grid extends DomainObject {
510
+ domainType: "Grid";
511
+ axes: {
512
+ x: { values: number[] } | RegularlySpacedAxis;
513
+ y: { values: number[] } | RegularlySpacedAxis;
514
+ z?: { values: number[] };
515
+ t?: { values: string[] };
516
+ };
517
+ }
518
+ /**
519
+ * @section 9.10.2
520
+ * A domain with VerticalProfile domain type MUST have the axes "x", "y", and "z", where "x" and "y" MUST have a single coordinate value only.
521
+ */
522
+ export interface VerticalProfile extends DomainObject {
523
+ domainType: "VerticalProfile";
524
+ axes: {
525
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
526
+ x: { values: [number] };
527
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
528
+ y: { values: [number] };
529
+ z: { values: number[] };
530
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
531
+ t?: { values: [string] };
532
+ };
533
+ }
534
+ /**
535
+ * @section 9.10.3
536
+ * A domain with PointSeries domain type MUST have the axes "x", "y", and "t" where "x" and "y" MUST have a single coordinate value only.
537
+ * A domain with PointSeries domain type MAY have the axis "z" which MUST have a single coordinate value only.
538
+ */
539
+ export interface PointSeries extends DomainObject {
540
+ domainType: "PointSeries";
541
+ axes: {
542
+ dataType?: "primitive";
543
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
544
+ x: { values: [number] };
545
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
546
+ y: { values: [number] };
547
+ t: { values: string[] };
548
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
549
+ z?: { values: [number] };
550
+ };
551
+ }
552
+
553
+ /**
554
+ * @section 9.10.4
555
+ * A domain with Point domain type MUST have the axes "x" and "y" and MAY have the axes "z" and "t" where all MUST have a single coordinate value only.
556
+ */
557
+ export interface Point extends DomainObject {
558
+ domainType: "Point";
559
+ axes: {
560
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
561
+ x: { values: [number] };
562
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
563
+ y: { values: [number] };
564
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
565
+ z?: { values: [number] };
566
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
567
+ t?: { values: [string] };
568
+ };
569
+ }
570
+ export type Position = [number, number] | [number, number, number];
571
+ /**
572
+ * @section 9.10.5
573
+ * A domain with MultiPointSeries domain type MUST have the axes "composite" and "t".
574
+ * The axis "composite" MUST have the data type "tuple" and the coordinate identifiers "x","y","z" or "x","y", in that order.
575
+ */
576
+
577
+ export interface MultiPointSeries extends DomainObject {
578
+ domainType: "MultiPointSeries";
579
+ axes: {
580
+ composite: {
581
+ dataType: "tuple";
582
+ coordinates: ["x", "y"] | ["x", "y", "z"];
583
+ /**Essentially Multipoint coordinates */
584
+ values: Position[];
585
+ };
586
+ t: { values: string[] };
587
+ };
588
+ }
589
+
590
+ /**
591
+ * @section 9.10.6 MultiPoint
592
+ * domain with MultiPoint domain type MUST have the axis "composite" and MAY have the axis "t" where "t" MUST have a single coordinate value only.
593
+ * The axis "composite" MUST have the data type "tuple" and the coordinate identifiers "x","y","z" or "x","y", in that order
594
+ */
595
+ export interface MultiPoint extends DomainObject {
596
+ domainType: "MultiPoint";
597
+ axes: {
598
+ composite: {
599
+ dataType: "tuple";
600
+ values: Position[];
601
+ coordinates: ["x", "y"] | ["x", "y", "z"];
602
+ };
603
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
604
+ t?: { values: [string] };
605
+ };
606
+ }
607
+
608
+ /**
609
+ * @section 9.10.7
610
+ * A domain with Trajectory domain type MUST have the axis "composite" and MAY have the axis "z" where "z" MUST have a single coordinate value only.
611
+ • The axis "composite" MUST have the data type "tuple" and the coordinate identifiers "t","x","y","z" or "t","x","y", in that order.
612
+ • The value ordering of the axis "composite" MUST follow the ordering of its "t" coordinate as defined in the corresponding reference system
613
+ */
614
+ export interface Trajectory extends DomainObject {
615
+ domainType: "Trajectory";
616
+ axes: {
617
+ composite: {
618
+ dataType: "tuple";
619
+ coordinates: ["t", "x", "y"] | ["t", "x", "y", "z"];
620
+ values: [string, number, number][] | [string, number, number, number][];
621
+ };
622
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
623
+ z?: { values: [number] };
624
+ };
625
+ }
626
+
627
+ /**
628
+ * @section 9.10.8
629
+ * A domain with Section domain type MUST have the axes "composite" and "z".
630
+ * The axis "composite" MUST have the data type "tuple" and the coordinate identifiers "t","x","y", in that order.
631
+ * The value ordering of the axis "composite" MUST follow the ordering of its "t" coordinate as defined in the corresponding reference system
632
+ */
633
+ export interface Section extends DomainObject {
634
+ domainType: "Section";
635
+ axes: {
636
+ composite: {
637
+ dataType: "tuple";
638
+ coordinates: ["t", "x", "y"];
639
+ values: [string, number, number][];
640
+ };
641
+ z: { values: number[] };
642
+ };
643
+ }
644
+
645
+ /**
646
+ * Section 9.10.9 Polygon
647
+ * Polygons in this domain domain type are defined equally to GeoJSON, except that they can only contain [x,y] positions (and not z or additional coordinates):
648
+ * A LinearRing is an array of 4 or more [x,y] arrays where each of x and y is a coordinate value. The first and last [x,y] elements are identical.
649
+ * A Polygon is an array of LinearRing arrays. For Polygons with multiple rings, the first MUST be the exterior ring and any others MUST be interior rings or holes.
650
+ *
651
+ * A domain with Polygon domain type MUST have the axis "composite" which has a single Polygon value.
652
+ * The axis "composite" MUST have the data type "polygon" and the coordinate identifiers "x","y", in that order.
653
+ • A Polygon domain MAY have the axes "z" and "t" which both MUST have a single coordinate value only
654
+ */
655
+
656
+ export interface Polygon extends DomainObject {
657
+ domainType: "Polygon";
658
+ axes: {
659
+ composite: {
660
+ dataType: "polygon";
661
+ coordinates: ["x", "y"];
662
+ values: [number, number][][][];
663
+ };
664
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
665
+ z?: { values: [number] };
666
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
667
+ t?: { values: [string] };
668
+ };
669
+ }
670
+
671
+ /**
672
+ * Section 9.10.10 PolygonSeries
673
+ * A domain with PolygonSeries domain type MUST have the axes "composite" and "t" where "composite" MUST have a single Polygon value. Polygons are defined in the Polygon domain type.
674
+ * A domain with PolygonSeries domain type MAY have the axis "z" which MUST have a single coordinate value only.
675
+ * The axis "composite" MUST have the data type "polygon" and the coordinate identifiers "x","y", in that order
676
+ */
677
+
678
+ export interface PolygonSeries extends DomainObject {
679
+ domainType: "PolygonSeries";
680
+ axes: {
681
+ composite: {
682
+ dataType: "polygon";
683
+ coordinates: ["x", "y"];
684
+ values: [number, number][][][];
685
+ };
686
+ t: { values: string[] };
687
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
688
+ z?: { values: [number] };
689
+ };
690
+ }
691
+
692
+ /**
693
+ * Section 9.10.11
694
+ * A domain with MultiPolygon domain type MUST have the axis "composite" where the values are Polygons. Polygons are defined in the Polygon domain type.
695
+ * The axis "composite" MUST have the data type "polygon" and the coordinate identifiers "x","y", in that order.
696
+ * A MultiPolygon domain MAY have the axes "z" and "t" which both MUST have a single coordinate value only
697
+ */
698
+
699
+ export interface MultiPolygon extends DomainObject {
700
+ domainType: "MultiPolygon";
701
+ axes: {
702
+ composite: {
703
+ dataType: "polygon";
704
+ coordinates: ["x", "y"];
705
+ values: [number, number][][][];
706
+ };
707
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
708
+ t?: { values: [string] };
709
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
710
+ z?: { values: [number] };
711
+ };
712
+ }
713
+
714
+ /**
715
+ * Section 9.10.12 MultiPolygonSeries
716
+ * A domain with MultiPolygonSeries domain type MUST have the axes "composite" and "t" where the values of "composite" are Polygons. Polygons are defined in the Polygon domain type.
717
+ * The axis "composite" MUST have the data type "polygon" and the coordinate identifiers "x","y", in that order.
718
+ * A MultiPolygon domain MAY have the axis "z" which MUST have a single coordinate value only
719
+ */
720
+ export interface MultiPolygonSeries extends DomainObject {
721
+ domainType: "MultiPolygonSeries";
722
+ axes: {
723
+ composite: {
724
+ dataType: "polygon";
725
+ coordinates: ["x", "y"];
726
+ values: [number, number][][][];
727
+ };
728
+ t: { values: string[] };
729
+ // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type
730
+ z?: { values: [number] };
731
+ };
732
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@types/coveragejson",
3
+ "version": "1.0.0",
4
+ "description": "TypeScript definitions for coveragejson",
5
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/coveragejson",
6
+ "license": "MIT",
7
+ "contributors": [
8
+ {
9
+ "name": "Edwin Gichuru",
10
+ "githubUsername": "murithigeo",
11
+ "url": "https://github.com/murithigeo"
12
+ }
13
+ ],
14
+ "main": "",
15
+ "types": "index.d.ts",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
19
+ "directory": "types/coveragejson"
20
+ },
21
+ "scripts": {},
22
+ "dependencies": {},
23
+ "peerDependencies": {},
24
+ "typesPublisherContentHash": "668492160c0dd4ef0dee652c8aad3e4451ed4599cb228d3e2b9268d0197d91f7",
25
+ "typeScriptVersion": "5.0",
26
+ "nonNpm": true
27
+ }