@golemio/parkings
Version:
Golemio Parkings Module
42 lines • 2.51 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TskParkingSectionLevelTransformation = void 0;
const SourceEnum_1 = require("../../helpers/constants/SourceEnum");
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
const wkt_1 = require("@terraformer/wkt");
const GeodataHelper_1 = require("../helpers/GeodataHelper");
let TskParkingSectionLevelTransformation = exports.TskParkingSectionLevelTransformation = class TskParkingSectionLevelTransformation extends AbstractTransformation_1.AbstractTransformation {
constructor(specialAccess) {
super();
this.specialAccess = specialAccess;
this.name = "TskParkingSectionLevelTransformation";
this.transformInternal = (zone) => {
const location = (0, wkt_1.wktToGeoJSON)(zone.borderWKT);
return {
id: SourceEnum_1.SourceEnum.TSK_V2 + "-" + zone.idSectionItem,
data_provider: "www.tsk-praha.cz",
location,
centroid: (0, GeodataHelper_1.getPointOnFeature)(location),
total_spot_number: zone.projectedCapacity,
source: SourceEnum_1.SourceEnum.TSK_V2,
source_id: zone.idSection,
special_access: this.specialAccess ? [this.specialAccess] : undefined,
};
};
}
};
exports.TskParkingSectionLevelTransformation = TskParkingSectionLevelTransformation = __decorate([
(0, tsyringe_1.injectable)(),
__metadata("design:paramtypes", [String])
], TskParkingSectionLevelTransformation);
//# sourceMappingURL=TskParkingSectionLevelTransformation.js.map