@golemio/parkings 1.4.7 → 1.4.8-rc.841782822
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integration-engine/helpers/GeodataHelper.d.ts +1 -1
- package/dist/integration-engine/helpers/GeodataHelper.js +4 -4
- package/dist/integration-engine/helpers/GeodataHelper.js.map +1 -1
- package/dist/integration-engine/helpers/LocationBuilderHelper.js +2 -3
- package/dist/integration-engine/helpers/LocationBuilderHelper.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { IIPRParkingElementTransformed } from "../transformations/IPRParkingTransformation";
|
|
2
2
|
import { IGeoCoordinatesMultiPolygon, IGeoCoordinatesPoint, IGeoCoordinatesPolygon, TGeoCoordinates } from "@golemio/core/dist/output-gateway/Geo";
|
|
3
3
|
export declare const mergeGeometries: (data: IIPRParkingElementTransformed[]) => IGeoCoordinatesMultiPolygon | IGeoCoordinatesPolygon;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getPointOnFeature: (location: TGeoCoordinates) => IGeoCoordinatesPoint;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.getPointOnFeature = exports.mergeGeometries = void 0;
|
|
27
27
|
const turf = __importStar(require("@turf/turf"));
|
|
28
28
|
const Geo_1 = require("@golemio/core/dist/output-gateway/Geo");
|
|
29
29
|
const mergeGeometries = (data) => {
|
|
@@ -50,11 +50,11 @@ const mergeGeometries = (data) => {
|
|
|
50
50
|
return result;
|
|
51
51
|
};
|
|
52
52
|
exports.mergeGeometries = mergeGeometries;
|
|
53
|
-
const
|
|
53
|
+
const getPointOnFeature = (location) => {
|
|
54
54
|
if (location.type === "Point") {
|
|
55
55
|
return location;
|
|
56
56
|
}
|
|
57
|
-
return turf.
|
|
57
|
+
return turf.pointOnFeature(location).geometry;
|
|
58
58
|
};
|
|
59
|
-
exports.
|
|
59
|
+
exports.getPointOnFeature = getPointOnFeature;
|
|
60
60
|
//# sourceMappingURL=GeodataHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeodataHelper.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/GeodataHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAEnC,+DAM+C;AAExC,MAAM,eAAe,GAAG,CAAC,IAAqC,EAAwD,EAAE;IAC3H,IAAI,MAAM,CAAC;IAEX,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;QACxB,IAAI,MAAM,EAAE;YACR,IAAI,MAAM,CAAC,IAAI,KAAK,wBAAkB,CAAC,OAAO,EAAE;gBAC5C,MAAM,GAAG;oBACL,IAAI,EAAE,wBAAkB,CAAC,YAAY;oBACrC,WAAW,EAAE,CAAC,MAAM,CAAC,WAA2B,CAAC;iBACpD,CAAC;aACL;YAED,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,wBAAkB,CAAC,OAAO,EAAE;gBACrD,MAAM,CAAC,WAA8B,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAA2B,CAAC,CAAC;aAC7F;iBAAM;gBACF,MAAM,CAAC,WAA8B,CAAC,IAAI,CAAC,GAAI,OAAO,CAAC,QAAQ,CAAC,WAA8B,CAAC,CAAC;aACpG;SACJ;aAAM;YACH,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;SAC7B;KACJ;IAED,OAAO,MAA8D,CAAC;AAC1E,CAAC,CAAC;AAvBW,QAAA,eAAe,mBAuB1B;AAEK,MAAM,
|
|
1
|
+
{"version":3,"file":"GeodataHelper.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/GeodataHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AAEnC,+DAM+C;AAExC,MAAM,eAAe,GAAG,CAAC,IAAqC,EAAwD,EAAE;IAC3H,IAAI,MAAM,CAAC;IAEX,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;QACxB,IAAI,MAAM,EAAE;YACR,IAAI,MAAM,CAAC,IAAI,KAAK,wBAAkB,CAAC,OAAO,EAAE;gBAC5C,MAAM,GAAG;oBACL,IAAI,EAAE,wBAAkB,CAAC,YAAY;oBACrC,WAAW,EAAE,CAAC,MAAM,CAAC,WAA2B,CAAC;iBACpD,CAAC;aACL;YAED,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,wBAAkB,CAAC,OAAO,EAAE;gBACrD,MAAM,CAAC,WAA8B,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAA2B,CAAC,CAAC;aAC7F;iBAAM;gBACF,MAAM,CAAC,WAA8B,CAAC,IAAI,CAAC,GAAI,OAAO,CAAC,QAAQ,CAAC,WAA8B,CAAC,CAAC;aACpG;SACJ;aAAM;YACH,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;SAC7B;KACJ;IAED,OAAO,MAA8D,CAAC;AAC1E,CAAC,CAAC;AAvBW,QAAA,eAAe,mBAuB1B;AAEK,MAAM,iBAAiB,GAAG,CAAC,QAAyB,EAAwB,EAAE;IACjF,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;QAC3B,OAAO,QAAQ,CAAC;KACnB;IAED,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,QAAgC,CAAC;AAC1E,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B"}
|
|
@@ -33,7 +33,7 @@ const getLocationData = (dataTsk, dataIprTransformed) => __awaiter(void 0, void
|
|
|
33
33
|
];
|
|
34
34
|
}
|
|
35
35
|
return dataIprTransformed.map((el) => {
|
|
36
|
-
const centroid = (0, GeodataHelper_1.
|
|
36
|
+
const centroid = (0, GeodataHelper_1.getPointOnFeature)(el.location);
|
|
37
37
|
return Object.assign(Object.assign({ id: el.id }, locationBaseData), { location: el.location, total_spot_number: el.total_spot_number, centroid });
|
|
38
38
|
});
|
|
39
39
|
});
|
|
@@ -48,8 +48,7 @@ const mergeParkingZoneDataSets = (dataTsk, dataIpr) => __awaiter(void 0, void 0,
|
|
|
48
48
|
parkingData.location = (0, GeodataHelper_1.mergeGeometries)(dataIpr[item.source_id]);
|
|
49
49
|
parkingData.data_provider += IPR_DATA_PROVIDER;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
parkingData.centroid = (0, GeodataHelper_1.getCentroid)(parkingData.location);
|
|
51
|
+
parkingData.centroid = (0, GeodataHelper_1.getPointOnFeature)(parkingData.location);
|
|
53
52
|
const locationData = yield getLocationData(parkingData, dataIpr[item.source_id]);
|
|
54
53
|
result.parking.push(parkingData);
|
|
55
54
|
result.locations.push(...locationData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationBuilderHelper.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/LocationBuilderHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,oEAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"LocationBuilderHelper.js","sourceRoot":"","sources":["../../../src/integration-engine/helpers/LocationBuilderHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,oEAA6C;AAC7C,mDAA+E;AAE/E,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAElD,MAAM,eAAe,GAAG,CACpB,OAAiB,EACjB,kBAA+D,EACpC,EAAE;IAC7B,MAAM,gBAAgB,GAAiC;QACnD,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,SAAS,EAAE,OAAO,CAAC,SAAS;KAC/B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,CAAC,CAAC;YAChE,WAAW,CAAC,aAAa,IAAI,iBAAiB,CAAC;SAClD;QAED,WAAW,CAAC,QAAQ,GAAG,IAAA,iCAAiB,EAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAE/D,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAEjF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;KAC1C;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAA,CAAC;AAzBW,QAAA,wBAAwB,4BAyBnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/parkings",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.8-rc.841782822",
|
|
4
4
|
"description": "Golemio Parkings Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@commitlint/cli": "^11.0.0",
|
|
33
33
|
"@commitlint/config-conventional": "^11.0.0",
|
|
34
34
|
"@golemio/cli": "1.4.2",
|
|
35
|
-
"@golemio/core": "1.6.
|
|
35
|
+
"@golemio/core": "1.6.6",
|
|
36
36
|
"@golemio/eslint-config": "1.1.0",
|
|
37
37
|
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
|
38
38
|
"@types/chai": "4.2.3",
|
|
@@ -70,4 +70,4 @@
|
|
|
70
70
|
"@turf/turf": "^6.5.0",
|
|
71
71
|
"uuid-by-string": "^3.0.2"
|
|
72
72
|
}
|
|
73
|
-
}
|
|
73
|
+
}
|