Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEASolution as attached.
1. Thanks to @NicoleJohnson for inspiration of how to address the issue of missing points for each storm segments.
2. Also made some improvements on Nicole's approach:
Nicole's proach:
Add new point by extracting the last row of each segment and adding 1 for both segment number and sequence ID within each segment
Potential issue:
The new row could have the same sequence ID as original one for certain segment. Hence, when creating the line, there could be multiple points with the same sequence.
For example:
Segment number | Sequence ID | |
Last Row | 2 | 6 |
New Line (add 1 for both) | 3 | 7 |
However, segment 3 has already a point with sequence of 7 originally. As a result, the line per the final map for segment 3 as below looks slightly funny.
Approach to address:
Add new point by extracting the first row of each segment and minus 1 for segment number. But the sequence ID equals 1+ ID of the last row from previous segment, which means the new point is the last one for the previous segment. Hence, we can avoid different points with the same sequence under certain segment.
For example:
Segment number | Sequence ID | |
Frist Row | 3 | 1 |
Last Row of Previous Segment | 2 | 6 |
New Row (seg = first row -1, ID = last row +1) | 2 | 7 |
Cheers!
enjoying these spatial challenges giving me a decent understanding of how to use them well