@mailwoman/spatial 4.9.0 → 4.11.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 +45 -2
- package/out/bbox.d.ts +206 -0
- package/out/bbox.d.ts.map +1 -0
- package/out/bbox.js +267 -0
- package/out/bbox.js.map +1 -0
- package/out/countries/codes.d.ts +528 -0
- package/out/countries/codes.d.ts.map +1 -0
- package/out/countries/codes.js +520 -0
- package/out/countries/codes.js.map +1 -0
- package/out/countries/index.d.ts +8 -0
- package/out/countries/index.d.ts.map +1 -0
- package/out/countries/index.js +8 -0
- package/out/countries/index.js.map +1 -0
- package/out/countries/names.d.ts +23 -0
- package/out/countries/names.d.ts.map +1 -0
- package/out/countries/names.js +264 -0
- package/out/countries/names.js.map +1 -0
- package/out/feature.d.ts +70 -0
- package/out/feature.d.ts.map +1 -0
- package/out/feature.js +8 -0
- package/out/feature.js.map +1 -0
- package/out/geometries/collection.d.ts +29 -0
- package/out/geometries/collection.d.ts.map +1 -0
- package/out/geometries/collection.js +9 -0
- package/out/geometries/collection.js.map +1 -0
- package/out/geometries/index.d.ts +12 -0
- package/out/geometries/index.d.ts.map +1 -0
- package/out/geometries/index.js +12 -0
- package/out/geometries/index.js.map +1 -0
- package/out/geometries/line-string.d.ts +44 -0
- package/out/geometries/line-string.d.ts.map +1 -0
- package/out/geometries/line-string.js +9 -0
- package/out/geometries/line-string.js.map +1 -0
- package/out/geometries/point.d.ts +208 -0
- package/out/geometries/point.d.ts.map +1 -0
- package/out/geometries/point.js +258 -0
- package/out/geometries/point.js.map +1 -0
- package/out/geometries/polygon.d.ts +175 -0
- package/out/geometries/polygon.d.ts.map +1 -0
- package/out/geometries/polygon.js +94 -0
- package/out/geometries/polygon.js.map +1 -0
- package/out/google/index.d.ts +7 -0
- package/out/google/index.d.ts.map +1 -0
- package/out/google/index.js +7 -0
- package/out/google/index.js.map +1 -0
- package/out/google/place-id.d.ts +39 -0
- package/out/google/place-id.d.ts.map +1 -0
- package/out/google/place-id.js +22 -0
- package/out/google/place-id.js.map +1 -0
- package/out/h3/index.d.ts +38 -0
- package/out/h3/index.d.ts.map +1 -0
- package/out/h3/index.js +57 -0
- package/out/h3/index.js.map +1 -0
- package/out/index.d.ts +16 -0
- package/out/index.d.ts.map +1 -0
- package/out/index.js +16 -0
- package/out/index.js.map +1 -0
- package/out/objects.d.ts +93 -0
- package/out/objects.d.ts.map +1 -0
- package/out/objects.js +42 -0
- package/out/objects.js.map +1 -0
- package/out/position.d.ts +176 -0
- package/out/position.d.ts.map +1 -0
- package/out/position.js +169 -0
- package/out/position.js.map +1 -0
- package/out/projection.d.ts +23 -0
- package/out/projection.d.ts.map +1 -0
- package/out/projection.js +24 -0
- package/out/projection.js.map +1 -0
- package/out/regions/codes.d.ts +30 -0
- package/out/regions/codes.d.ts.map +1 -0
- package/out/regions/codes.js +33 -0
- package/out/regions/codes.js.map +1 -0
- package/out/regions/index.d.ts +8 -0
- package/out/regions/index.d.ts.map +1 -0
- package/out/regions/index.js +8 -0
- package/out/regions/index.js.map +1 -0
- package/out/regions/names.d.ts +20 -0
- package/out/regions/names.d.ts.map +1 -0
- package/out/regions/names.js +20 -0
- package/out/regions/names.js.map +1 -0
- package/out/sdk/index.d.ts +7 -0
- package/out/sdk/index.d.ts.map +1 -0
- package/out/sdk/index.js +7 -0
- package/out/sdk/index.js.map +1 -0
- package/out/sdk/well-known-text.d.ts +62 -0
- package/out/sdk/well-known-text.d.ts.map +1 -0
- package/out/sdk/well-known-text.js +61 -0
- package/out/sdk/well-known-text.js.map +1 -0
- package/out/tsconfig.tsbuildinfo +1 -0
- package/package.json +48 -43
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* List of all countries in the world.
|
|
8
|
+
*
|
|
9
|
+
* @category Geographic
|
|
10
|
+
* @see https://en.wikipedia.org/wiki/List_of_countries
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export const CountryNames = [
|
|
14
|
+
"Afghanistan",
|
|
15
|
+
"Albania",
|
|
16
|
+
"Algeria",
|
|
17
|
+
"American Samoa",
|
|
18
|
+
"Andorra",
|
|
19
|
+
"Angola",
|
|
20
|
+
"Anguilla",
|
|
21
|
+
"Antarctica",
|
|
22
|
+
"Antigua and Barbuda",
|
|
23
|
+
"Argentina",
|
|
24
|
+
"Armenia",
|
|
25
|
+
"Aruba",
|
|
26
|
+
"Australia",
|
|
27
|
+
"Austria",
|
|
28
|
+
"Azerbaijan",
|
|
29
|
+
"Bahamas",
|
|
30
|
+
"Bahrain",
|
|
31
|
+
"Bangladesh",
|
|
32
|
+
"Barbados",
|
|
33
|
+
"Belarus",
|
|
34
|
+
"Belgium",
|
|
35
|
+
"Belize",
|
|
36
|
+
"Benin",
|
|
37
|
+
"Bermuda",
|
|
38
|
+
"Bhutan",
|
|
39
|
+
"Bolivia",
|
|
40
|
+
"Bonaire, Sint Eustatius and Saba",
|
|
41
|
+
"Bosnia and Herzegovina",
|
|
42
|
+
"Botswana",
|
|
43
|
+
"Bouvet Island",
|
|
44
|
+
"Brazil",
|
|
45
|
+
"British Indian Ocean Territory",
|
|
46
|
+
"Brunei Darussalam",
|
|
47
|
+
"Bulgaria",
|
|
48
|
+
"Burkina Faso",
|
|
49
|
+
"Burundi",
|
|
50
|
+
"Cambodia",
|
|
51
|
+
"Cameroon",
|
|
52
|
+
"Canada",
|
|
53
|
+
"Cape Verde",
|
|
54
|
+
"Cayman Islands",
|
|
55
|
+
"Central African Republic",
|
|
56
|
+
"Chad",
|
|
57
|
+
"Chile",
|
|
58
|
+
"China",
|
|
59
|
+
"Christmas Island",
|
|
60
|
+
"Cocos (Keeling) Islands",
|
|
61
|
+
"Colombia",
|
|
62
|
+
"Comoros",
|
|
63
|
+
"Congo",
|
|
64
|
+
"Congo, the Democratic Republic of the",
|
|
65
|
+
"Cook Islands",
|
|
66
|
+
"Costa Rica",
|
|
67
|
+
"Cote DIvoire",
|
|
68
|
+
"Croatia",
|
|
69
|
+
"Cuba",
|
|
70
|
+
"Curaçao",
|
|
71
|
+
"Cyprus",
|
|
72
|
+
"Czech Republic",
|
|
73
|
+
"Denmark",
|
|
74
|
+
"Djibouti",
|
|
75
|
+
"Dominica",
|
|
76
|
+
"Dominican Republic",
|
|
77
|
+
"Ecuador",
|
|
78
|
+
"Egypt",
|
|
79
|
+
"El Salvador",
|
|
80
|
+
"Equatorial Guinea",
|
|
81
|
+
"Eritrea",
|
|
82
|
+
"Estonia",
|
|
83
|
+
"Ethiopia",
|
|
84
|
+
"Falkland Islands (Malvinas)",
|
|
85
|
+
"Faroe Islands",
|
|
86
|
+
"Fiji",
|
|
87
|
+
"Finland",
|
|
88
|
+
"France",
|
|
89
|
+
"French Guiana",
|
|
90
|
+
"French Polynesia",
|
|
91
|
+
"French Southern Territories",
|
|
92
|
+
"Gabon",
|
|
93
|
+
"Gambia",
|
|
94
|
+
"Georgia",
|
|
95
|
+
"Germany",
|
|
96
|
+
"Ghana",
|
|
97
|
+
"Gibraltar",
|
|
98
|
+
"Greece",
|
|
99
|
+
"Greenland",
|
|
100
|
+
"Grenada",
|
|
101
|
+
"Guadeloupe",
|
|
102
|
+
"Guam",
|
|
103
|
+
"Guatemala",
|
|
104
|
+
"Guernsey",
|
|
105
|
+
"Guinea",
|
|
106
|
+
"Guinea-Bissau",
|
|
107
|
+
"Guyana",
|
|
108
|
+
"Haiti",
|
|
109
|
+
"Heard Island and Mcdonald Islands",
|
|
110
|
+
"Holy See (Vatican City State)",
|
|
111
|
+
"Honduras",
|
|
112
|
+
"Hong Kong",
|
|
113
|
+
"Hungary",
|
|
114
|
+
"Iceland",
|
|
115
|
+
"India",
|
|
116
|
+
"Indonesia",
|
|
117
|
+
"Iran, Islamic Republic of",
|
|
118
|
+
"Iraq",
|
|
119
|
+
"Ireland",
|
|
120
|
+
"Isle of Man",
|
|
121
|
+
"Israel",
|
|
122
|
+
"Italy",
|
|
123
|
+
"Jamaica",
|
|
124
|
+
"Japan",
|
|
125
|
+
"Jersey",
|
|
126
|
+
"Jordan",
|
|
127
|
+
"Kazakhstan",
|
|
128
|
+
"Kenya",
|
|
129
|
+
"Kiribati",
|
|
130
|
+
"Korea, Democratic People's Republic of",
|
|
131
|
+
"Korea, Republic of",
|
|
132
|
+
"Kuwait",
|
|
133
|
+
"Kyrgyzstan",
|
|
134
|
+
"Lao People's Democratic Republic",
|
|
135
|
+
"Latvia",
|
|
136
|
+
"Lebanon",
|
|
137
|
+
"Lesotho",
|
|
138
|
+
"Liberia",
|
|
139
|
+
"Libya",
|
|
140
|
+
"Liechtenstein",
|
|
141
|
+
"Lithuania",
|
|
142
|
+
"Luxembourg",
|
|
143
|
+
"Macao",
|
|
144
|
+
"Macedonia, the Former Yugoslav Republic of",
|
|
145
|
+
"Madagascar",
|
|
146
|
+
"Malawi",
|
|
147
|
+
"Malaysia",
|
|
148
|
+
"Maldives",
|
|
149
|
+
"Mali",
|
|
150
|
+
"Malta",
|
|
151
|
+
"Marshall Islands",
|
|
152
|
+
"Martinique",
|
|
153
|
+
"Mauritania",
|
|
154
|
+
"Mauritius",
|
|
155
|
+
"Mayotte",
|
|
156
|
+
"Mexico",
|
|
157
|
+
"Micronesia, Federated States of",
|
|
158
|
+
"Moldova, Republic of",
|
|
159
|
+
"Monaco",
|
|
160
|
+
"Mongolia",
|
|
161
|
+
"Montenegro",
|
|
162
|
+
"Montserrat",
|
|
163
|
+
"Morocco",
|
|
164
|
+
"Mozambique",
|
|
165
|
+
"Myanmar",
|
|
166
|
+
"Namibia",
|
|
167
|
+
"Nauru",
|
|
168
|
+
"Nepal",
|
|
169
|
+
"Netherlands",
|
|
170
|
+
"New Caledonia",
|
|
171
|
+
"New Zealand",
|
|
172
|
+
"Nicaragua",
|
|
173
|
+
"Niger",
|
|
174
|
+
"Nigeria",
|
|
175
|
+
"Niue",
|
|
176
|
+
"Norfolk Island",
|
|
177
|
+
"Northern Mariana Islands",
|
|
178
|
+
"Norway",
|
|
179
|
+
"Oman",
|
|
180
|
+
"Pakistan",
|
|
181
|
+
"Palau",
|
|
182
|
+
"Palestine, State of",
|
|
183
|
+
"Panama",
|
|
184
|
+
"Papua New Guinea",
|
|
185
|
+
"Paraguay",
|
|
186
|
+
"Peru",
|
|
187
|
+
"Philippines",
|
|
188
|
+
"Pitcairn",
|
|
189
|
+
"Poland",
|
|
190
|
+
"Portugal",
|
|
191
|
+
"Puerto Rico",
|
|
192
|
+
"Qatar",
|
|
193
|
+
"Reunion",
|
|
194
|
+
"Romania",
|
|
195
|
+
"Russian Federation",
|
|
196
|
+
"Rwanda",
|
|
197
|
+
"Saint Barthélemy",
|
|
198
|
+
"Saint Helena, Ascension and Tristan da Cunha",
|
|
199
|
+
"Saint Kitts and Nevis",
|
|
200
|
+
"Saint Lucia",
|
|
201
|
+
"Saint Martin (French part)",
|
|
202
|
+
"Saint Pierre and Miquelon",
|
|
203
|
+
"Saint Vincent and the Grenadines",
|
|
204
|
+
"Samoa",
|
|
205
|
+
"San Marino",
|
|
206
|
+
"Sao Tome and Principe",
|
|
207
|
+
"Saudi Arabia",
|
|
208
|
+
"Senegal",
|
|
209
|
+
"Serbia",
|
|
210
|
+
"Seychelles",
|
|
211
|
+
"Sierra Leone",
|
|
212
|
+
"Singapore",
|
|
213
|
+
"Sint Maarten (Dutch part)",
|
|
214
|
+
"Slovakia",
|
|
215
|
+
"Slovenia",
|
|
216
|
+
"Solomon Islands",
|
|
217
|
+
"Somalia",
|
|
218
|
+
"South Africa",
|
|
219
|
+
"South Georgia and the South Sandwich Islands",
|
|
220
|
+
"South Sudan",
|
|
221
|
+
"Spain",
|
|
222
|
+
"Sri Lanka",
|
|
223
|
+
"Sudan",
|
|
224
|
+
"Suriname",
|
|
225
|
+
"Svalbard and Jan Mayen",
|
|
226
|
+
"Swaziland",
|
|
227
|
+
"Sweden",
|
|
228
|
+
"Switzerland",
|
|
229
|
+
"Syrian Arab Republic",
|
|
230
|
+
"Taiwan (Province of China)",
|
|
231
|
+
"Tajikistan",
|
|
232
|
+
"Tanzania, United Republic of",
|
|
233
|
+
"Thailand",
|
|
234
|
+
"Timor-Leste",
|
|
235
|
+
"Togo",
|
|
236
|
+
"Tokelau",
|
|
237
|
+
"Tonga",
|
|
238
|
+
"Trinidad and Tobago",
|
|
239
|
+
"Tunisia",
|
|
240
|
+
"Turkey",
|
|
241
|
+
"Turkmenistan",
|
|
242
|
+
"Turks and Caicos Islands",
|
|
243
|
+
"Tuvalu",
|
|
244
|
+
"Uganda",
|
|
245
|
+
"Ukraine",
|
|
246
|
+
"United Arab Emirates",
|
|
247
|
+
"United Kingdom",
|
|
248
|
+
"United States",
|
|
249
|
+
"United States Minor Outlying Islands",
|
|
250
|
+
"Uruguay",
|
|
251
|
+
"Uzbekistan",
|
|
252
|
+
"Vanuatu",
|
|
253
|
+
"Venezuela",
|
|
254
|
+
"Viet Nam",
|
|
255
|
+
"Virgin Islands (British)",
|
|
256
|
+
"Virgin Islands (U.S.)",
|
|
257
|
+
"Wallis and Futuna",
|
|
258
|
+
"Western Sahara",
|
|
259
|
+
"Yemen",
|
|
260
|
+
"Zambia",
|
|
261
|
+
"Zimbabwe",
|
|
262
|
+
"Åland Islands",
|
|
263
|
+
];
|
|
264
|
+
//# sourceMappingURL=names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"names.js","sourceRoot":"","sources":["../../countries/names.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,aAAa;IACb,SAAS;IACT,SAAS;IACT,gBAAgB;IAChB,SAAS;IACT,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,qBAAqB;IACrB,WAAW;IACX,SAAS;IACT,OAAO;IACP,WAAW;IACX,SAAS;IACT,YAAY;IACZ,SAAS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S;IACT,OAAO;IACP,qBAAqB;IACrB,SAAS;IACT,QAAQ;IACR,cAAc;IACd,0BAA0B;IAC1B,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,sBAAsB;IACtB,gBAAgB;IAChB,eAAe;IACf,sCAAsC;IACtC,SAAS;IACT,YAAY;IACZ,SAAS;IACT,WAAW;IACX,UAAU;IACV,0BAA0B;IAC1B,uBAAuB;IACvB,mBAAmB;IACnB,gBAAgB;IAChB,OAAO;IACP,QAAQ;IACR,UAAU;IACV,eAAe;CACsB,CAAA"}
|
package/out/feature.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*/
|
|
6
|
+
import { type GeometryLiteral } from "./geometries/index.js";
|
|
7
|
+
export interface IdentifiableGeoFeature {
|
|
8
|
+
GEOID: any;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A feature object which contains a geometry and associated properties.
|
|
12
|
+
*
|
|
13
|
+
* @see https://tools.ietf.org/html/rfc7946#section-3.2
|
|
14
|
+
*/
|
|
15
|
+
export interface GeoFeature<G = GeometryLiteral, P extends object | null = null> {
|
|
16
|
+
/**
|
|
17
|
+
* Declares the type of GeoJSON object as a `Feature`.
|
|
18
|
+
*/
|
|
19
|
+
type: "Feature";
|
|
20
|
+
/**
|
|
21
|
+
* The feature's geometry.
|
|
22
|
+
*
|
|
23
|
+
* @see {@linkcode GeometryLiteral}
|
|
24
|
+
*/
|
|
25
|
+
geometry: G;
|
|
26
|
+
/**
|
|
27
|
+
* A unique identifier for the feature, such as a UUID, a serial number, or a name.
|
|
28
|
+
*/
|
|
29
|
+
id: P extends IdentifiableGeoFeature ? P["GEOID"] : string | number | undefined | null;
|
|
30
|
+
/**
|
|
31
|
+
* Additional properties associated with a GeoJSON object.
|
|
32
|
+
*/
|
|
33
|
+
properties: P;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Given a GeoFeature type, extract its geometry type.
|
|
37
|
+
*/
|
|
38
|
+
export type ExtractGeometryType<T> = T extends GeoFeature<infer G, any> ? G : never;
|
|
39
|
+
/**
|
|
40
|
+
* Given a GeoFeature type, extract its properties type.
|
|
41
|
+
*/
|
|
42
|
+
export type ExtractPropertiesType<T> = T extends GeoFeature<any, infer P> ? P : never;
|
|
43
|
+
/**
|
|
44
|
+
* A collection of feature objects.
|
|
45
|
+
*/
|
|
46
|
+
export interface GeoFeatureCollection<G = GeometryLiteral, P extends Record<string, any> | null = Record<string, any>> {
|
|
47
|
+
/**
|
|
48
|
+
* Declares the type of GeoJSON object as a `FeatureCollection`.
|
|
49
|
+
*/
|
|
50
|
+
type: "FeatureCollection";
|
|
51
|
+
/**
|
|
52
|
+
* An array of feature objects.
|
|
53
|
+
*/
|
|
54
|
+
features: GeoFeature<G, P>[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Given a GeoFeature type, extract its feature collection type.
|
|
58
|
+
*
|
|
59
|
+
* This is useful for "collecting" features into a single collection.
|
|
60
|
+
*/
|
|
61
|
+
export type InferGeoFeatureCollection<T> = T extends GeoFeature<infer G, infer P> ? GeoFeatureCollection<G, P> : T extends GeoFeature<infer G, infer P>[] ? GeoFeatureCollection<G, P> : never;
|
|
62
|
+
/**
|
|
63
|
+
* Given a GeoFeatureCollection type, extract its feature type.
|
|
64
|
+
*/
|
|
65
|
+
export type ExtractFeatureType<T> = T extends GeoFeatureCollection<infer G, any> ? G : never;
|
|
66
|
+
/**
|
|
67
|
+
* A utility type for wrapping a {@linkcode GeoFeature} type in a {@linkcode GeoFeatureCollection}.
|
|
68
|
+
*/
|
|
69
|
+
export type CastAsFeatureCollection<T extends GeoFeature> = GeoFeatureCollection<ExtractGeometryType<T>, ExtractPropertiesType<T>>;
|
|
70
|
+
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GACnC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,GACvC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,KAAK,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS,oBAAoB,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAE5F;;GAEG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,UAAU,IAAI,oBAAoB,CAC/E,mBAAmB,CAAC,CAAC,CAAC,EACtB,qBAAqB,CAAC,CAAC,CAAC,CACxB,CAAA"}
|
package/out/feature.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../feature.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uDAAuD;AACvD,OAAO,EAAwB,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* GeoJSON Geometry Collection
|
|
7
|
+
*/
|
|
8
|
+
import type { GeoObjectLiteral } from "../objects.js";
|
|
9
|
+
import type { LineStringLiteral, MultiLineStringLiteral } from "./line-string.js";
|
|
10
|
+
import type { MultiPointLiteral, PointLiteral } from "./point.js";
|
|
11
|
+
import type { MultiPolygonLiteral, PolygonLiteral } from "./polygon.js";
|
|
12
|
+
/**
|
|
13
|
+
* Union of the GeoJSON geometry types.
|
|
14
|
+
*/
|
|
15
|
+
export type GeometryLiteral = PointLiteral | MultiPointLiteral | LineStringLiteral | MultiLineStringLiteral | PolygonLiteral | MultiPolygonLiteral;
|
|
16
|
+
/**
|
|
17
|
+
* A GeoJSON Geometry Collection.
|
|
18
|
+
*/
|
|
19
|
+
export interface GeometryCollection extends GeoObjectLiteral {
|
|
20
|
+
/**
|
|
21
|
+
* Declares the type of GeoJSON object as a `GeometryCollection`.
|
|
22
|
+
*/
|
|
23
|
+
type: "GeometryCollection";
|
|
24
|
+
/**
|
|
25
|
+
* An array of geometry objects.
|
|
26
|
+
*/
|
|
27
|
+
geometries: GeometryLiteral[];
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../geometries/collection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAEvE;;GAEG;AACH,MAAM,MAAM,eAAe,GACxB,YAAY,GACZ,iBAAiB,GACjB,iBAAiB,GACjB,sBAAsB,GACtB,cAAc,GACd,mBAAmB,CAAA;AAEtB;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC3D;;OAEG;IACH,IAAI,EAAE,oBAAoB,CAAA;IAC1B;;OAEG;IACH,UAAU,EAAE,eAAe,EAAE,CAAA;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../geometries/collection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* GeoJSON Geometry Entry Point
|
|
7
|
+
*/
|
|
8
|
+
export * from "./collection.js";
|
|
9
|
+
export * from "./line-string.js";
|
|
10
|
+
export * from "./point.js";
|
|
11
|
+
export * from "./polygon.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../geometries/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* GeoJSON Geometry Entry Point
|
|
7
|
+
*/
|
|
8
|
+
export * from "./collection.js";
|
|
9
|
+
export * from "./line-string.js";
|
|
10
|
+
export * from "./point.js";
|
|
11
|
+
export * from "./polygon.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../geometries/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software.
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* GeoJSON Line String
|
|
7
|
+
*/
|
|
8
|
+
import type { GeoObjectLiteral } from "../objects.js";
|
|
9
|
+
import type { Coordinates2D, Coordinates3D } from "../position.js";
|
|
10
|
+
/**
|
|
11
|
+
* An array of positions forming a line, such as a road or a path.
|
|
12
|
+
*/
|
|
13
|
+
export type LineStringPath = [...points: Array<Coordinates2D | Coordinates3D>];
|
|
14
|
+
/**
|
|
15
|
+
* A collection of points forming a line, such as a road or a path.
|
|
16
|
+
*/
|
|
17
|
+
export interface LineStringLiteral extends GeoObjectLiteral {
|
|
18
|
+
/**
|
|
19
|
+
* Declares the type of GeoJSON object as a `LineString` geometry.
|
|
20
|
+
*/
|
|
21
|
+
type: "LineString";
|
|
22
|
+
/**
|
|
23
|
+
* An array of positions for each point in the geometry.
|
|
24
|
+
*
|
|
25
|
+
* @see {@linkcode GeoJSONPosition} for more information.
|
|
26
|
+
*/
|
|
27
|
+
coordinates: LineStringPath;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A collection of points forming a line, such as a road or a path.
|
|
31
|
+
*/
|
|
32
|
+
export interface MultiLineStringLiteral extends GeoObjectLiteral {
|
|
33
|
+
/**
|
|
34
|
+
* Declares the type of GeoJSON object as a `MultiLineString` geometry.
|
|
35
|
+
*/
|
|
36
|
+
type: "MultiLineString";
|
|
37
|
+
/**
|
|
38
|
+
* An array for each line in the geometry.
|
|
39
|
+
*
|
|
40
|
+
* @see {@linkcode GeoJSONPosition} for more information.
|
|
41
|
+
*/
|
|
42
|
+
coordinates: LineStringPath[];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=line-string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-string.d.ts","sourceRoot":"","sources":["../../geometries/line-string.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAElE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,aAAa,GAAG,aAAa,CAAC,CAAC,CAAA;AAE9E;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IAC1D;;OAEG;IACH,IAAI,EAAE,YAAY,CAAA;IAClB;;;;OAIG;IACH,WAAW,EAAE,cAAc,CAAA;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC/D;;OAEG;IACH,IAAI,EAAE,iBAAiB,CAAA;IACvB;;;;OAIG;IACH,WAAW,EAAE,cAAc,EAAE,CAAA;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-string.js","sourceRoot":"","sources":["../../geometries/line-string.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|