UNPKG

@golemio/parkings

Version:
38 lines 1.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ZtpParkingZonesTransformation = void 0; const transformations_1 = require("@golemio/core/dist/integration-engine/transformations"); const SourceEnum_1 = require("../../helpers/constants/SourceEnum"); class ZtpParkingZonesTransformation extends transformations_1.BaseTransformation { constructor(transformationDate) { super(); this.transform = async (data) => { let parkings = []; for (const element of data) { const parking = await this.transformElement(element); parkings.push(parking); } return parkings; }; this.transformElement = async (element) => { let parkingName = "Parkoviště ZTP"; return { id: `ipr-ztp-ztp-${element.properties.OBJECTID.toString()}`, source: SourceEnum_1.SourceEnum.IPR, source_id: `ztp-${element.properties.OBJECTID.toString()}`, data_provider: "opendata.iprpraha.cz", date_modified: this.transformationDate, location: element.geometry, name: parkingName, total_spot_number: element.properties.POCET_PS, parking_type: "disabled_parking", centroid: element.geometry, active: true, }; }; this.name = "ZtpParkings"; this.transformationDate = transformationDate.toISOString(); } } exports.ZtpParkingZonesTransformation = ZtpParkingZonesTransformation; //# sourceMappingURL=ZtpParkingZonesTransformation.js.map