@@ -40,14 +40,29 @@ export interface ApiVersion {
40
40
apiVersion ?: string ;
41
41
}
42
42
43
+ /**
44
+ * True if the value is only an estimation; false otherwise.
45
+ */
46
+ export type Estimated = boolean ;
47
+
48
+ export type GetFeaturesBySpatialBody =
49
+ | Feature
50
+ | FeatureCollection
51
+ | Geometry
52
+ | LineString
53
+ | MultiLineString
54
+ | MultiPoint
55
+ | MultiPolygon
56
+ | Point
57
+ | Polygon ;
58
+
43
59
export interface Feature extends GeoJSON {
44
60
/**
45
61
* The unique identifier of the feature.
46
62
*/
47
63
id ?: string ;
48
- geometry ?: GeoJSON ;
64
+ geometry ?: Geometry ;
49
65
properties ?: { [ key : string ] : any } ;
50
- features ?: Array < Feature > ;
51
66
}
52
67
53
68
export interface FeatureCollection extends GeoJSON {
@@ -92,21 +107,45 @@ export interface GeoJSON {
92
107
* Describes the coordinate range of the GeoJSON object.
93
108
*/
94
109
bbox ?: Array < number > ;
95
- coordinates ?:
96
- | LineString
97
- | MultiLineString
98
- | MultiPoint
99
- | MultiPolygon
100
- | Point
101
- | Polygon ;
102
110
}
103
111
104
- export type LineString = Array < Array < number > > ;
105
- export type MultiLineString = Array < Array < Array < number > > > ;
106
- export type MultiPoint = Array < Array < number > > ;
107
- export type MultiPolygon = Array < Array < Array < Array < number > > > > ;
108
- export type Point = Array < number > ;
109
- export type Polygon = Array < Array < Array < number > > > ;
112
+ /**
113
+ * A Geometry object represents points, curves, and surfaces in coordinate layer.
114
+ */
115
+ export interface Geometry extends GeoJSON { }
116
+
117
+ export interface LineString extends Geometry {
118
+ coordinates ?: Array < Array < number > > ;
119
+ }
120
+
121
+ export interface ModelError {
122
+ title ?: string ;
123
+ status ?: number ;
124
+ code ?: string ;
125
+ cause ?: string ;
126
+ action ?: string ;
127
+ correlationId ?: string ;
128
+ }
129
+
130
+ export interface MultiLineString extends Geometry {
131
+ coordinates ?: Array < Array < Array < number > > > ;
132
+ }
133
+
134
+ export interface MultiPoint extends Geometry {
135
+ coordinates ?: Array < Array < number > > ;
136
+ }
137
+
138
+ export interface MultiPolygon extends Geometry {
139
+ coordinates ?: Array < Array < Array < Array < number > > > > ;
140
+ }
141
+
142
+ export interface Point extends Geometry {
143
+ coordinates ?: Array < number > ;
144
+ }
145
+
146
+ export interface Polygon extends Geometry {
147
+ coordinates ?: Array < Array < Array < number > > > ;
148
+ }
110
149
111
150
export interface Statistics {
112
151
count ?: StatisticsCount ;
@@ -120,22 +159,22 @@ export interface Statistics {
120
159
121
160
export interface StatisticsBbox {
122
161
value ?: Array < number > ;
123
- estimated ?: boolean ;
162
+ estimated ?: Estimated ;
124
163
}
125
164
126
165
export interface StatisticsCount {
127
166
value ?: number ;
128
- estimated ?: boolean ;
167
+ estimated ?: Estimated ;
129
168
}
130
169
131
170
export interface StatisticsGeometryTypes {
132
171
value ?: Array < string > ;
133
- estimated ?: boolean ;
172
+ estimated ?: Estimated ;
134
173
}
135
174
136
175
export interface StatisticsProperties {
137
176
value ?: Array < StatisticsPropertiesValue > ;
138
- estimated ?: boolean ;
177
+ estimated ?: Estimated ;
139
178
}
140
179
141
180
export interface StatisticsPropertiesValue {
@@ -146,7 +185,7 @@ export interface StatisticsPropertiesValue {
146
185
147
186
export interface StatisticsTags {
148
187
value ?: Array < StatisticsTagsValue > ;
149
- estimated ?: boolean ;
188
+ estimated ?: Estimated ;
150
189
}
151
190
152
191
export interface StatisticsTagsValue {
@@ -212,7 +251,7 @@ export async function getFeature(
212
251
params : {
213
252
layerId : string ;
214
253
featureId : string ;
215
- selection ?: string ;
254
+ selection ?: string | Array < string > ;
216
255
force2D ?: boolean ;
217
256
}
218
257
) : Promise < Feature > {
@@ -257,8 +296,8 @@ export async function getFeatures(
257
296
builder : RequestBuilder ,
258
297
params : {
259
298
layerId : string ;
260
- id : string ;
261
- selection ?: string ;
299
+ id : string | string [ ] ;
300
+ selection ?: string | Array < string > ;
262
301
force2D ?: boolean ;
263
302
}
264
303
) : Promise < FeatureCollection > {
@@ -389,14 +428,14 @@ export async function getFeaturesByBBox(
389
428
builder : RequestBuilder ,
390
429
params : {
391
430
layerId : string ;
392
- bbox ?: string ;
431
+ bbox ?: Array < number > ;
393
432
clip ?: boolean ;
394
433
limit ?: number ;
395
- params ?: string ;
396
- selection ?: string ;
434
+ params ?: { [ key : string ] : string | number } ;
435
+ selection ?: string | Array < string > ;
397
436
skipCache ?: boolean ;
398
437
clustering ?: string ;
399
- clusteringParams ?: string ;
438
+ clusteringParams ?: { [ key : string ] : string | number } ;
400
439
force2D ?: boolean ;
401
440
}
402
441
) : Promise < FeatureCollection > {
@@ -407,14 +446,23 @@ export async function getFeaturesByBBox(
407
446
408
447
const urlBuilder = new UrlBuilder ( builder . baseUrl + baseUrl ) ;
409
448
urlBuilder . appendQuery ( "bbox" , params [ "bbox" ] ) ;
410
- urlBuilder . appendQuery ( "clip" , "true" ) ;
449
+ urlBuilder . appendQuery ( "clip" , params [ "clip" ] ) ;
411
450
urlBuilder . appendQuery ( "limit" , params [ "limit" ] ) ;
412
451
urlBuilder . appendQuery ( "params" , params [ "params" ] ) ;
413
452
urlBuilder . appendQuery ( "selection" , params [ "selection" ] ) ;
414
- urlBuilder . appendQuery ( "skipCache" , "true" ) ;
453
+ urlBuilder . appendQuery ( "skipCache" , params [ "skipCache" ] ) ;
415
454
urlBuilder . appendQuery ( "clustering" , params [ "clustering" ] ) ;
416
- urlBuilder . appendQuery ( "clusteringParams" , params [ "clusteringParams" ] ) ;
417
- urlBuilder . appendQuery ( "force2D" , "true" ) ;
455
+
456
+ if ( params [ "clusteringParams" ] ) {
457
+ for ( const clusteringParam in params [ "clusteringParams" ] ) {
458
+ urlBuilder . appendQuery (
459
+ `clustering.${ clusteringParam } ` ,
460
+ params [ "clusteringParams" ] [ clusteringParam ]
461
+ ) ;
462
+ }
463
+ }
464
+
465
+ urlBuilder . appendQuery ( "force2D" , params [ "force2D" ] ) ;
418
466
419
467
const headers : { [ header : string ] : string } = { } ;
420
468
const options : RequestOptions = {
@@ -509,8 +557,8 @@ export async function getFeaturesBySpatial(
509
557
refFeatureId ?: string ;
510
558
radius ?: number ;
511
559
limit ?: number ;
512
- params ?: string ;
513
- selection ?: string ;
560
+ params ?: { [ key : string ] : string | number } ;
561
+ selection ?: string | Array < string > ;
514
562
skipCache ?: boolean ;
515
563
force2D ?: boolean ;
516
564
}
@@ -606,11 +654,11 @@ export async function getFeaturesBySpatialPost(
606
654
builder : RequestBuilder ,
607
655
params : {
608
656
layerId : string ;
609
- body ?: GeoJSON ;
657
+ body ?: GetFeaturesBySpatialBody ;
610
658
radius ?: number ;
611
659
limit ?: number ;
612
- params ?: string ;
613
- selection ?: string ;
660
+ params ?: { [ key : string ] : string | number } ;
661
+ selection ?: string | Array < string > ;
614
662
skipCache ?: boolean ;
615
663
force2D ?: boolean ;
616
664
}
@@ -760,11 +808,11 @@ export async function getFeaturesByTile(
760
808
tileType : string ;
761
809
tileId : string ;
762
810
clip ?: boolean ;
763
- params ?: string ;
764
- selection ?: string ;
811
+ params ?: { [ key : string ] : string | number } ;
812
+ selection ?: string | Array < string > ;
765
813
skipCache ?: boolean ;
766
814
clustering ?: string ;
767
- clusteringParams ?: string ;
815
+ clusteringParams ?: { [ key : string ] : string | number } ;
768
816
margin ?: number ;
769
817
limit ?: number ;
770
818
force2D ?: boolean ;
@@ -782,7 +830,16 @@ export async function getFeaturesByTile(
782
830
urlBuilder . appendQuery ( "selection" , params [ "selection" ] ) ;
783
831
urlBuilder . appendQuery ( "skipCache" , params [ "skipCache" ] ) ;
784
832
urlBuilder . appendQuery ( "clustering" , params [ "clustering" ] ) ;
785
- urlBuilder . appendQuery ( "clusteringParams" , params [ "clusteringParams" ] ) ;
833
+
834
+ if ( params [ "clusteringParams" ] ) {
835
+ for ( const clusteringParam in params [ "clusteringParams" ] ) {
836
+ urlBuilder . appendQuery (
837
+ `clustering.${ clusteringParam } ` ,
838
+ params [ "clusteringParams" ] [ clusteringParam ]
839
+ ) ;
840
+ }
841
+ }
842
+
786
843
urlBuilder . appendQuery ( "margin" , params [ "margin" ] ) ;
787
844
urlBuilder . appendQuery ( "limit" , params [ "limit" ] ) ;
788
845
urlBuilder . appendQuery ( "force2D" , params [ "force2D" ] ) ;
@@ -857,7 +914,7 @@ export async function iterateFeatures(
857
914
layerId : string ;
858
915
limit ?: number ;
859
916
pageToken ?: string ;
860
- selection ?: string ;
917
+ selection ?: string | Array < string > ;
861
918
skipCache ?: boolean ;
862
919
force2D ?: boolean ;
863
920
}
@@ -943,8 +1000,8 @@ export async function searchFeatures(
943
1000
params : {
944
1001
layerId : string ;
945
1002
limit ?: number ;
946
- params ?: string ;
947
- selection ?: string ;
1003
+ params ?: { [ key : string ] : string | number } ;
1004
+ selection ?: string | Array < string > ;
948
1005
skipCache ?: boolean ;
949
1006
force2D ?: boolean ;
950
1007
}
@@ -959,8 +1016,8 @@ export async function searchFeatures(
959
1016
urlBuilder . appendQuery ( "limit" , params [ "limit" ] ) ;
960
1017
urlBuilder . appendQuery ( "params" , params [ "params" ] ) ;
961
1018
urlBuilder . appendQuery ( "selection" , params [ "selection" ] ) ;
962
- urlBuilder . appendQuery ( "skipCache" , "true" ) ;
963
- urlBuilder . appendQuery ( "force2D" , "true" ) ;
1019
+ urlBuilder . appendQuery ( "skipCache" , params [ "skipCache" ] ) ;
1020
+ urlBuilder . appendQuery ( "force2D" , params [ "force2D" ] ) ;
964
1021
965
1022
const headers : { [ header : string ] : string } = { } ;
966
1023
const options : RequestOptions = {
0 commit comments