Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch accessibility map: fix two small issues #747

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion locales/en/transit.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
"AccessibilityMapDuration": "Total duration (minutes)",
"AccessibilityMapNumberOfPolygons": "Number of polygons to calculate",
"AccessibilityMapDelta": "Delta (minutes)",
"AccessibilityMapDeltaInterval": "Delat interval (minutes)",
"AccessibilityMapDeltaInterval": "Delta interval (minutes)",
"AccessibilityMapExampleDurationAndNumberOfPolygons": "A total duration of 60 minutes with a number of polygons of 3 implies that we will obtain three polygons: accessibility at 20 minutes, 40 minutes and 60 minutes.",
"AccessibilityMapExampleDelta": "A delta of 15 minutes with an interval of 5 minutes implies that the polygon area will be averaged over polygons obtained 15 minutes before, 10 minutes before, 5 minutes before, at specified time, 5 minutes after, 10 minutes after and 15 minutes after the specified departure or arrival time.",
"AccessibilityMapAreaSquareKm": "Square km",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ class BatchAccessibilityMapResultProcessorFile implements BatchAccessibilityMapR
for (let i = 0; i < numberOfPolygons; i++) {
polygonAttributes[`polygon${i}Duration`] = 0;
polygonAttributes[`polygon${i}AreaSqKm`] = 0;
polygonAttributes[`polygon${i}Geojson`] = '';
if (this.parameters.withGeometries) {
polygonAttributes[`polygon${i}Geojson`] = '';
}
}

fileManager.writeFileAbsolute(this.resultsCsvFilePath, '');
Expand Down Expand Up @@ -146,7 +148,9 @@ class BatchAccessibilityMapResultProcessorFile implements BatchAccessibilityMapR
for (let i = 0; i < results.polygons.features.length; i++) {
polygonAttributes[`polygon${i}Duration`] = results.polygons.features[i].properties?.durationMinutes;
polygonAttributes[`polygon${i}AreaSqKm`] = results.polygons.features[i].properties?.areaSqKm;
polygonAttributes[`polygon${i}Geojson`] = JSON.stringify(_omit(results.polygons.features[i], 'properties'));
if (this.parameters.withGeometries) {
polygonAttributes[`polygon${i}Geojson`] = JSON.stringify(_omit(results.polygons.features[i], 'properties'));
}
}
if (this._csvStream) {
this._csvStream.write(unparse([Object.assign(csvResults, polygonAttributes)], { header: false }) + '\n');
Expand Down
Loading