@golemio/parkings
Version:
Golemio Parkings Module
31 lines • 1.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZtpParkingZonesTransformation = void 0;
const SourceEnum_1 = require("../../helpers/constants/SourceEnum");
const constants_1 = require("../workers/constants");
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
class ZtpParkingZonesTransformation extends AbstractTransformation_1.AbstractTransformation {
constructor(transformationDate) {
super();
this.transformInternal = (element) => {
const globalId = element.properties.globalid?.replace(/[{}]/g, "");
return {
id: `ipr-ztp-ztp-${globalId}`,
source: SourceEnum_1.SourceEnum.IPR,
source_id: `ztp-${globalId}`,
data_provider: "opendata.iprpraha.cz",
date_modified: this.transformationDate,
location: element.geometry,
name: constants_1.ZTP_PARKING_NAME,
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