Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###############################################################################
- # 5. Assign Each Segment a Color Based on its Length #
- ###############################################################################
- # List to store colors
- roadColors = []
- # The length is in meters
- for item in data:
- if "length" in item.keys():
- if item["length"] <= 100:
- color = "#d40a47"
- elif item["length"] > 100 and item["length"] <= 200:
- color = "#e78119"
- elif item["length"] > 200 and item["length"] <= 400:
- color = "#30bab0"
- elif item["length"] > 400 and item["length"] <= 800:
- color = "#bbbbbb"
- else:
- color = "w"
- roadColors.append(color)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement