osm2geojson-ultra
Version:
a faster & more complete OSM & Overpass (either in xml or in json formats) to geojson convertor - 4x faster than xmldom + osmtogeojson in most situations - implemented in TypeScript with txml for XML parsing
20 lines (19 loc) • 495 B
JavaScript
import { OsmObject } from "./osm-object.js";
export class Output extends OsmObject {
constructor(type, id, refElems) {
super(type, id, refElems);
}
setGeometry(geometry) {
this.geometry = geometry;
}
toFeature() {
if (this.geometry) {
return {
type: "Feature",
id: this.getCompositeId(),
properties: this.getProps(),
geometry: this.geometry,
};
}
}
}