@osm-conflation-engine/cli 0.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.schema.json +236 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +436 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +436 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +49 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import { OsmFeature as OsmFeature$1, OsmPatchFeature, Tags } from "osm-api";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@types+geojson@7946.0.16/node_modules/@types/geojson/index.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The value values for the "type" property of GeoJSON Objects.
|
|
6
|
+
* https://tools.ietf.org/html/rfc7946#section-1.4
|
|
7
|
+
*/
|
|
8
|
+
type GeoJsonTypes = GeoJSON["type"];
|
|
9
|
+
/**
|
|
10
|
+
* Bounding box
|
|
11
|
+
* https://tools.ietf.org/html/rfc7946#section-5
|
|
12
|
+
*/
|
|
13
|
+
type BBox = [number, number, number, number] | [number, number, number, number, number, number];
|
|
14
|
+
/**
|
|
15
|
+
* A Position is an array of coordinates.
|
|
16
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.1
|
|
17
|
+
* Array should contain between two and three elements.
|
|
18
|
+
* The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
|
|
19
|
+
* but the current specification only allows X, Y, and (optionally) Z to be defined.
|
|
20
|
+
*
|
|
21
|
+
* Note: the type will not be narrowed down to `[number, number] | [number, number, number]` due to
|
|
22
|
+
* marginal benefits and the large impact of breaking change.
|
|
23
|
+
*
|
|
24
|
+
* See previous discussions on the type narrowing:
|
|
25
|
+
* - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21590|Nov 2017}
|
|
26
|
+
* - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67773|Dec 2023}
|
|
27
|
+
* - {@link https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/71441| Dec 2024}
|
|
28
|
+
*
|
|
29
|
+
* One can use a
|
|
30
|
+
* {@link https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates|user-defined type guard that returns a type predicate}
|
|
31
|
+
* to determine if a position is a 2D or 3D position.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* import type { Position } from 'geojson';
|
|
35
|
+
*
|
|
36
|
+
* type StrictPosition = [x: number, y: number] | [x: number, y: number, z: number]
|
|
37
|
+
*
|
|
38
|
+
* function isStrictPosition(position: Position): position is StrictPosition {
|
|
39
|
+
* return position.length === 2 || position.length === 3
|
|
40
|
+
* };
|
|
41
|
+
*
|
|
42
|
+
* let position: Position = [-116.91, 45.54];
|
|
43
|
+
*
|
|
44
|
+
* let x: number;
|
|
45
|
+
* let y: number;
|
|
46
|
+
* let z: number | undefined;
|
|
47
|
+
*
|
|
48
|
+
* if (isStrictPosition(position)) {
|
|
49
|
+
* // `tsc` would throw an error if we tried to destructure a fourth parameter
|
|
50
|
+
* [x, y, z] = position;
|
|
51
|
+
* } else {
|
|
52
|
+
* throw new TypeError("Position is not a 2D or 3D point");
|
|
53
|
+
* }
|
|
54
|
+
*/
|
|
55
|
+
type Position = number[];
|
|
56
|
+
/**
|
|
57
|
+
* The base GeoJSON object.
|
|
58
|
+
* https://tools.ietf.org/html/rfc7946#section-3
|
|
59
|
+
* The GeoJSON specification also allows foreign members
|
|
60
|
+
* (https://tools.ietf.org/html/rfc7946#section-6.1)
|
|
61
|
+
* Developers should use "&" type in TypeScript or extend the interface
|
|
62
|
+
* to add these foreign members.
|
|
63
|
+
*/
|
|
64
|
+
interface GeoJsonObject {
|
|
65
|
+
// Don't include foreign members directly into this type def.
|
|
66
|
+
// in order to preserve type safety.
|
|
67
|
+
// [key: string]: any;
|
|
68
|
+
/**
|
|
69
|
+
* Specifies the type of GeoJSON object.
|
|
70
|
+
*/
|
|
71
|
+
type: GeoJsonTypes;
|
|
72
|
+
/**
|
|
73
|
+
* Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
|
|
74
|
+
* The value of the bbox member is an array of length 2*n where n is the number of dimensions
|
|
75
|
+
* represented in the contained geometries, with all axes of the most southwesterly point
|
|
76
|
+
* followed by all axes of the more northeasterly point.
|
|
77
|
+
* The axes order of a bbox follows the axes order of geometries.
|
|
78
|
+
* https://tools.ietf.org/html/rfc7946#section-5
|
|
79
|
+
*/
|
|
80
|
+
bbox?: BBox | undefined;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Union of GeoJSON objects.
|
|
84
|
+
*/
|
|
85
|
+
type GeoJSON<G extends Geometry | null = Geometry, P = GeoJsonProperties> = G | Feature<G, P> | FeatureCollection<G, P>;
|
|
86
|
+
/**
|
|
87
|
+
* Geometry object.
|
|
88
|
+
* https://tools.ietf.org/html/rfc7946#section-3
|
|
89
|
+
*/
|
|
90
|
+
type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection;
|
|
91
|
+
/**
|
|
92
|
+
* Point geometry object.
|
|
93
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.2
|
|
94
|
+
*/
|
|
95
|
+
interface Point extends GeoJsonObject {
|
|
96
|
+
type: "Point";
|
|
97
|
+
coordinates: Position;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* MultiPoint geometry object.
|
|
101
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.3
|
|
102
|
+
*/
|
|
103
|
+
interface MultiPoint extends GeoJsonObject {
|
|
104
|
+
type: "MultiPoint";
|
|
105
|
+
coordinates: Position[];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* LineString geometry object.
|
|
109
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.4
|
|
110
|
+
*/
|
|
111
|
+
interface LineString extends GeoJsonObject {
|
|
112
|
+
type: "LineString";
|
|
113
|
+
coordinates: Position[];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* MultiLineString geometry object.
|
|
117
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.5
|
|
118
|
+
*/
|
|
119
|
+
interface MultiLineString extends GeoJsonObject {
|
|
120
|
+
type: "MultiLineString";
|
|
121
|
+
coordinates: Position[][];
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Polygon geometry object.
|
|
125
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.6
|
|
126
|
+
*/
|
|
127
|
+
interface Polygon extends GeoJsonObject {
|
|
128
|
+
type: "Polygon";
|
|
129
|
+
coordinates: Position[][];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* MultiPolygon geometry object.
|
|
133
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.7
|
|
134
|
+
*/
|
|
135
|
+
interface MultiPolygon extends GeoJsonObject {
|
|
136
|
+
type: "MultiPolygon";
|
|
137
|
+
coordinates: Position[][][];
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Geometry Collection
|
|
141
|
+
* https://tools.ietf.org/html/rfc7946#section-3.1.8
|
|
142
|
+
*/
|
|
143
|
+
interface GeometryCollection<G extends Geometry = Geometry> extends GeoJsonObject {
|
|
144
|
+
type: "GeometryCollection";
|
|
145
|
+
geometries: G[];
|
|
146
|
+
}
|
|
147
|
+
type GeoJsonProperties = {
|
|
148
|
+
[name: string]: any;
|
|
149
|
+
} | null;
|
|
150
|
+
/**
|
|
151
|
+
* A feature object which contains a geometry and associated properties.
|
|
152
|
+
* https://tools.ietf.org/html/rfc7946#section-3.2
|
|
153
|
+
*/
|
|
154
|
+
interface Feature<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
|
155
|
+
type: "Feature";
|
|
156
|
+
/**
|
|
157
|
+
* The feature's geometry
|
|
158
|
+
*/
|
|
159
|
+
geometry: G;
|
|
160
|
+
/**
|
|
161
|
+
* A value that uniquely identifies this feature in a
|
|
162
|
+
* https://tools.ietf.org/html/rfc7946#section-3.2.
|
|
163
|
+
*/
|
|
164
|
+
id?: string | number | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Properties associated with this feature.
|
|
167
|
+
*/
|
|
168
|
+
properties: P;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* A collection of feature objects.
|
|
172
|
+
* https://tools.ietf.org/html/rfc7946#section-3.3
|
|
173
|
+
*/
|
|
174
|
+
interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonProperties> extends GeoJsonObject {
|
|
175
|
+
type: "FeatureCollection";
|
|
176
|
+
features: Array<Feature<G, P>>;
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/types/config.def.d.ts
|
|
180
|
+
interface Config {
|
|
181
|
+
$schema: (string & {}) | 'https://unpkg.com/@osm-conflation-engine/cli/dist/config.schema.json' | 'node_modules/@osm-conflation-engine/cli/config.schema.json';
|
|
182
|
+
metadata: {
|
|
183
|
+
/** format should be `https://github.com/a/b` */git_repository: string;
|
|
184
|
+
name: string;
|
|
185
|
+
description: string;
|
|
186
|
+
wiki_page: string;
|
|
187
|
+
region: string;
|
|
188
|
+
};
|
|
189
|
+
source_data: {
|
|
190
|
+
type: 'file';
|
|
191
|
+
file: string;
|
|
192
|
+
};
|
|
193
|
+
o_data: {
|
|
194
|
+
/**
|
|
195
|
+
* if you choose `pbf`, you should also define an environment
|
|
196
|
+
* variable called `OSM_AUTH`, so that metadata can be considered
|
|
197
|
+
* by the algorithm.
|
|
198
|
+
*/
|
|
199
|
+
source: {
|
|
200
|
+
type: 'pbf';
|
|
201
|
+
pbf_url: string;
|
|
202
|
+
pbf_filter: string[];
|
|
203
|
+
} | {
|
|
204
|
+
type: 'overpass';
|
|
205
|
+
overpass_query_file: string;
|
|
206
|
+
overpass_server_url?: string;
|
|
207
|
+
} | {
|
|
208
|
+
type: 'postpass';
|
|
209
|
+
postpass_query_file: string;
|
|
210
|
+
postpass_server_url?: string;
|
|
211
|
+
}; /** if the value starts and ends with `/`, then it's considered a regex */
|
|
212
|
+
tags_to_keep: string[];
|
|
213
|
+
check_date_key?: string;
|
|
214
|
+
};
|
|
215
|
+
merge: {
|
|
216
|
+
/** the key */osm_key: string; /** the column in the dataset */
|
|
217
|
+
dataset_column: string; /** optional, passed to {@link https://h3geo.org h3} @default 3 */
|
|
218
|
+
sector_resolution?: number;
|
|
219
|
+
hash?: {
|
|
220
|
+
/** if true, the coordinates will be part of the hash */location: boolean;
|
|
221
|
+
columns: string[];
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
output?: {
|
|
225
|
+
folder?: string;
|
|
226
|
+
changeset_tags?: {
|
|
227
|
+
[key: string]: string;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
e2e_tests?: {
|
|
231
|
+
ignore_list_file_path?: string;
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/constants/defaults.d.ts
|
|
236
|
+
declare const STEPS: readonly ["download", "match", "conflate"];
|
|
237
|
+
type Step = (typeof STEPS)[number];
|
|
238
|
+
declare const FILE_NAMES: {
|
|
239
|
+
readonly PBF: "o.pbf";
|
|
240
|
+
readonly OVERPASS: "o.geo.json";
|
|
241
|
+
readonly POSTPASS: "o.geo.json";
|
|
242
|
+
readonly OSM_PROCESSED_WITH_REF: "osm-processed-with-ref.jsonl";
|
|
243
|
+
readonly OSM_PROCESSED_NO_REF: "osm-processed-no-ref.jsonl";
|
|
244
|
+
readonly OSM_PROCESSED_OTHER: "osm-processed-other.json";
|
|
245
|
+
readonly IGNORE_LIST: "ignore-list.json";
|
|
246
|
+
readonly MATCHES: "matches.json";
|
|
247
|
+
};
|
|
248
|
+
type FileNames = keyof typeof FILE_NAMES;
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/types/internal.def.d.ts
|
|
251
|
+
declare global {
|
|
252
|
+
namespace NodeJS {
|
|
253
|
+
interface ProcessEnv {
|
|
254
|
+
NODE_ENV?: 'test';
|
|
255
|
+
OSM_AUTH?: string;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
interface Ctx<G extends Geometry = Geometry, P extends GeoJsonProperties = GeoJsonProperties> {
|
|
260
|
+
use_cache: boolean;
|
|
261
|
+
id: string;
|
|
262
|
+
tempFolder: string;
|
|
263
|
+
tempFileNames: Record<Lowercase<FileNames>, string>;
|
|
264
|
+
config: Config;
|
|
265
|
+
callbacks: Callbacks<G, P>;
|
|
266
|
+
warnings: string[];
|
|
267
|
+
}
|
|
268
|
+
interface SourceData<G extends Geometry = Geometry, P extends GeoJsonProperties = GeoJsonProperties> {
|
|
269
|
+
[datasetId: DatasetId]: SourceDataFeature<G, P>;
|
|
270
|
+
}
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region src/types/callbacks.def.d.ts
|
|
273
|
+
type TagDiff = OsmPatchFeature['properties'];
|
|
274
|
+
/** see microsoft/TypeScript#202 */
|
|
275
|
+
type Identity<out T> = {
|
|
276
|
+
_: T;
|
|
277
|
+
readonly __: unique symbol;
|
|
278
|
+
};
|
|
279
|
+
type OsmFeatureTypeShort = 'n' | 'w' | 'r';
|
|
280
|
+
type OsmId = `${OsmFeatureTypeShort}${number}`;
|
|
281
|
+
type DatasetId = string & Identity<'DatasetId'>;
|
|
282
|
+
type Vec2 = [lon: number, lat: number];
|
|
283
|
+
declare enum OsmFlags {
|
|
284
|
+
None = 0,
|
|
285
|
+
IsLastEditedByImporter = 1,
|
|
286
|
+
IsRecentlyChanged = 2,
|
|
287
|
+
IsChecked = 4,
|
|
288
|
+
IsCheckedRecently = 8
|
|
289
|
+
}
|
|
290
|
+
interface OsmFeature {
|
|
291
|
+
id: OsmId;
|
|
292
|
+
sectors: string[];
|
|
293
|
+
centroid: Vec2;
|
|
294
|
+
tags: Tags;
|
|
295
|
+
metadata?: Partial<Pick<OsmFeature$1, 'changeset' | 'version' | 'user' | 'timestamp'>>;
|
|
296
|
+
flags: number & OsmFlags;
|
|
297
|
+
}
|
|
298
|
+
interface SourceDataFeature<G extends Geometry = Geometry, P extends GeoJsonProperties = GeoJsonProperties> extends Feature<G, P> {
|
|
299
|
+
/** list of sector IDs (h3 hexes) that this feature passes through */
|
|
300
|
+
sectors: string[];
|
|
301
|
+
centroid: Vec2;
|
|
302
|
+
}
|
|
303
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
304
|
+
interface ConflationResultExtra {
|
|
305
|
+
createFeatures?: OsmPatchFeature[];
|
|
306
|
+
warnings?: string[];
|
|
307
|
+
}
|
|
308
|
+
interface ConflationDiff {
|
|
309
|
+
tags: TagDiff;
|
|
310
|
+
geometry?: Geometry;
|
|
311
|
+
}
|
|
312
|
+
interface SingleFeatureConflationResult {
|
|
313
|
+
group?: string;
|
|
314
|
+
diff: ConflationDiff;
|
|
315
|
+
extra?: ConflationResultExtra;
|
|
316
|
+
}
|
|
317
|
+
interface MutliFeatureConflationResult {
|
|
318
|
+
group?: string;
|
|
319
|
+
diffPerFeature: {
|
|
320
|
+
[id: OsmId]: ConflationDiff;
|
|
321
|
+
};
|
|
322
|
+
extra?: ConflationResultExtra;
|
|
323
|
+
}
|
|
324
|
+
interface Callbacks<G extends Geometry, P extends GeoJsonProperties> {
|
|
325
|
+
/**
|
|
326
|
+
* called for every OSM feature, you should return a key which is unique
|
|
327
|
+
* within its sector. For example, this could be the most important tags
|
|
328
|
+
* concatenated together, if those tags are usually unique within the
|
|
329
|
+
* local area (the sector).
|
|
330
|
+
*/
|
|
331
|
+
getLocalKeyForOsm(osmFeature: OsmFeature): string;
|
|
332
|
+
/**
|
|
333
|
+
* see docs for {@link getLocalKeyForOsm}. This is the equivilant callback
|
|
334
|
+
* for the source data, which is called for every feature.
|
|
335
|
+
*/
|
|
336
|
+
getLocalKeyForSource(sourceFeature: SourceDataFeature<G, P>): string;
|
|
337
|
+
/**
|
|
338
|
+
* optional, by default a username which ends in `_import` is considered
|
|
339
|
+
* to be an importer. Use this callback if you want to customise the
|
|
340
|
+
* behaviour.
|
|
341
|
+
*/
|
|
342
|
+
isImportUser?(username: string): boolean;
|
|
343
|
+
mergeOneToOne(input: {
|
|
344
|
+
source: SourceDataFeature<G, P>;
|
|
345
|
+
osm: OsmFeature;
|
|
346
|
+
}): MaybePromise<SingleFeatureConflationResult | undefined>;
|
|
347
|
+
mergeOneToMany?(input: {
|
|
348
|
+
source: SourceDataFeature<G, P>;
|
|
349
|
+
osm: OsmFeature[];
|
|
350
|
+
}): MaybePromise<MutliFeatureConflationResult | undefined>;
|
|
351
|
+
mergeManyToOne?(input: {
|
|
352
|
+
source: SourceDataFeature<G, P>[];
|
|
353
|
+
osm: OsmFeature;
|
|
354
|
+
}): MaybePromise<SingleFeatureConflationResult | undefined>;
|
|
355
|
+
mergeManyToMany?(input: {
|
|
356
|
+
source: SourceDataFeature<G, P>[];
|
|
357
|
+
osm: OsmFeature[];
|
|
358
|
+
}): MaybePromise<MutliFeatureConflationResult | undefined>;
|
|
359
|
+
/**
|
|
360
|
+
* called for OSM features which have a ref tag that does not exist in the
|
|
361
|
+
* source dataset. You need to decide whether to:
|
|
362
|
+
* (1) delete this feature; or
|
|
363
|
+
* (2) only remove the import related tags; or
|
|
364
|
+
* (3) do nothing.
|
|
365
|
+
*/
|
|
366
|
+
deleteFeature?(input: {
|
|
367
|
+
osm: OsmFeature;
|
|
368
|
+
}): MaybePromise<SingleFeatureConflationResult | undefined>;
|
|
369
|
+
/**
|
|
370
|
+
* Calls for each feature in the source dataset where a matching feature
|
|
371
|
+
* could not be found in OSM. If there are potential matches, these are
|
|
372
|
+
* supplied using the `osmCandidates` argument. If you choose to accept
|
|
373
|
+
* one of these candidates, return the `selection` property set to that
|
|
374
|
+
* feature's {@link OsmId}. If not, return `selection: undefined`, which
|
|
375
|
+
* will create a new OSM feature instead.
|
|
376
|
+
*/
|
|
377
|
+
create(input: {
|
|
378
|
+
source: SourceDataFeature<G, P>;
|
|
379
|
+
osmCandidates: OsmFeature[];
|
|
380
|
+
}): MaybePromise<(SingleFeatureConflationResult & {
|
|
381
|
+
/**
|
|
382
|
+
* undefined means that no selection was made, so we
|
|
383
|
+
* will create a new OSM feature instead
|
|
384
|
+
*/
|
|
385
|
+
selection: OsmId | undefined;
|
|
386
|
+
}) | undefined>;
|
|
387
|
+
/**
|
|
388
|
+
* optional, called after the conflation stage once all diffs have been
|
|
389
|
+
* allocated to a group. You can apply any addition transformations to
|
|
390
|
+
* the features in each layer.
|
|
391
|
+
*/
|
|
392
|
+
postprocessLayer?(input: {
|
|
393
|
+
group: string;
|
|
394
|
+
features: OsmPatchFeature[];
|
|
395
|
+
osmData: Record<OsmId, OsmFeature>;
|
|
396
|
+
sourceData: SourceData<G, P>;
|
|
397
|
+
}): MaybePromise<OsmPatchFeature[] | undefined>;
|
|
398
|
+
/**
|
|
399
|
+
* optional, called after the conflation stage for every group. You can
|
|
400
|
+
* return the changeset tags which will be applied to this group, and
|
|
401
|
+
* optionally `instructions` which are shown in the website UI, before
|
|
402
|
+
* someone starts working on this group.
|
|
403
|
+
*/
|
|
404
|
+
getChangesetTags?(group: string): MaybePromise<{
|
|
405
|
+
instructions?: string;
|
|
406
|
+
changesetTags?: Tags;
|
|
407
|
+
}>;
|
|
408
|
+
}
|
|
409
|
+
interface RunOptions {
|
|
410
|
+
steps?: Step[];
|
|
411
|
+
use_cache?: boolean;
|
|
412
|
+
}
|
|
413
|
+
interface ConflateResult {
|
|
414
|
+
counts: {
|
|
415
|
+
create: number;
|
|
416
|
+
edit: number;
|
|
417
|
+
delete: number;
|
|
418
|
+
perfect: number;
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
interface RunResult {
|
|
422
|
+
conflate?: ConflateResult;
|
|
423
|
+
}
|
|
424
|
+
//#endregion
|
|
425
|
+
//#region src/main.d.ts
|
|
426
|
+
declare function getTempFileNames(config: Config): Promise<Pick<Ctx, 'id' | 'tempFolder' | 'tempFileNames'>>;
|
|
427
|
+
declare function run<G extends Geometry, P extends GeoJsonProperties>(config: Config, callbacks: Callbacks<G, P>, runOptions?: RunOptions): Promise<RunResult>;
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/common/jsonl.d.ts
|
|
430
|
+
/** reads JSONL by parsing one line at a time */
|
|
431
|
+
declare function readJsonL<T, U extends string>(filePath: string, getKey: (row: T) => U): Promise<Record<U, T>>;
|
|
432
|
+
/** writes JSONL to a file by stringifying each line at a time */
|
|
433
|
+
declare function writeJsonL(filePath: string, rows: unknown[]): Promise<void>;
|
|
434
|
+
//#endregion
|
|
435
|
+
export { Callbacks, Config, ConflateResult, ConflationDiff, ConflationResultExtra, DatasetId, Identity, MutliFeatureConflationResult, OsmFeature, OsmFeatureTypeShort, OsmFlags, OsmId, RunOptions, RunResult, SingleFeatureConflationResult, SourceDataFeature, TagDiff, Vec2, getTempFileNames, readJsonL, run, writeJsonL };
|
|
436
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":["Geometry","GeoJSON","type","GeoJsonTypes","bbox","BBox","G","P","GeoJsonProperties","Feature","FeatureCollection","Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","GeometryCollection","GeoJsonObject","coordinates","Position","geometries","name","geometry","id","properties","features","Array"],"sources":["../../../node_modules/.pnpm/@types+geojson@7946.0.16/node_modules/@types/geojson/index.d.ts","../src/types/config.def.ts","../src/constants/defaults.ts","../src/types/internal.def.ts","../src/types/callbacks.def.ts","../src/main.ts","../src/common/jsonl.ts"],"x_google_ignoreList":[0],"mappings":";;;;AAqBgB;AA2ChB;;KAjDY,YAAA,GAAe,OAAO;AAiDd;AAUpB;;;AAVoB,KA3CR,IAAA;;;;;AAqEG;AAMf;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAG4B;AAM5B;;;;;;;KAzCY,QAAA;;;;;;;;;UAUK,aAAA;EAAA;EAAA;E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