@tmlmobilidade/go-types-geo 20260828.1636.54
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/dist/constants/earth-radius.d.ts +4 -0
- package/dist/constants/earth-radius.js +4 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +2 -0
- package/dist/constants/meters-per-degree.d.ts +4 -0
- package/dist/constants/meters-per-degree.js +4 -0
- package/dist/geojson/base/index.d.ts +4 -0
- package/dist/geojson/base/index.js +4 -0
- package/dist/geojson/base/latitude.d.ts +21 -0
- package/dist/geojson/base/latitude.js +21 -0
- package/dist/geojson/base/linear-ring.d.ts +7 -0
- package/dist/geojson/base/linear-ring.js +18 -0
- package/dist/geojson/base/longitude.d.ts +21 -0
- package/dist/geojson/base/longitude.js +21 -0
- package/dist/geojson/base/position.d.ts +7 -0
- package/dist/geojson/base/position.js +10 -0
- package/dist/geojson/features/feature-collection.d.ts +306 -0
- package/dist/geojson/features/feature-collection.js +11 -0
- package/dist/geojson/features/feature.d.ts +180 -0
- package/dist/geojson/features/feature.js +24 -0
- package/dist/geojson/features/index.d.ts +2 -0
- package/dist/geojson/features/index.js +2 -0
- package/dist/geojson/features/properties.d.ts +3 -0
- package/dist/geojson/features/properties.js +6 -0
- package/dist/geojson/geometry/index.d.ts +6 -0
- package/dist/geojson/geometry/index.js +6 -0
- package/dist/geojson/geometry/line-string.d.ts +12 -0
- package/dist/geojson/geometry/line-string.js +8 -0
- package/dist/geojson/geometry/multi-line-string.d.ts +12 -0
- package/dist/geojson/geometry/multi-line-string.js +8 -0
- package/dist/geojson/geometry/multi-point.d.ts +12 -0
- package/dist/geojson/geometry/multi-point.js +8 -0
- package/dist/geojson/geometry/multi-polygon.d.ts +12 -0
- package/dist/geojson/geometry/multi-polygon.js +8 -0
- package/dist/geojson/geometry/point.d.ts +12 -0
- package/dist/geojson/geometry/point.js +8 -0
- package/dist/geojson/geometry/polygon.d.ts +12 -0
- package/dist/geojson/geometry/polygon.js +8 -0
- package/dist/geojson/index.d.ts +3 -0
- package/dist/geojson/index.js +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/polylines/encoded-polyline.d.ts +32 -0
- package/dist/polylines/encoded-polyline.js +80 -0
- package/dist/polylines/index.d.ts +1 -0
- package/dist/polylines/index.js +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The latitude of a geographic coordinate, in degrees.
|
|
4
|
+
*/
|
|
5
|
+
export type Latitude = number & {
|
|
6
|
+
__brand: 'Latitude';
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The schema for a latitude value.
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const latitude = LatitudeSchema.parse('40.712886213');
|
|
13
|
+
* // => 40.712886
|
|
14
|
+
*
|
|
15
|
+
* const latitude = LatitudeSchema.parse(40.712886213);
|
|
16
|
+
* // => 40.712886
|
|
17
|
+
*
|
|
18
|
+
* const latitude = LatitudeSchema.parse('94.7128');
|
|
19
|
+
* // => Throws an error: 'Latitude must be between -90 and 90'
|
|
20
|
+
*/
|
|
21
|
+
export declare const LatitudeSchema: z.ZodEffects<z.ZodNumber, Latitude, number>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a latitude value.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const latitude = LatitudeSchema.parse('40.712886213');
|
|
8
|
+
* // => 40.712886
|
|
9
|
+
*
|
|
10
|
+
* const latitude = LatitudeSchema.parse(40.712886213);
|
|
11
|
+
* // => 40.712886
|
|
12
|
+
*
|
|
13
|
+
* const latitude = LatitudeSchema.parse('94.7128');
|
|
14
|
+
* // => Throws an error: 'Latitude must be between -90 and 90'
|
|
15
|
+
*/
|
|
16
|
+
export const LatitudeSchema = z
|
|
17
|
+
.coerce
|
|
18
|
+
.number()
|
|
19
|
+
.min(-90, 'Latitude must be between -90 and 90')
|
|
20
|
+
.max(90, 'Latitude must be between -90 and 90')
|
|
21
|
+
.transform(value => Number(value.toFixed(6)));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A linear ring is a closed polygon with at least 4 points.
|
|
4
|
+
* The first and last points must be the same, as to form a closed surface.
|
|
5
|
+
*/
|
|
6
|
+
export declare const GeoJsonLinearRingSchema: z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("./longitude.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("./latitude.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("./longitude.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("./latitude.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("./longitude.js").Longitude, import("./latitude.js").Latitude] | [import("./longitude.js").Longitude, import("./latitude.js").Latitude, number])[], ([number, number] | [number, number, number])[]>;
|
|
7
|
+
export type GeoJsonLinearRing = z.infer<typeof GeoJsonLinearRingSchema>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GeoJsonPositionSchema } from './position.js';
|
|
4
|
+
/**
|
|
5
|
+
* A linear ring is a closed polygon with at least 4 points.
|
|
6
|
+
* The first and last points must be the same, as to form a closed surface.
|
|
7
|
+
*/
|
|
8
|
+
export const GeoJsonLinearRingSchema = z.array(GeoJsonPositionSchema)
|
|
9
|
+
.min(4)
|
|
10
|
+
.refine((points) => {
|
|
11
|
+
// A linear ring must have at least 4 points.
|
|
12
|
+
if (points.length < 4)
|
|
13
|
+
return false;
|
|
14
|
+
// The first and last points must be the same in both dimensions.
|
|
15
|
+
const firstPoint = points[0];
|
|
16
|
+
const lastPoint = points[points.length - 1];
|
|
17
|
+
return firstPoint.every((value, index) => value === lastPoint[index]);
|
|
18
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The longitude of a geographic coordinate, in degrees.
|
|
4
|
+
*/
|
|
5
|
+
export type Longitude = number & {
|
|
6
|
+
__brand: 'Longitude';
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The schema for a longitude value.
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const longitude = LongitudeSchema.parse('-9.55841684');
|
|
13
|
+
* // => -9.558416
|
|
14
|
+
*
|
|
15
|
+
* const longitude = LongitudeSchema.parse(-9.55841684);
|
|
16
|
+
* // => -9.558416
|
|
17
|
+
*
|
|
18
|
+
* const longitude = LongitudeSchema.parse('180.1');
|
|
19
|
+
* // => Throws an error: 'Longitude must be between -180 and 180'
|
|
20
|
+
*/
|
|
21
|
+
export declare const LongitudeSchema: z.ZodEffects<z.ZodNumber, Longitude, number>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a longitude value.
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const longitude = LongitudeSchema.parse('-9.55841684');
|
|
8
|
+
* // => -9.558416
|
|
9
|
+
*
|
|
10
|
+
* const longitude = LongitudeSchema.parse(-9.55841684);
|
|
11
|
+
* // => -9.558416
|
|
12
|
+
*
|
|
13
|
+
* const longitude = LongitudeSchema.parse('180.1');
|
|
14
|
+
* // => Throws an error: 'Longitude must be between -180 and 180'
|
|
15
|
+
*/
|
|
16
|
+
export const LongitudeSchema = z
|
|
17
|
+
.coerce
|
|
18
|
+
.number()
|
|
19
|
+
.min(-180, 'Longitude must be between -180 and 180')
|
|
20
|
+
.max(180, 'Longitude must be between -180 and 180')
|
|
21
|
+
.transform(value => Number(value.toFixed(6)));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GeoJson2dPositionSchema: z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("./longitude.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("./latitude.js").Latitude, number>], null>;
|
|
3
|
+
export type GeoJson2dPosition = z.infer<typeof GeoJson2dPositionSchema>;
|
|
4
|
+
export declare const GeoJson3dPositionSchema: z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("./longitude.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("./latitude.js").Latitude, number>, z.ZodNumber], null>;
|
|
5
|
+
export type GeoJson3dPosition = z.infer<typeof GeoJson3dPositionSchema>;
|
|
6
|
+
export declare const GeoJsonPositionSchema: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("./longitude.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("./latitude.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("./longitude.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("./latitude.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
7
|
+
export type GeoJsonPosition = z.infer<typeof GeoJsonPositionSchema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { LatitudeSchema } from './latitude.js';
|
|
4
|
+
import { LongitudeSchema } from './longitude.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const GeoJson2dPositionSchema = z.tuple([LongitudeSchema, LatitudeSchema]);
|
|
7
|
+
/* * */
|
|
8
|
+
export const GeoJson3dPositionSchema = z.tuple([LongitudeSchema, LatitudeSchema, z.number()]);
|
|
9
|
+
/* * */
|
|
10
|
+
export const GeoJsonPositionSchema = z.union([GeoJson2dPositionSchema, GeoJson3dPositionSchema]);
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GeoJsonFeature } from './feature.js';
|
|
3
|
+
import { DefaultGeoJsonFeatureProperties, DefaultGeoJsonFeaturePropertiesSchema } from './properties.js';
|
|
4
|
+
export declare const GeoJsonFeatureCollectionSchema: <T extends z.ZodTypeAny = typeof DefaultGeoJsonFeaturePropertiesSchema>(propertiesSchema?: T) => z.ZodObject<{
|
|
5
|
+
features: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
6
|
+
geometry: z.ZodUnion<[z.ZodObject<{
|
|
7
|
+
coordinates: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
8
|
+
type: z.ZodDefault<z.ZodLiteral<"Point">>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
type: "Point";
|
|
11
|
+
coordinates: [import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number];
|
|
12
|
+
}, {
|
|
13
|
+
coordinates: [number, number] | [number, number, number];
|
|
14
|
+
type?: "Point" | undefined;
|
|
15
|
+
}>, z.ZodObject<{
|
|
16
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
17
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPoint">>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
type: "MultiPoint";
|
|
20
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
21
|
+
}, {
|
|
22
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
23
|
+
type?: "MultiPoint" | undefined;
|
|
24
|
+
}>, z.ZodObject<{
|
|
25
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
26
|
+
type: z.ZodDefault<z.ZodLiteral<"LineString">>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
type: "LineString";
|
|
29
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
30
|
+
}, {
|
|
31
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
32
|
+
type?: "LineString" | undefined;
|
|
33
|
+
}>, z.ZodObject<{
|
|
34
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, "many">;
|
|
35
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiLineString">>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
type: "MultiLineString";
|
|
38
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
39
|
+
}, {
|
|
40
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
41
|
+
type?: "MultiLineString" | undefined;
|
|
42
|
+
}>, z.ZodObject<{
|
|
43
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">;
|
|
44
|
+
type: z.ZodDefault<z.ZodLiteral<"Polygon">>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
type: "Polygon";
|
|
47
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
48
|
+
}, {
|
|
49
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
50
|
+
type?: "Polygon" | undefined;
|
|
51
|
+
}>, z.ZodObject<{
|
|
52
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">, "many">;
|
|
53
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPolygon">>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
type: "MultiPolygon";
|
|
56
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][][];
|
|
57
|
+
}, {
|
|
58
|
+
coordinates: ([number, number] | [number, number, number])[][][];
|
|
59
|
+
type?: "MultiPolygon" | undefined;
|
|
60
|
+
}>]>;
|
|
61
|
+
properties: z.ZodDefault<z.ZodNullable<T>>;
|
|
62
|
+
type: z.ZodLiteral<"Feature">;
|
|
63
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
64
|
+
geometry: z.ZodUnion<[z.ZodObject<{
|
|
65
|
+
coordinates: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
66
|
+
type: z.ZodDefault<z.ZodLiteral<"Point">>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
type: "Point";
|
|
69
|
+
coordinates: [import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number];
|
|
70
|
+
}, {
|
|
71
|
+
coordinates: [number, number] | [number, number, number];
|
|
72
|
+
type?: "Point" | undefined;
|
|
73
|
+
}>, z.ZodObject<{
|
|
74
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
75
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPoint">>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
type: "MultiPoint";
|
|
78
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
79
|
+
}, {
|
|
80
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
81
|
+
type?: "MultiPoint" | undefined;
|
|
82
|
+
}>, z.ZodObject<{
|
|
83
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
84
|
+
type: z.ZodDefault<z.ZodLiteral<"LineString">>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
type: "LineString";
|
|
87
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
88
|
+
}, {
|
|
89
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
90
|
+
type?: "LineString" | undefined;
|
|
91
|
+
}>, z.ZodObject<{
|
|
92
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, "many">;
|
|
93
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiLineString">>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
type: "MultiLineString";
|
|
96
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
97
|
+
}, {
|
|
98
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
99
|
+
type?: "MultiLineString" | undefined;
|
|
100
|
+
}>, z.ZodObject<{
|
|
101
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">;
|
|
102
|
+
type: z.ZodDefault<z.ZodLiteral<"Polygon">>;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
type: "Polygon";
|
|
105
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
106
|
+
}, {
|
|
107
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
108
|
+
type?: "Polygon" | undefined;
|
|
109
|
+
}>, z.ZodObject<{
|
|
110
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">, "many">;
|
|
111
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPolygon">>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
type: "MultiPolygon";
|
|
114
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][][];
|
|
115
|
+
}, {
|
|
116
|
+
coordinates: ([number, number] | [number, number, number])[][][];
|
|
117
|
+
type?: "MultiPolygon" | undefined;
|
|
118
|
+
}>]>;
|
|
119
|
+
properties: z.ZodDefault<z.ZodNullable<T>>;
|
|
120
|
+
type: z.ZodLiteral<"Feature">;
|
|
121
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
122
|
+
geometry: z.ZodUnion<[z.ZodObject<{
|
|
123
|
+
coordinates: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
124
|
+
type: z.ZodDefault<z.ZodLiteral<"Point">>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
type: "Point";
|
|
127
|
+
coordinates: [import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number];
|
|
128
|
+
}, {
|
|
129
|
+
coordinates: [number, number] | [number, number, number];
|
|
130
|
+
type?: "Point" | undefined;
|
|
131
|
+
}>, z.ZodObject<{
|
|
132
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
133
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPoint">>;
|
|
134
|
+
}, "strip", z.ZodTypeAny, {
|
|
135
|
+
type: "MultiPoint";
|
|
136
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
137
|
+
}, {
|
|
138
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
139
|
+
type?: "MultiPoint" | undefined;
|
|
140
|
+
}>, z.ZodObject<{
|
|
141
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
142
|
+
type: z.ZodDefault<z.ZodLiteral<"LineString">>;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
type: "LineString";
|
|
145
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
146
|
+
}, {
|
|
147
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
148
|
+
type?: "LineString" | undefined;
|
|
149
|
+
}>, z.ZodObject<{
|
|
150
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, "many">;
|
|
151
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiLineString">>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
type: "MultiLineString";
|
|
154
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
155
|
+
}, {
|
|
156
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
157
|
+
type?: "MultiLineString" | undefined;
|
|
158
|
+
}>, z.ZodObject<{
|
|
159
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">;
|
|
160
|
+
type: z.ZodDefault<z.ZodLiteral<"Polygon">>;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
type: "Polygon";
|
|
163
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
164
|
+
}, {
|
|
165
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
166
|
+
type?: "Polygon" | undefined;
|
|
167
|
+
}>, z.ZodObject<{
|
|
168
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">, "many">;
|
|
169
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPolygon">>;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
type: "MultiPolygon";
|
|
172
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][][];
|
|
173
|
+
}, {
|
|
174
|
+
coordinates: ([number, number] | [number, number, number])[][][];
|
|
175
|
+
type?: "MultiPolygon" | undefined;
|
|
176
|
+
}>]>;
|
|
177
|
+
properties: z.ZodDefault<z.ZodNullable<T>>;
|
|
178
|
+
type: z.ZodLiteral<"Feature">;
|
|
179
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>, "many">>;
|
|
180
|
+
type: z.ZodDefault<z.ZodLiteral<"FeatureCollection">>;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
type: "FeatureCollection";
|
|
183
|
+
features: (z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
184
|
+
geometry: z.ZodUnion<[z.ZodObject<{
|
|
185
|
+
coordinates: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
186
|
+
type: z.ZodDefault<z.ZodLiteral<"Point">>;
|
|
187
|
+
}, "strip", z.ZodTypeAny, {
|
|
188
|
+
type: "Point";
|
|
189
|
+
coordinates: [import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number];
|
|
190
|
+
}, {
|
|
191
|
+
coordinates: [number, number] | [number, number, number];
|
|
192
|
+
type?: "Point" | undefined;
|
|
193
|
+
}>, z.ZodObject<{
|
|
194
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
195
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPoint">>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
type: "MultiPoint";
|
|
198
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
199
|
+
}, {
|
|
200
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
201
|
+
type?: "MultiPoint" | undefined;
|
|
202
|
+
}>, z.ZodObject<{
|
|
203
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
204
|
+
type: z.ZodDefault<z.ZodLiteral<"LineString">>;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
type: "LineString";
|
|
207
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
208
|
+
}, {
|
|
209
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
210
|
+
type?: "LineString" | undefined;
|
|
211
|
+
}>, z.ZodObject<{
|
|
212
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, "many">;
|
|
213
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiLineString">>;
|
|
214
|
+
}, "strip", z.ZodTypeAny, {
|
|
215
|
+
type: "MultiLineString";
|
|
216
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
217
|
+
}, {
|
|
218
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
219
|
+
type?: "MultiLineString" | undefined;
|
|
220
|
+
}>, z.ZodObject<{
|
|
221
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">;
|
|
222
|
+
type: z.ZodDefault<z.ZodLiteral<"Polygon">>;
|
|
223
|
+
}, "strip", z.ZodTypeAny, {
|
|
224
|
+
type: "Polygon";
|
|
225
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
226
|
+
}, {
|
|
227
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
228
|
+
type?: "Polygon" | undefined;
|
|
229
|
+
}>, z.ZodObject<{
|
|
230
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">, "many">;
|
|
231
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPolygon">>;
|
|
232
|
+
}, "strip", z.ZodTypeAny, {
|
|
233
|
+
type: "MultiPolygon";
|
|
234
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][][];
|
|
235
|
+
}, {
|
|
236
|
+
coordinates: ([number, number] | [number, number, number])[][][];
|
|
237
|
+
type?: "MultiPolygon" | undefined;
|
|
238
|
+
}>]>;
|
|
239
|
+
properties: z.ZodDefault<z.ZodNullable<T>>;
|
|
240
|
+
type: z.ZodLiteral<"Feature">;
|
|
241
|
+
}>, any> extends infer T_3 ? { [k in keyof T_3]: T_3[k]; } : never)[];
|
|
242
|
+
}, {
|
|
243
|
+
type?: "FeatureCollection" | undefined;
|
|
244
|
+
features?: (z.baseObjectInputType<{
|
|
245
|
+
geometry: z.ZodUnion<[z.ZodObject<{
|
|
246
|
+
coordinates: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
247
|
+
type: z.ZodDefault<z.ZodLiteral<"Point">>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
type: "Point";
|
|
250
|
+
coordinates: [import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number];
|
|
251
|
+
}, {
|
|
252
|
+
coordinates: [number, number] | [number, number, number];
|
|
253
|
+
type?: "Point" | undefined;
|
|
254
|
+
}>, z.ZodObject<{
|
|
255
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
256
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPoint">>;
|
|
257
|
+
}, "strip", z.ZodTypeAny, {
|
|
258
|
+
type: "MultiPoint";
|
|
259
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
260
|
+
}, {
|
|
261
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
262
|
+
type?: "MultiPoint" | undefined;
|
|
263
|
+
}>, z.ZodObject<{
|
|
264
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
265
|
+
type: z.ZodDefault<z.ZodLiteral<"LineString">>;
|
|
266
|
+
}, "strip", z.ZodTypeAny, {
|
|
267
|
+
type: "LineString";
|
|
268
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
269
|
+
}, {
|
|
270
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
271
|
+
type?: "LineString" | undefined;
|
|
272
|
+
}>, z.ZodObject<{
|
|
273
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, "many">;
|
|
274
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiLineString">>;
|
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
|
276
|
+
type: "MultiLineString";
|
|
277
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
278
|
+
}, {
|
|
279
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
280
|
+
type?: "MultiLineString" | undefined;
|
|
281
|
+
}>, z.ZodObject<{
|
|
282
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">;
|
|
283
|
+
type: z.ZodDefault<z.ZodLiteral<"Polygon">>;
|
|
284
|
+
}, "strip", z.ZodTypeAny, {
|
|
285
|
+
type: "Polygon";
|
|
286
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
287
|
+
}, {
|
|
288
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
289
|
+
type?: "Polygon" | undefined;
|
|
290
|
+
}>, z.ZodObject<{
|
|
291
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">, "many">;
|
|
292
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPolygon">>;
|
|
293
|
+
}, "strip", z.ZodTypeAny, {
|
|
294
|
+
type: "MultiPolygon";
|
|
295
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][][];
|
|
296
|
+
}, {
|
|
297
|
+
coordinates: ([number, number] | [number, number, number])[][][];
|
|
298
|
+
type?: "MultiPolygon" | undefined;
|
|
299
|
+
}>]>;
|
|
300
|
+
properties: z.ZodDefault<z.ZodNullable<T>>;
|
|
301
|
+
type: z.ZodLiteral<"Feature">;
|
|
302
|
+
}> extends infer T_4 ? { [k_1 in keyof T_4]: T_4[k_1]; } : never)[] | undefined;
|
|
303
|
+
}>;
|
|
304
|
+
export type GeoJsonFeatureCollection<T = DefaultGeoJsonFeatureProperties> = Omit<z.infer<ReturnType<typeof GeoJsonFeatureCollectionSchema>>, 'features'> & {
|
|
305
|
+
features: GeoJsonFeature<T>[];
|
|
306
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GeoJsonFeatureSchema } from './feature.js';
|
|
4
|
+
import { DefaultGeoJsonFeaturePropertiesSchema } from './properties.js';
|
|
5
|
+
/* * */
|
|
6
|
+
export const GeoJsonFeatureCollectionSchema = (propertiesSchema = DefaultGeoJsonFeaturePropertiesSchema) => {
|
|
7
|
+
return z.object({
|
|
8
|
+
features: z.array(GeoJsonFeatureSchema(propertiesSchema)).default([]),
|
|
9
|
+
type: z.literal('FeatureCollection').default('FeatureCollection'),
|
|
10
|
+
});
|
|
11
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type DefaultGeoJsonFeatureProperties, DefaultGeoJsonFeaturePropertiesSchema } from './properties.js';
|
|
3
|
+
export declare const GeoJsonFeatureSchema: <T extends z.ZodTypeAny = typeof DefaultGeoJsonFeaturePropertiesSchema>(propertiesSchema?: T) => z.ZodObject<{
|
|
4
|
+
geometry: z.ZodUnion<[z.ZodObject<{
|
|
5
|
+
coordinates: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
6
|
+
type: z.ZodDefault<z.ZodLiteral<"Point">>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
type: "Point";
|
|
9
|
+
coordinates: [import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number];
|
|
10
|
+
}, {
|
|
11
|
+
coordinates: [number, number] | [number, number, number];
|
|
12
|
+
type?: "Point" | undefined;
|
|
13
|
+
}>, z.ZodObject<{
|
|
14
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
15
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPoint">>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
type: "MultiPoint";
|
|
18
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
19
|
+
}, {
|
|
20
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
21
|
+
type?: "MultiPoint" | undefined;
|
|
22
|
+
}>, z.ZodObject<{
|
|
23
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
24
|
+
type: z.ZodDefault<z.ZodLiteral<"LineString">>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
type: "LineString";
|
|
27
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
28
|
+
}, {
|
|
29
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
30
|
+
type?: "LineString" | undefined;
|
|
31
|
+
}>, z.ZodObject<{
|
|
32
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, "many">;
|
|
33
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiLineString">>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
type: "MultiLineString";
|
|
36
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
37
|
+
}, {
|
|
38
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
39
|
+
type?: "MultiLineString" | undefined;
|
|
40
|
+
}>, z.ZodObject<{
|
|
41
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">;
|
|
42
|
+
type: z.ZodDefault<z.ZodLiteral<"Polygon">>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
type: "Polygon";
|
|
45
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
46
|
+
}, {
|
|
47
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
48
|
+
type?: "Polygon" | undefined;
|
|
49
|
+
}>, z.ZodObject<{
|
|
50
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">, "many">;
|
|
51
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPolygon">>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
type: "MultiPolygon";
|
|
54
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][][];
|
|
55
|
+
}, {
|
|
56
|
+
coordinates: ([number, number] | [number, number, number])[][][];
|
|
57
|
+
type?: "MultiPolygon" | undefined;
|
|
58
|
+
}>]>;
|
|
59
|
+
properties: z.ZodDefault<z.ZodNullable<T>>;
|
|
60
|
+
type: z.ZodLiteral<"Feature">;
|
|
61
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
62
|
+
geometry: z.ZodUnion<[z.ZodObject<{
|
|
63
|
+
coordinates: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
64
|
+
type: z.ZodDefault<z.ZodLiteral<"Point">>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
type: "Point";
|
|
67
|
+
coordinates: [import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number];
|
|
68
|
+
}, {
|
|
69
|
+
coordinates: [number, number] | [number, number, number];
|
|
70
|
+
type?: "Point" | undefined;
|
|
71
|
+
}>, z.ZodObject<{
|
|
72
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
73
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPoint">>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
type: "MultiPoint";
|
|
76
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
77
|
+
}, {
|
|
78
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
79
|
+
type?: "MultiPoint" | undefined;
|
|
80
|
+
}>, z.ZodObject<{
|
|
81
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
82
|
+
type: z.ZodDefault<z.ZodLiteral<"LineString">>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
type: "LineString";
|
|
85
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
86
|
+
}, {
|
|
87
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
88
|
+
type?: "LineString" | undefined;
|
|
89
|
+
}>, z.ZodObject<{
|
|
90
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, "many">;
|
|
91
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiLineString">>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
type: "MultiLineString";
|
|
94
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
95
|
+
}, {
|
|
96
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
97
|
+
type?: "MultiLineString" | undefined;
|
|
98
|
+
}>, z.ZodObject<{
|
|
99
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">;
|
|
100
|
+
type: z.ZodDefault<z.ZodLiteral<"Polygon">>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
type: "Polygon";
|
|
103
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
104
|
+
}, {
|
|
105
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
106
|
+
type?: "Polygon" | undefined;
|
|
107
|
+
}>, z.ZodObject<{
|
|
108
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">, "many">;
|
|
109
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPolygon">>;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
type: "MultiPolygon";
|
|
112
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][][];
|
|
113
|
+
}, {
|
|
114
|
+
coordinates: ([number, number] | [number, number, number])[][][];
|
|
115
|
+
type?: "MultiPolygon" | undefined;
|
|
116
|
+
}>]>;
|
|
117
|
+
properties: z.ZodDefault<z.ZodNullable<T>>;
|
|
118
|
+
type: z.ZodLiteral<"Feature">;
|
|
119
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
120
|
+
geometry: z.ZodUnion<[z.ZodObject<{
|
|
121
|
+
coordinates: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
122
|
+
type: z.ZodDefault<z.ZodLiteral<"Point">>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
type: "Point";
|
|
125
|
+
coordinates: [import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number];
|
|
126
|
+
}, {
|
|
127
|
+
coordinates: [number, number] | [number, number, number];
|
|
128
|
+
type?: "Point" | undefined;
|
|
129
|
+
}>, z.ZodObject<{
|
|
130
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
131
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPoint">>;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
type: "MultiPoint";
|
|
134
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
135
|
+
}, {
|
|
136
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
137
|
+
type?: "MultiPoint" | undefined;
|
|
138
|
+
}>, z.ZodObject<{
|
|
139
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
140
|
+
type: z.ZodDefault<z.ZodLiteral<"LineString">>;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
type: "LineString";
|
|
143
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
144
|
+
}, {
|
|
145
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
146
|
+
type?: "LineString" | undefined;
|
|
147
|
+
}>, z.ZodObject<{
|
|
148
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, "many">;
|
|
149
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiLineString">>;
|
|
150
|
+
}, "strip", z.ZodTypeAny, {
|
|
151
|
+
type: "MultiLineString";
|
|
152
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
153
|
+
}, {
|
|
154
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
155
|
+
type?: "MultiLineString" | undefined;
|
|
156
|
+
}>, z.ZodObject<{
|
|
157
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">;
|
|
158
|
+
type: z.ZodDefault<z.ZodLiteral<"Polygon">>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
type: "Polygon";
|
|
161
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
162
|
+
}, {
|
|
163
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
164
|
+
type?: "Polygon" | undefined;
|
|
165
|
+
}>, z.ZodObject<{
|
|
166
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">, "many">;
|
|
167
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPolygon">>;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
type: "MultiPolygon";
|
|
170
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][][];
|
|
171
|
+
}, {
|
|
172
|
+
coordinates: ([number, number] | [number, number, number])[][][];
|
|
173
|
+
type?: "MultiPolygon" | undefined;
|
|
174
|
+
}>]>;
|
|
175
|
+
properties: z.ZodDefault<z.ZodNullable<T>>;
|
|
176
|
+
type: z.ZodLiteral<"Feature">;
|
|
177
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
178
|
+
export type GeoJsonFeature<T = DefaultGeoJsonFeatureProperties> = Omit<z.infer<ReturnType<typeof GeoJsonFeatureSchema>>, 'properties'> & {
|
|
179
|
+
properties: null | T;
|
|
180
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GeoJsonLineStringGeometrySchema } from '../geometry/line-string.js';
|
|
4
|
+
import { GeoJsonMultiLineStringGeometrySchema } from '../geometry/multi-line-string.js';
|
|
5
|
+
import { GeoJsonMultiPointGeometrySchema } from '../geometry/multi-point.js';
|
|
6
|
+
import { GeoJsonMultiPolygonGeometrySchema } from '../geometry/multi-polygon.js';
|
|
7
|
+
import { GeoJsonPointGeometrySchema } from '../geometry/point.js';
|
|
8
|
+
import { GeoJsonPolygonGeometrySchema } from '../geometry/polygon.js';
|
|
9
|
+
import { DefaultGeoJsonFeaturePropertiesSchema } from './properties.js';
|
|
10
|
+
/* * */
|
|
11
|
+
export const GeoJsonFeatureSchema = (propertiesSchema = DefaultGeoJsonFeaturePropertiesSchema) => {
|
|
12
|
+
return z.object({
|
|
13
|
+
geometry: z.union([
|
|
14
|
+
GeoJsonPointGeometrySchema,
|
|
15
|
+
GeoJsonMultiPointGeometrySchema,
|
|
16
|
+
GeoJsonLineStringGeometrySchema,
|
|
17
|
+
GeoJsonMultiLineStringGeometrySchema,
|
|
18
|
+
GeoJsonPolygonGeometrySchema,
|
|
19
|
+
GeoJsonMultiPolygonGeometrySchema,
|
|
20
|
+
]),
|
|
21
|
+
properties: propertiesSchema.nullable().default(null),
|
|
22
|
+
type: z.literal('Feature'),
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GeoJsonLineStringGeometrySchema: z.ZodObject<{
|
|
3
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
4
|
+
type: z.ZodDefault<z.ZodLiteral<"LineString">>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
type: "LineString";
|
|
7
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
8
|
+
}, {
|
|
9
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
10
|
+
type?: "LineString" | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type GeoJsonLineStringGeometry = z.infer<typeof GeoJsonLineStringGeometrySchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GeoJsonPositionSchema } from '../base/position.js';
|
|
4
|
+
/* * */
|
|
5
|
+
export const GeoJsonLineStringGeometrySchema = z.object({
|
|
6
|
+
coordinates: z.array(GeoJsonPositionSchema).min(2),
|
|
7
|
+
type: z.literal('LineString').default('LineString'),
|
|
8
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GeoJsonMultiLineStringGeometrySchema: z.ZodObject<{
|
|
3
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, "many">;
|
|
4
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiLineString">>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
type: "MultiLineString";
|
|
7
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
8
|
+
}, {
|
|
9
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
10
|
+
type?: "MultiLineString" | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type GeoJsonMultiLineStringGeometry = z.infer<typeof GeoJsonMultiLineStringGeometrySchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GeoJsonPositionSchema } from '../base/position.js';
|
|
4
|
+
/* * */
|
|
5
|
+
export const GeoJsonMultiLineStringGeometrySchema = z.object({
|
|
6
|
+
coordinates: z.array(z.array(GeoJsonPositionSchema).min(2)).min(1),
|
|
7
|
+
type: z.literal('MultiLineString').default('MultiLineString'),
|
|
8
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GeoJsonMultiPointGeometrySchema: z.ZodObject<{
|
|
3
|
+
coordinates: z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">;
|
|
4
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPoint">>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
type: "MultiPoint";
|
|
7
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[];
|
|
8
|
+
}, {
|
|
9
|
+
coordinates: ([number, number] | [number, number, number])[];
|
|
10
|
+
type?: "MultiPoint" | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type GeoJsonMultiPointGeometry = z.infer<typeof GeoJsonMultiPointGeometrySchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GeoJsonPositionSchema } from '../base/position.js';
|
|
4
|
+
/* * */
|
|
5
|
+
export const GeoJsonMultiPointGeometrySchema = z.object({
|
|
6
|
+
coordinates: z.array(GeoJsonPositionSchema),
|
|
7
|
+
type: z.literal('MultiPoint').default('MultiPoint'),
|
|
8
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GeoJsonMultiPolygonGeometrySchema: z.ZodObject<{
|
|
3
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">, "many">;
|
|
4
|
+
type: z.ZodDefault<z.ZodLiteral<"MultiPolygon">>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
type: "MultiPolygon";
|
|
7
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][][];
|
|
8
|
+
}, {
|
|
9
|
+
coordinates: ([number, number] | [number, number, number])[][][];
|
|
10
|
+
type?: "MultiPolygon" | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type GeoJsonMultiPolygonGeometry = z.infer<typeof GeoJsonMultiPolygonGeometrySchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GeoJsonLinearRingSchema } from '../base/linear-ring.js';
|
|
4
|
+
/* * */
|
|
5
|
+
export const GeoJsonMultiPolygonGeometrySchema = z.object({
|
|
6
|
+
coordinates: z.array(z.array(GeoJsonLinearRingSchema).min(1)).min(1),
|
|
7
|
+
type: z.literal('MultiPolygon').default('MultiPolygon'),
|
|
8
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GeoJsonPointGeometrySchema: z.ZodObject<{
|
|
3
|
+
coordinates: z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>;
|
|
4
|
+
type: z.ZodDefault<z.ZodLiteral<"Point">>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
type: "Point";
|
|
7
|
+
coordinates: [import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number];
|
|
8
|
+
}, {
|
|
9
|
+
coordinates: [number, number] | [number, number, number];
|
|
10
|
+
type?: "Point" | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type GeoJsonPointGeometry = z.infer<typeof GeoJsonPointGeometrySchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GeoJsonPolygonGeometrySchema: z.ZodObject<{
|
|
3
|
+
coordinates: z.ZodArray<z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>], null>, z.ZodTuple<[z.ZodEffects<z.ZodNumber, import("../index.js").Longitude, number>, z.ZodEffects<z.ZodNumber, import("../index.js").Latitude, number>, z.ZodNumber], null>]>, "many">, ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[], ([number, number] | [number, number, number])[]>, "many">;
|
|
4
|
+
type: z.ZodDefault<z.ZodLiteral<"Polygon">>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
type: "Polygon";
|
|
7
|
+
coordinates: ([import("../index.js").Longitude, import("../index.js").Latitude] | [import("../index.js").Longitude, import("../index.js").Latitude, number])[][];
|
|
8
|
+
}, {
|
|
9
|
+
coordinates: ([number, number] | [number, number, number])[][];
|
|
10
|
+
type?: "Polygon" | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export type GeoJsonPolygonGeometry = z.infer<typeof GeoJsonPolygonGeometrySchema>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { GeoJsonLinearRingSchema } from '../base/linear-ring.js';
|
|
4
|
+
/* * */
|
|
5
|
+
export const GeoJsonPolygonGeometrySchema = z.object({
|
|
6
|
+
coordinates: z.array(GeoJsonLinearRingSchema).min(1),
|
|
7
|
+
type: z.literal('Polygon').default('Polygon'),
|
|
8
|
+
});
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Latitude } from '../geojson/base/latitude.js';
|
|
3
|
+
import { type Longitude } from '../geojson/base/longitude.js';
|
|
4
|
+
/**
|
|
5
|
+
* The encoded polyline for a geographic LineString,
|
|
6
|
+
* with values in E6 format (6 decimal places
|
|
7
|
+
* of precision in latitude and longitude).
|
|
8
|
+
*/
|
|
9
|
+
export type EncodedPolyline = string & {
|
|
10
|
+
__brand: 'EncodedPolyline';
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The schema for a encoded polyline value,
|
|
14
|
+
* with values in E6 format (6 decimal places
|
|
15
|
+
* of precision in latitude and longitude).
|
|
16
|
+
*/
|
|
17
|
+
export declare const EncodedPolylineSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, EncodedPolyline, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Validate an encoded polyline value.
|
|
20
|
+
* @param value The encoded polyline value to validate.
|
|
21
|
+
* @throws An error if the encoded polyline value is invalid.
|
|
22
|
+
* @returns The validated encoded polyline value.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isEncodedPolyline(value: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Parses an encoded polyline.
|
|
27
|
+
* @param encoded The encoded polyline to parse.
|
|
28
|
+
* @param onPoint A callback function that receives the latitude
|
|
29
|
+
* and longitude values for each decoded coordinate.
|
|
30
|
+
* @throws An error if the input is malformed.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseEncodedPolyline(encoded: string, onPoint?: (lat: Latitude, lng: Longitude) => void): void;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { LatitudeSchema } from '../geojson/base/latitude.js';
|
|
4
|
+
import { LongitudeSchema } from '../geojson/base/longitude.js';
|
|
5
|
+
/**
|
|
6
|
+
* The schema for a encoded polyline value,
|
|
7
|
+
* with values in E6 format (6 decimal places
|
|
8
|
+
* of precision in latitude and longitude).
|
|
9
|
+
*/
|
|
10
|
+
export const EncodedPolylineSchema = z
|
|
11
|
+
.string()
|
|
12
|
+
.refine(isEncodedPolyline, { message: 'Invalid encoded polyline' })
|
|
13
|
+
.transform(value => value);
|
|
14
|
+
/**
|
|
15
|
+
* Validate an encoded polyline value.
|
|
16
|
+
* @param value The encoded polyline value to validate.
|
|
17
|
+
* @throws An error if the encoded polyline value is invalid.
|
|
18
|
+
* @returns The validated encoded polyline value.
|
|
19
|
+
*/
|
|
20
|
+
export function isEncodedPolyline(value) {
|
|
21
|
+
try {
|
|
22
|
+
parseEncodedPolyline(value);
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parses an encoded polyline.
|
|
31
|
+
* @param encoded The encoded polyline to parse.
|
|
32
|
+
* @param onPoint A callback function that receives the latitude
|
|
33
|
+
* and longitude values for each decoded coordinate.
|
|
34
|
+
* @throws An error if the input is malformed.
|
|
35
|
+
*/
|
|
36
|
+
export function parseEncodedPolyline(encoded, onPoint) {
|
|
37
|
+
// Initialize the index to 0.
|
|
38
|
+
let index = 0;
|
|
39
|
+
let lat = 0;
|
|
40
|
+
let lng = 0;
|
|
41
|
+
// Define a function to read a value
|
|
42
|
+
// from the encoded polyline at the current index.
|
|
43
|
+
function readValue() {
|
|
44
|
+
let result = 0;
|
|
45
|
+
let shift = 0;
|
|
46
|
+
// Loop until the end of the encoded polyline is reached.
|
|
47
|
+
while (true) {
|
|
48
|
+
// If the end of the encoded polyline is reached, throw an error.
|
|
49
|
+
if (index >= encoded.length)
|
|
50
|
+
throw new Error('Unexpected end of encoded polyline.');
|
|
51
|
+
// Get the next character in the encoded polyline.
|
|
52
|
+
const char = encoded.charCodeAt(index++);
|
|
53
|
+
// If the character is not a valid character, throw an error.
|
|
54
|
+
if (char < 63 || char > 126)
|
|
55
|
+
throw new Error(`Invalid character '${String.fromCharCode(char)}'.`);
|
|
56
|
+
// Get the byte value of the character.
|
|
57
|
+
const byte = char - 63;
|
|
58
|
+
// Add the byte value to the result
|
|
59
|
+
// and shift the result by the number of bits.
|
|
60
|
+
result |= (byte & 0x1f) << shift;
|
|
61
|
+
shift += 5;
|
|
62
|
+
// If the byte value is not the last byte, break the loop.
|
|
63
|
+
if ((byte & 0x20) === 0)
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
// If the result is odd, negate it.
|
|
67
|
+
return (result & 1) ? ~(result >> 1) : (result >> 1);
|
|
68
|
+
}
|
|
69
|
+
// Loop until the end of the encoded polyline is reached.
|
|
70
|
+
while (index < encoded.length) {
|
|
71
|
+
// Read the next values from the encoded polyline.
|
|
72
|
+
lat += readValue(); // Read the latitude value.
|
|
73
|
+
lng += readValue(); // Read the longitude value.
|
|
74
|
+
// Validate the latitude and longitude values.
|
|
75
|
+
const validatedLat = LatitudeSchema.parse(lat / 1e6);
|
|
76
|
+
const validatedLng = LongitudeSchema.parse(lng / 1e6);
|
|
77
|
+
// Call the callback function with the decoded coordinate.
|
|
78
|
+
onPoint?.(validatedLat, validatedLng);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './encoded-polyline.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './encoded-polyline.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tmlmobilidade/go-types-geo",
|
|
3
|
+
"version": "20260828.1636.54",
|
|
4
|
+
"author": {
|
|
5
|
+
"email": "iso@tmlmobilidade.pt",
|
|
6
|
+
"name": "TML-ISO"
|
|
7
|
+
},
|
|
8
|
+
"license": "AGPL-3.0-or-later",
|
|
9
|
+
"homepage": "https://go.tmlmobilidade.pt",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/tmlmobilidade/go/issues"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/tmlmobilidade/go.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"public transit",
|
|
19
|
+
"tml",
|
|
20
|
+
"transportes metropolitanos de lisboa",
|
|
21
|
+
"go"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc && resolve-tspaths",
|
|
34
|
+
"lint": "eslint ./src/ && tsc --noEmit",
|
|
35
|
+
"lint:fix": "eslint ./src/ --fix",
|
|
36
|
+
"watch": "tsc-watch --onSuccess 'resolve-tspaths'"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"zod": "3.25.76"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@tmlmobilidade/go-utils-tsconfig": "*",
|
|
43
|
+
"@types/node": "26.1.2",
|
|
44
|
+
"resolve-tspaths": "0.8.23",
|
|
45
|
+
"tsc-watch": "7.2.1",
|
|
46
|
+
"typescript": "6.0.3"
|
|
47
|
+
}
|
|
48
|
+
}
|