Skip to content

Commit

Permalink
add segments filter. Remove Buildings and setback types
Browse files Browse the repository at this point in the history
fix errors
  • Loading branch information
Algorush committed Mar 22, 2024
1 parent 2b89a77 commit f603f97
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/streetplan/streetplan-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ function convertStreetStruct (streetProject) {
newStruct.segments = Object.values(streetProject[streetplanName][streetplanAltName].segments);

convertStreetValues(newStruct);
convertSegmentData(newStruct.segments);

// remove buildings and setback for now. To add them in another place
newStruct.segments = convertSegmentData(newStruct.segments)
.filter((segmentData) => {
return !["Buildings", "setback"].includes(segmentData['type'])
});

console.log("TEST. Converted JSON structure: ", newStruct)

return newStruct;
Expand All @@ -30,5 +36,5 @@ function convertStreetStruct (streetProject) {
module.exports.convertStreetStruct = convertStreetStruct;

function convertSegmentData (segments) {
segments.forEach(mappingUtils.convertSegment);
return segments.map(mappingUtils.convertSegment);
}

0 comments on commit f603f97

Please sign in to comment.