@golemio/parkings
Version:
Golemio Parkings Module
27 lines • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OsmParkingSpaceTransformation = void 0;
const SourceEnum_1 = require("../../../helpers/constants/SourceEnum");
const GeodataHelper_1 = require("../../helpers/GeodataHelper");
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
class OsmParkingSpaceTransformation extends AbstractTransformation_1.AbstractTransformation {
constructor() {
super(...arguments);
this.name = "OsmParkingSpaceTransformation";
this.transformInternal = (element) => {
const transformed = {
id: `${SourceEnum_1.SourceEnum.OSM}-${element.properties.parking_space_id}`,
source: SourceEnum_1.SourceEnum.OSM,
source_id: element.properties.parking_id,
data_provider: "www.openstreetmap.org",
location: element.geometry,
centroid: (0, GeodataHelper_1.getPointOnFeature)(element.geometry),
total_spot_number: element.properties.capacity,
special_access: element.properties.access ? [element.properties.access] : null,
};
return transformed;
};
}
}
exports.OsmParkingSpaceTransformation = OsmParkingSpaceTransformation;
//# sourceMappingURL=OsmParkingSpaceTransformation.js.map