osm2geojson-lite 2.0.1 → 2.1.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 +33 -16
- package/dist/cli.mjs +1474 -6
- package/dist/index.cjs +1469 -0
- package/dist/index.d.ts +28 -5
- package/dist/index.mjs +1274 -729
- package/dist/polytags.json +24 -45
- package/package.json +20 -10
- package/dist/index.js +0 -924
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region node_modules/@types/geojson/index.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The value values for the "type" property of GeoJSON Objects.
|
|
4
3
|
* https://tools.ietf.org/html/rfc7946#section-1.4
|
|
@@ -174,8 +173,14 @@ interface FeatureCollection<G extends Geometry | null = Geometry, P = GeoJsonPro
|
|
|
174
173
|
type: "FeatureCollection";
|
|
175
174
|
features: Array<Feature<G, P>>;
|
|
176
175
|
}
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
type PolygonRule = {
|
|
177
|
+
ignore?: string[];
|
|
178
|
+
include?: string[];
|
|
179
|
+
exclude?: string[];
|
|
180
|
+
whitelist?: string[];
|
|
181
|
+
blacklist?: string[];
|
|
182
|
+
};
|
|
183
|
+
type PolygonTags = Record<string, PolygonRule>;
|
|
179
184
|
interface IOptions {
|
|
180
185
|
/**
|
|
181
186
|
* When it's set to `true`, the returned geojson will include all elements that meet the specified conditions in `FeatureCollection` format;
|
|
@@ -195,9 +200,27 @@ interface IOptions {
|
|
|
195
200
|
* @default true
|
|
196
201
|
*/
|
|
197
202
|
excludeWay?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* An OSM element ID in the form of `type/id`, e.g. `way/123`. When set, only that
|
|
205
|
+
* feature is returned instead of a `FeatureCollection`.
|
|
206
|
+
* @default undefined
|
|
207
|
+
*/
|
|
208
|
+
elementId?: string;
|
|
209
|
+
/**
|
|
210
|
+
* When set to `true`, features that reference missing nodes/ways/relations
|
|
211
|
+
* receive an `@tainted: true` property. Matches `osm2geojson-ultra`.
|
|
212
|
+
* @default false
|
|
213
|
+
*/
|
|
214
|
+
tainted?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Alternate polygon tag rules for ways. The shape matches `polytags.json`:
|
|
217
|
+
* `{ key: { ignore?, include?, exclude? } }`. Legacy `whitelist` /
|
|
218
|
+
* `blacklist` spellings are also accepted.
|
|
219
|
+
* @default undefined (built-in rules)
|
|
220
|
+
*/
|
|
221
|
+
polygonTags?: PolygonTags;
|
|
198
222
|
}
|
|
199
223
|
declare function osm2geojson(osm: string | {
|
|
200
224
|
[k: string]: any;
|
|
201
|
-
}, opts?: IOptions): FeatureCollection<GeometryObject
|
|
202
|
-
//#endregion
|
|
225
|
+
}, opts?: IOptions): FeatureCollection<GeometryObject> | Feature<any, any> | GeometryObject | undefined;
|
|
203
226
|
export { osm2geojson as default };
|