@nspot/geo-engine 0.3.0 → 0.5.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.
- package/README.md +74 -1
- package/dist/cli.js +2 -2
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/localities.d.ts +71 -0
- package/dist/localities.js +87 -0
- package/dist/packs.d.ts +14 -2
- package/dist/packs.js +10 -3
- package/dist/query.d.ts +13 -1
- package/dist/query.js +15 -0
- package/dist/types.d.ts +506 -26
- package/dist/types.js +52 -1
- package/package.json +1 -1
- package/sql/008_regions_bbox.sql +24 -0
- package/sql/009_localities.sql +665 -0
package/dist/types.d.ts
CHANGED
|
@@ -22,9 +22,12 @@ export type MultiPolygonGeometry = {
|
|
|
22
22
|
coordinates: Position[][][];
|
|
23
23
|
};
|
|
24
24
|
export type AreaGeometry = PolygonGeometry | MultiPolygonGeometry;
|
|
25
|
+
/** [west, south, east, north] in degrees: a GeoJSON `bbox` member, and what a map's fitBounds takes. */
|
|
26
|
+
export type Bbox = [west: number, south: number, east: number, north: number];
|
|
25
27
|
export type Feature<G = AreaGeometry, P = Record<string, unknown>> = {
|
|
26
28
|
type: "Feature";
|
|
27
29
|
id?: string | number;
|
|
30
|
+
bbox?: Bbox;
|
|
28
31
|
geometry: G;
|
|
29
32
|
properties: P;
|
|
30
33
|
};
|
|
@@ -61,7 +64,122 @@ export interface Region extends RegionSummary {
|
|
|
61
64
|
export declare const countryCodeSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
62
65
|
export declare const packSlugSchema: z.ZodString;
|
|
63
66
|
export declare const packVersionSchema: z.ZodString;
|
|
64
|
-
|
|
67
|
+
/**
|
|
68
|
+
* One locality of a pack (schema 9): a named point, keyed by `(country, code)`. Its geometry is
|
|
69
|
+
* a GeoJSON Point (the label point) or null, and exactly one of a point and a non-empty
|
|
70
|
+
* `point_gap` (the pack's reason for having none) is given.
|
|
71
|
+
*/
|
|
72
|
+
export declare const localityFeatureSchema: z.ZodEffects<z.ZodObject<{
|
|
73
|
+
type: z.ZodLiteral<"Feature">;
|
|
74
|
+
geometry: z.ZodNullable<z.ZodObject<{
|
|
75
|
+
type: z.ZodLiteral<"Point">;
|
|
76
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
77
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
78
|
+
type: z.ZodLiteral<"Point">;
|
|
79
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
80
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
81
|
+
type: z.ZodLiteral<"Point">;
|
|
82
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
83
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
84
|
+
properties: z.ZodObject<{
|
|
85
|
+
country: z.ZodEffects<z.ZodString, string, string>;
|
|
86
|
+
code: z.ZodString;
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
parent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
parent_country: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
|
|
90
|
+
point_gap: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
92
|
+
properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
code: string;
|
|
95
|
+
properties: Record<string, unknown>;
|
|
96
|
+
country: string;
|
|
97
|
+
name: string;
|
|
98
|
+
tags: string[];
|
|
99
|
+
parent?: string | null | undefined;
|
|
100
|
+
parent_country?: string | null | undefined;
|
|
101
|
+
point_gap?: string | null | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
code: string;
|
|
104
|
+
country: string;
|
|
105
|
+
name: string;
|
|
106
|
+
properties?: Record<string, unknown> | undefined;
|
|
107
|
+
parent?: string | null | undefined;
|
|
108
|
+
parent_country?: string | null | undefined;
|
|
109
|
+
point_gap?: string | null | undefined;
|
|
110
|
+
tags?: string[] | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
type: "Feature";
|
|
114
|
+
geometry: z.objectOutputType<{
|
|
115
|
+
type: z.ZodLiteral<"Point">;
|
|
116
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
117
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
118
|
+
properties: {
|
|
119
|
+
code: string;
|
|
120
|
+
properties: Record<string, unknown>;
|
|
121
|
+
country: string;
|
|
122
|
+
name: string;
|
|
123
|
+
tags: string[];
|
|
124
|
+
parent?: string | null | undefined;
|
|
125
|
+
parent_country?: string | null | undefined;
|
|
126
|
+
point_gap?: string | null | undefined;
|
|
127
|
+
};
|
|
128
|
+
}, {
|
|
129
|
+
type: "Feature";
|
|
130
|
+
geometry: z.objectInputType<{
|
|
131
|
+
type: z.ZodLiteral<"Point">;
|
|
132
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
133
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
134
|
+
properties: {
|
|
135
|
+
code: string;
|
|
136
|
+
country: string;
|
|
137
|
+
name: string;
|
|
138
|
+
properties?: Record<string, unknown> | undefined;
|
|
139
|
+
parent?: string | null | undefined;
|
|
140
|
+
parent_country?: string | null | undefined;
|
|
141
|
+
point_gap?: string | null | undefined;
|
|
142
|
+
tags?: string[] | undefined;
|
|
143
|
+
};
|
|
144
|
+
}>, {
|
|
145
|
+
type: "Feature";
|
|
146
|
+
geometry: z.objectOutputType<{
|
|
147
|
+
type: z.ZodLiteral<"Point">;
|
|
148
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
149
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
150
|
+
properties: {
|
|
151
|
+
code: string;
|
|
152
|
+
properties: Record<string, unknown>;
|
|
153
|
+
country: string;
|
|
154
|
+
name: string;
|
|
155
|
+
tags: string[];
|
|
156
|
+
parent?: string | null | undefined;
|
|
157
|
+
parent_country?: string | null | undefined;
|
|
158
|
+
point_gap?: string | null | undefined;
|
|
159
|
+
};
|
|
160
|
+
}, {
|
|
161
|
+
type: "Feature";
|
|
162
|
+
geometry: z.objectInputType<{
|
|
163
|
+
type: z.ZodLiteral<"Point">;
|
|
164
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
165
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
166
|
+
properties: {
|
|
167
|
+
code: string;
|
|
168
|
+
country: string;
|
|
169
|
+
name: string;
|
|
170
|
+
properties?: Record<string, unknown> | undefined;
|
|
171
|
+
parent?: string | null | undefined;
|
|
172
|
+
parent_country?: string | null | undefined;
|
|
173
|
+
point_gap?: string | null | undefined;
|
|
174
|
+
tags?: string[] | undefined;
|
|
175
|
+
};
|
|
176
|
+
}>;
|
|
177
|
+
/**
|
|
178
|
+
* A pack document. `regions` may be left out (a pack holding only localities) and reads as an
|
|
179
|
+
* empty collection. `localities` stays absent when absent: a pack without the key leaves the
|
|
180
|
+
* localities it installed alone, while an empty section removes them, so no default is given.
|
|
181
|
+
*/
|
|
182
|
+
export declare const packSchema: z.ZodEffects<z.ZodObject<{
|
|
65
183
|
pack: z.ZodObject<{
|
|
66
184
|
slug: z.ZodString;
|
|
67
185
|
version: z.ZodString;
|
|
@@ -101,7 +219,7 @@ export declare const packSchema: z.ZodObject<{
|
|
|
101
219
|
type: z.ZodString;
|
|
102
220
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
103
221
|
}>, "many">>;
|
|
104
|
-
regions: z.ZodObject<{
|
|
222
|
+
regions: z.ZodDefault<z.ZodObject<{
|
|
105
223
|
type: z.ZodLiteral<"FeatureCollection">;
|
|
106
224
|
features: z.ZodArray<z.ZodObject<{
|
|
107
225
|
type: z.ZodLiteral<"Feature">;
|
|
@@ -125,26 +243,26 @@ export declare const packSchema: z.ZodObject<{
|
|
|
125
243
|
properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
126
244
|
}, "strip", z.ZodTypeAny, {
|
|
127
245
|
type: "admin" | "cultural" | "natural" | "custom";
|
|
128
|
-
slug: string;
|
|
129
|
-
name: string;
|
|
130
246
|
properties: Record<string, unknown>;
|
|
131
247
|
country: string;
|
|
248
|
+
name: string;
|
|
132
249
|
tags: string[];
|
|
250
|
+
slug: string;
|
|
133
251
|
code?: string | null | undefined;
|
|
134
|
-
level?: number | null | undefined;
|
|
135
252
|
parent?: string | null | undefined;
|
|
136
253
|
parent_country?: string | null | undefined;
|
|
254
|
+
level?: number | null | undefined;
|
|
137
255
|
}, {
|
|
138
256
|
type: "admin" | "cultural" | "natural" | "custom";
|
|
139
|
-
slug: string;
|
|
140
|
-
name: string;
|
|
141
257
|
country: string;
|
|
258
|
+
name: string;
|
|
259
|
+
slug: string;
|
|
142
260
|
code?: string | null | undefined;
|
|
143
261
|
properties?: Record<string, unknown> | undefined;
|
|
144
|
-
level?: number | null | undefined;
|
|
145
262
|
parent?: string | null | undefined;
|
|
146
263
|
parent_country?: string | null | undefined;
|
|
147
264
|
tags?: string[] | undefined;
|
|
265
|
+
level?: number | null | undefined;
|
|
148
266
|
}>;
|
|
149
267
|
}, "strip", z.ZodTypeAny, {
|
|
150
268
|
type: "Feature";
|
|
@@ -155,15 +273,15 @@ export declare const packSchema: z.ZodObject<{
|
|
|
155
273
|
};
|
|
156
274
|
properties: {
|
|
157
275
|
type: "admin" | "cultural" | "natural" | "custom";
|
|
158
|
-
slug: string;
|
|
159
|
-
name: string;
|
|
160
276
|
properties: Record<string, unknown>;
|
|
161
277
|
country: string;
|
|
278
|
+
name: string;
|
|
162
279
|
tags: string[];
|
|
280
|
+
slug: string;
|
|
163
281
|
code?: string | null | undefined;
|
|
164
|
-
level?: number | null | undefined;
|
|
165
282
|
parent?: string | null | undefined;
|
|
166
283
|
parent_country?: string | null | undefined;
|
|
284
|
+
level?: number | null | undefined;
|
|
167
285
|
};
|
|
168
286
|
}, {
|
|
169
287
|
type: "Feature";
|
|
@@ -174,15 +292,15 @@ export declare const packSchema: z.ZodObject<{
|
|
|
174
292
|
};
|
|
175
293
|
properties: {
|
|
176
294
|
type: "admin" | "cultural" | "natural" | "custom";
|
|
177
|
-
slug: string;
|
|
178
|
-
name: string;
|
|
179
295
|
country: string;
|
|
296
|
+
name: string;
|
|
297
|
+
slug: string;
|
|
180
298
|
code?: string | null | undefined;
|
|
181
299
|
properties?: Record<string, unknown> | undefined;
|
|
182
|
-
level?: number | null | undefined;
|
|
183
300
|
parent?: string | null | undefined;
|
|
184
301
|
parent_country?: string | null | undefined;
|
|
185
302
|
tags?: string[] | undefined;
|
|
303
|
+
level?: number | null | undefined;
|
|
186
304
|
};
|
|
187
305
|
}>, "many">;
|
|
188
306
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -196,15 +314,15 @@ export declare const packSchema: z.ZodObject<{
|
|
|
196
314
|
};
|
|
197
315
|
properties: {
|
|
198
316
|
type: "admin" | "cultural" | "natural" | "custom";
|
|
199
|
-
slug: string;
|
|
200
|
-
name: string;
|
|
201
317
|
properties: Record<string, unknown>;
|
|
202
318
|
country: string;
|
|
319
|
+
name: string;
|
|
203
320
|
tags: string[];
|
|
321
|
+
slug: string;
|
|
204
322
|
code?: string | null | undefined;
|
|
205
|
-
level?: number | null | undefined;
|
|
206
323
|
parent?: string | null | undefined;
|
|
207
324
|
parent_country?: string | null | undefined;
|
|
325
|
+
level?: number | null | undefined;
|
|
208
326
|
};
|
|
209
327
|
}[];
|
|
210
328
|
}, {
|
|
@@ -218,18 +336,202 @@ export declare const packSchema: z.ZodObject<{
|
|
|
218
336
|
};
|
|
219
337
|
properties: {
|
|
220
338
|
type: "admin" | "cultural" | "natural" | "custom";
|
|
221
|
-
slug: string;
|
|
222
|
-
name: string;
|
|
223
339
|
country: string;
|
|
340
|
+
name: string;
|
|
341
|
+
slug: string;
|
|
224
342
|
code?: string | null | undefined;
|
|
225
343
|
properties?: Record<string, unknown> | undefined;
|
|
344
|
+
parent?: string | null | undefined;
|
|
345
|
+
parent_country?: string | null | undefined;
|
|
346
|
+
tags?: string[] | undefined;
|
|
226
347
|
level?: number | null | undefined;
|
|
348
|
+
};
|
|
349
|
+
}[];
|
|
350
|
+
}>>;
|
|
351
|
+
localities: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
352
|
+
type: z.ZodLiteral<"FeatureCollection">;
|
|
353
|
+
features: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
354
|
+
type: z.ZodLiteral<"Feature">;
|
|
355
|
+
geometry: z.ZodNullable<z.ZodObject<{
|
|
356
|
+
type: z.ZodLiteral<"Point">;
|
|
357
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
358
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
359
|
+
type: z.ZodLiteral<"Point">;
|
|
360
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
361
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
362
|
+
type: z.ZodLiteral<"Point">;
|
|
363
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
364
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
365
|
+
properties: z.ZodObject<{
|
|
366
|
+
country: z.ZodEffects<z.ZodString, string, string>;
|
|
367
|
+
code: z.ZodString;
|
|
368
|
+
name: z.ZodString;
|
|
369
|
+
parent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
370
|
+
parent_country: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>>;
|
|
371
|
+
point_gap: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
372
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
373
|
+
properties: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
374
|
+
}, "strip", z.ZodTypeAny, {
|
|
375
|
+
code: string;
|
|
376
|
+
properties: Record<string, unknown>;
|
|
377
|
+
country: string;
|
|
378
|
+
name: string;
|
|
379
|
+
tags: string[];
|
|
380
|
+
parent?: string | null | undefined;
|
|
381
|
+
parent_country?: string | null | undefined;
|
|
382
|
+
point_gap?: string | null | undefined;
|
|
383
|
+
}, {
|
|
384
|
+
code: string;
|
|
385
|
+
country: string;
|
|
386
|
+
name: string;
|
|
387
|
+
properties?: Record<string, unknown> | undefined;
|
|
388
|
+
parent?: string | null | undefined;
|
|
389
|
+
parent_country?: string | null | undefined;
|
|
390
|
+
point_gap?: string | null | undefined;
|
|
391
|
+
tags?: string[] | undefined;
|
|
392
|
+
}>;
|
|
393
|
+
}, "strip", z.ZodTypeAny, {
|
|
394
|
+
type: "Feature";
|
|
395
|
+
geometry: z.objectOutputType<{
|
|
396
|
+
type: z.ZodLiteral<"Point">;
|
|
397
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
398
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
399
|
+
properties: {
|
|
400
|
+
code: string;
|
|
401
|
+
properties: Record<string, unknown>;
|
|
402
|
+
country: string;
|
|
403
|
+
name: string;
|
|
404
|
+
tags: string[];
|
|
405
|
+
parent?: string | null | undefined;
|
|
406
|
+
parent_country?: string | null | undefined;
|
|
407
|
+
point_gap?: string | null | undefined;
|
|
408
|
+
};
|
|
409
|
+
}, {
|
|
410
|
+
type: "Feature";
|
|
411
|
+
geometry: z.objectInputType<{
|
|
412
|
+
type: z.ZodLiteral<"Point">;
|
|
413
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
414
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
415
|
+
properties: {
|
|
416
|
+
code: string;
|
|
417
|
+
country: string;
|
|
418
|
+
name: string;
|
|
419
|
+
properties?: Record<string, unknown> | undefined;
|
|
420
|
+
parent?: string | null | undefined;
|
|
421
|
+
parent_country?: string | null | undefined;
|
|
422
|
+
point_gap?: string | null | undefined;
|
|
423
|
+
tags?: string[] | undefined;
|
|
424
|
+
};
|
|
425
|
+
}>, {
|
|
426
|
+
type: "Feature";
|
|
427
|
+
geometry: z.objectOutputType<{
|
|
428
|
+
type: z.ZodLiteral<"Point">;
|
|
429
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
430
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
431
|
+
properties: {
|
|
432
|
+
code: string;
|
|
433
|
+
properties: Record<string, unknown>;
|
|
434
|
+
country: string;
|
|
435
|
+
name: string;
|
|
436
|
+
tags: string[];
|
|
437
|
+
parent?: string | null | undefined;
|
|
438
|
+
parent_country?: string | null | undefined;
|
|
439
|
+
point_gap?: string | null | undefined;
|
|
440
|
+
};
|
|
441
|
+
}, {
|
|
442
|
+
type: "Feature";
|
|
443
|
+
geometry: z.objectInputType<{
|
|
444
|
+
type: z.ZodLiteral<"Point">;
|
|
445
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
446
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
447
|
+
properties: {
|
|
448
|
+
code: string;
|
|
449
|
+
country: string;
|
|
450
|
+
name: string;
|
|
451
|
+
properties?: Record<string, unknown> | undefined;
|
|
452
|
+
parent?: string | null | undefined;
|
|
453
|
+
parent_country?: string | null | undefined;
|
|
454
|
+
point_gap?: string | null | undefined;
|
|
455
|
+
tags?: string[] | undefined;
|
|
456
|
+
};
|
|
457
|
+
}>, "many">;
|
|
458
|
+
}, "strip", z.ZodTypeAny, {
|
|
459
|
+
type: "FeatureCollection";
|
|
460
|
+
features: {
|
|
461
|
+
type: "Feature";
|
|
462
|
+
geometry: z.objectOutputType<{
|
|
463
|
+
type: z.ZodLiteral<"Point">;
|
|
464
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
465
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
466
|
+
properties: {
|
|
467
|
+
code: string;
|
|
468
|
+
properties: Record<string, unknown>;
|
|
469
|
+
country: string;
|
|
470
|
+
name: string;
|
|
471
|
+
tags: string[];
|
|
472
|
+
parent?: string | null | undefined;
|
|
473
|
+
parent_country?: string | null | undefined;
|
|
474
|
+
point_gap?: string | null | undefined;
|
|
475
|
+
};
|
|
476
|
+
}[];
|
|
477
|
+
}, {
|
|
478
|
+
type: "FeatureCollection";
|
|
479
|
+
features: {
|
|
480
|
+
type: "Feature";
|
|
481
|
+
geometry: z.objectInputType<{
|
|
482
|
+
type: z.ZodLiteral<"Point">;
|
|
483
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
484
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
485
|
+
properties: {
|
|
486
|
+
code: string;
|
|
487
|
+
country: string;
|
|
488
|
+
name: string;
|
|
489
|
+
properties?: Record<string, unknown> | undefined;
|
|
227
490
|
parent?: string | null | undefined;
|
|
228
491
|
parent_country?: string | null | undefined;
|
|
492
|
+
point_gap?: string | null | undefined;
|
|
229
493
|
tags?: string[] | undefined;
|
|
230
494
|
};
|
|
231
495
|
}[];
|
|
232
|
-
}
|
|
496
|
+
}>, {
|
|
497
|
+
type: "FeatureCollection";
|
|
498
|
+
features: {
|
|
499
|
+
type: "Feature";
|
|
500
|
+
geometry: z.objectOutputType<{
|
|
501
|
+
type: z.ZodLiteral<"Point">;
|
|
502
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
503
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
504
|
+
properties: {
|
|
505
|
+
code: string;
|
|
506
|
+
properties: Record<string, unknown>;
|
|
507
|
+
country: string;
|
|
508
|
+
name: string;
|
|
509
|
+
tags: string[];
|
|
510
|
+
parent?: string | null | undefined;
|
|
511
|
+
parent_country?: string | null | undefined;
|
|
512
|
+
point_gap?: string | null | undefined;
|
|
513
|
+
};
|
|
514
|
+
}[];
|
|
515
|
+
}, {
|
|
516
|
+
type: "FeatureCollection";
|
|
517
|
+
features: {
|
|
518
|
+
type: "Feature";
|
|
519
|
+
geometry: z.objectInputType<{
|
|
520
|
+
type: z.ZodLiteral<"Point">;
|
|
521
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
522
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
523
|
+
properties: {
|
|
524
|
+
code: string;
|
|
525
|
+
country: string;
|
|
526
|
+
name: string;
|
|
527
|
+
properties?: Record<string, unknown> | undefined;
|
|
528
|
+
parent?: string | null | undefined;
|
|
529
|
+
parent_country?: string | null | undefined;
|
|
530
|
+
point_gap?: string | null | undefined;
|
|
531
|
+
tags?: string[] | undefined;
|
|
532
|
+
};
|
|
533
|
+
}[];
|
|
534
|
+
}>>;
|
|
233
535
|
}, "strip", z.ZodTypeAny, {
|
|
234
536
|
pack: {
|
|
235
537
|
slug: string;
|
|
@@ -255,18 +557,38 @@ export declare const packSchema: z.ZodObject<{
|
|
|
255
557
|
};
|
|
256
558
|
properties: {
|
|
257
559
|
type: "admin" | "cultural" | "natural" | "custom";
|
|
258
|
-
slug: string;
|
|
259
|
-
name: string;
|
|
260
560
|
properties: Record<string, unknown>;
|
|
261
561
|
country: string;
|
|
562
|
+
name: string;
|
|
262
563
|
tags: string[];
|
|
564
|
+
slug: string;
|
|
263
565
|
code?: string | null | undefined;
|
|
264
|
-
level?: number | null | undefined;
|
|
265
566
|
parent?: string | null | undefined;
|
|
266
567
|
parent_country?: string | null | undefined;
|
|
568
|
+
level?: number | null | undefined;
|
|
267
569
|
};
|
|
268
570
|
}[];
|
|
269
571
|
};
|
|
572
|
+
localities?: {
|
|
573
|
+
type: "FeatureCollection";
|
|
574
|
+
features: {
|
|
575
|
+
type: "Feature";
|
|
576
|
+
geometry: z.objectOutputType<{
|
|
577
|
+
type: z.ZodLiteral<"Point">;
|
|
578
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
579
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
580
|
+
properties: {
|
|
581
|
+
code: string;
|
|
582
|
+
properties: Record<string, unknown>;
|
|
583
|
+
country: string;
|
|
584
|
+
name: string;
|
|
585
|
+
tags: string[];
|
|
586
|
+
parent?: string | null | undefined;
|
|
587
|
+
parent_country?: string | null | undefined;
|
|
588
|
+
point_gap?: string | null | undefined;
|
|
589
|
+
};
|
|
590
|
+
}[];
|
|
591
|
+
} | undefined;
|
|
270
592
|
}, {
|
|
271
593
|
pack: {
|
|
272
594
|
slug: string;
|
|
@@ -274,7 +596,14 @@ export declare const packSchema: z.ZodObject<{
|
|
|
274
596
|
schema_version: number;
|
|
275
597
|
published_at?: string | undefined;
|
|
276
598
|
};
|
|
277
|
-
|
|
599
|
+
countries?: {
|
|
600
|
+
code: string;
|
|
601
|
+
name: string;
|
|
602
|
+
geometry?: z.objectInputType<{
|
|
603
|
+
type: z.ZodString;
|
|
604
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
605
|
+
}[] | undefined;
|
|
606
|
+
regions?: {
|
|
278
607
|
type: "FeatureCollection";
|
|
279
608
|
features: {
|
|
280
609
|
type: "Feature";
|
|
@@ -285,17 +614,101 @@ export declare const packSchema: z.ZodObject<{
|
|
|
285
614
|
};
|
|
286
615
|
properties: {
|
|
287
616
|
type: "admin" | "cultural" | "natural" | "custom";
|
|
288
|
-
slug: string;
|
|
289
|
-
name: string;
|
|
290
617
|
country: string;
|
|
618
|
+
name: string;
|
|
619
|
+
slug: string;
|
|
291
620
|
code?: string | null | undefined;
|
|
292
621
|
properties?: Record<string, unknown> | undefined;
|
|
622
|
+
parent?: string | null | undefined;
|
|
623
|
+
parent_country?: string | null | undefined;
|
|
624
|
+
tags?: string[] | undefined;
|
|
293
625
|
level?: number | null | undefined;
|
|
626
|
+
};
|
|
627
|
+
}[];
|
|
628
|
+
} | undefined;
|
|
629
|
+
localities?: {
|
|
630
|
+
type: "FeatureCollection";
|
|
631
|
+
features: {
|
|
632
|
+
type: "Feature";
|
|
633
|
+
geometry: z.objectInputType<{
|
|
634
|
+
type: z.ZodLiteral<"Point">;
|
|
635
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
636
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
637
|
+
properties: {
|
|
638
|
+
code: string;
|
|
639
|
+
country: string;
|
|
640
|
+
name: string;
|
|
641
|
+
properties?: Record<string, unknown> | undefined;
|
|
294
642
|
parent?: string | null | undefined;
|
|
295
643
|
parent_country?: string | null | undefined;
|
|
644
|
+
point_gap?: string | null | undefined;
|
|
296
645
|
tags?: string[] | undefined;
|
|
297
646
|
};
|
|
298
647
|
}[];
|
|
648
|
+
} | undefined;
|
|
649
|
+
}>, {
|
|
650
|
+
pack: {
|
|
651
|
+
slug: string;
|
|
652
|
+
version: string;
|
|
653
|
+
schema_version: number;
|
|
654
|
+
published_at?: string | undefined;
|
|
655
|
+
};
|
|
656
|
+
countries: {
|
|
657
|
+
code: string;
|
|
658
|
+
name: string;
|
|
659
|
+
geometry?: z.objectOutputType<{
|
|
660
|
+
type: z.ZodString;
|
|
661
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
662
|
+
}[];
|
|
663
|
+
regions: {
|
|
664
|
+
type: "FeatureCollection";
|
|
665
|
+
features: {
|
|
666
|
+
type: "Feature";
|
|
667
|
+
geometry: {
|
|
668
|
+
type: string;
|
|
669
|
+
} & {
|
|
670
|
+
[k: string]: unknown;
|
|
671
|
+
};
|
|
672
|
+
properties: {
|
|
673
|
+
type: "admin" | "cultural" | "natural" | "custom";
|
|
674
|
+
properties: Record<string, unknown>;
|
|
675
|
+
country: string;
|
|
676
|
+
name: string;
|
|
677
|
+
tags: string[];
|
|
678
|
+
slug: string;
|
|
679
|
+
code?: string | null | undefined;
|
|
680
|
+
parent?: string | null | undefined;
|
|
681
|
+
parent_country?: string | null | undefined;
|
|
682
|
+
level?: number | null | undefined;
|
|
683
|
+
};
|
|
684
|
+
}[];
|
|
685
|
+
};
|
|
686
|
+
localities?: {
|
|
687
|
+
type: "FeatureCollection";
|
|
688
|
+
features: {
|
|
689
|
+
type: "Feature";
|
|
690
|
+
geometry: z.objectOutputType<{
|
|
691
|
+
type: z.ZodLiteral<"Point">;
|
|
692
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
693
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
694
|
+
properties: {
|
|
695
|
+
code: string;
|
|
696
|
+
properties: Record<string, unknown>;
|
|
697
|
+
country: string;
|
|
698
|
+
name: string;
|
|
699
|
+
tags: string[];
|
|
700
|
+
parent?: string | null | undefined;
|
|
701
|
+
parent_country?: string | null | undefined;
|
|
702
|
+
point_gap?: string | null | undefined;
|
|
703
|
+
};
|
|
704
|
+
}[];
|
|
705
|
+
} | undefined;
|
|
706
|
+
}, {
|
|
707
|
+
pack: {
|
|
708
|
+
slug: string;
|
|
709
|
+
version: string;
|
|
710
|
+
schema_version: number;
|
|
711
|
+
published_at?: string | undefined;
|
|
299
712
|
};
|
|
300
713
|
countries?: {
|
|
301
714
|
code: string;
|
|
@@ -304,6 +717,49 @@ export declare const packSchema: z.ZodObject<{
|
|
|
304
717
|
type: z.ZodString;
|
|
305
718
|
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
306
719
|
}[] | undefined;
|
|
720
|
+
regions?: {
|
|
721
|
+
type: "FeatureCollection";
|
|
722
|
+
features: {
|
|
723
|
+
type: "Feature";
|
|
724
|
+
geometry: {
|
|
725
|
+
type: string;
|
|
726
|
+
} & {
|
|
727
|
+
[k: string]: unknown;
|
|
728
|
+
};
|
|
729
|
+
properties: {
|
|
730
|
+
type: "admin" | "cultural" | "natural" | "custom";
|
|
731
|
+
country: string;
|
|
732
|
+
name: string;
|
|
733
|
+
slug: string;
|
|
734
|
+
code?: string | null | undefined;
|
|
735
|
+
properties?: Record<string, unknown> | undefined;
|
|
736
|
+
parent?: string | null | undefined;
|
|
737
|
+
parent_country?: string | null | undefined;
|
|
738
|
+
tags?: string[] | undefined;
|
|
739
|
+
level?: number | null | undefined;
|
|
740
|
+
};
|
|
741
|
+
}[];
|
|
742
|
+
} | undefined;
|
|
743
|
+
localities?: {
|
|
744
|
+
type: "FeatureCollection";
|
|
745
|
+
features: {
|
|
746
|
+
type: "Feature";
|
|
747
|
+
geometry: z.objectInputType<{
|
|
748
|
+
type: z.ZodLiteral<"Point">;
|
|
749
|
+
coordinates: z.ZodArray<z.ZodNumber, "many">;
|
|
750
|
+
}, z.ZodTypeAny, "passthrough"> | null;
|
|
751
|
+
properties: {
|
|
752
|
+
code: string;
|
|
753
|
+
country: string;
|
|
754
|
+
name: string;
|
|
755
|
+
properties?: Record<string, unknown> | undefined;
|
|
756
|
+
parent?: string | null | undefined;
|
|
757
|
+
parent_country?: string | null | undefined;
|
|
758
|
+
point_gap?: string | null | undefined;
|
|
759
|
+
tags?: string[] | undefined;
|
|
760
|
+
};
|
|
761
|
+
}[];
|
|
762
|
+
} | undefined;
|
|
307
763
|
}>;
|
|
308
764
|
export type Pack = z.infer<typeof packSchema>;
|
|
309
765
|
export interface PackInfo {
|
|
@@ -313,6 +769,7 @@ export interface PackInfo {
|
|
|
313
769
|
schema_version: number;
|
|
314
770
|
installed_at: string;
|
|
315
771
|
region_count: number;
|
|
772
|
+
locality_count: number;
|
|
316
773
|
}
|
|
317
774
|
export interface InstallPackResult {
|
|
318
775
|
pack: string;
|
|
@@ -320,4 +777,27 @@ export interface InstallPackResult {
|
|
|
320
777
|
countries: number;
|
|
321
778
|
regions: number;
|
|
322
779
|
memberships: number;
|
|
780
|
+
/** How many localities the pack holds; present only when the document had a `localities` section. */
|
|
781
|
+
localities?: number;
|
|
782
|
+
}
|
|
783
|
+
/** What every locality read returns, and what `upsertLocality` answers. */
|
|
784
|
+
export interface LocalitySummary {
|
|
785
|
+
/** ISO country code, upper case. With `code`, the key a host's foreign key references. */
|
|
786
|
+
country: string;
|
|
787
|
+
code: string;
|
|
788
|
+
name: string;
|
|
789
|
+
/** The label point, [lng, lat]; null when the locality has a `point_gap` instead. */
|
|
790
|
+
point: [number, number] | null;
|
|
791
|
+
point_gap: string | null;
|
|
792
|
+
/** The parent region; null when it has none or its pack is not installed. */
|
|
793
|
+
parent: {
|
|
794
|
+
slug: string;
|
|
795
|
+
name: string;
|
|
796
|
+
} | null;
|
|
797
|
+
tags: string[];
|
|
798
|
+
properties: Record<string, unknown>;
|
|
799
|
+
/** The slug of the pack that owns it; null for a local locality. */
|
|
800
|
+
pack: string | null;
|
|
801
|
+
/** Geodesic metres from the point asked about, to 0.1 m: `localitiesNear` only. */
|
|
802
|
+
distance_m?: number;
|
|
323
803
|
}
|