Repository navigation
Allow ways to cross when separated temporally - #137
danrademacher merged 5 commits into
Conversation
| if (date1[1] > date2[1]) return false; | ||
| if (date1[2] && date2[2] && date1[2] > date2[2]) return false; | ||
| if (date1[3] && date2[3] && date1[3] > date2[3]) return false; |
There was a problem hiding this comment.
Dates are only compared to the lowest common precision. If one feature ends on “1970” and another begins on “1970-01-01”, the two features are not considered to overlap temporally. This contrasts with the vector tile server, which rounds start_date down to the beginning of the month or year and end_date up to the end of the month or year when filtering features in the vector tiles.
557269d to
ff589c3
Compare
ff589c3 to
56ecdac
Compare
56ecdac to
12e7073
Compare
|
I’ve rebased this PR atop the staging branch for OpenHistoricalMap/issues#395 and added a similar date-based exception to the Almost Junctions and Very Close Points validation rules. |
| <path | ||
| d="M10,1 L9,2 L9,3.062 C5.056,3.556 2,6.922 2,11 C2,15.418 5.582,19 10,19 C14.418,19 18,15.418 18,11 C18,8.533 16.881,6.341 15.125,4.875 L13.719,6.281 C15.114,7.38 16,9.086 16,11 C16,14.314 13.314,17 10,17 C6.686,17 4,14.314 4,11 C4,8.024 6.159,5.567 9,5.094 L9,6 L10,7 L13,4 L10,1 z" | ||
| fill="currentColor" | ||
| id="path132" /> | ||
| <path | ||
| id="path4001" | ||
| style="stroke-width:0.681386" | ||
| d="M 8.5,9.5 V 16 h 1 l 1,-4.5 H 15 v -1 z" /> |
There was a problem hiding this comment.
This is a new icon based on operation-rotate.svg but with clock hands instead of a dot in the middle. I considered using temaki-clock for consistency with the Clock preset, but the clock hands seem a little off-center and the clock face is too large compared to the other validation fix icons.
| @@ -670,4 +670,57 @@ export function utilDatesOverlap(tags1, tags2) { | |||
| (isAfter(start2, start1) && isBefore(start2, end1)) || | |||
| (isAfter(end1, start2) && isBefore(end1, end2)) || | |||
| (isAfter(end2, start1) && isBefore(end2, end1))); | |||
There was a problem hiding this comment.
A couple lines of this method went missing in this merge.
| @@ -324,6 +324,39 @@ describe('iD.util', function() { | |||
| {start_date: '2000-01-01', end_date: '2038-01-01'})).to.eql(false); | |||
| expect(iD.utilDatesOverlap({start_date: '2000-01-01', end_date: '2038-01-01'}, | |||
| {start_date: '1970-01-01', end_date: '2000-01-01'})).to.eql(false); | |||
| fixes.push(new validationIssueFix({ | ||
| icon: 'iD-operation-change-date-range', | ||
| title: t.append('issues.fix.change_date_range.title') | ||
| })); |
There was a problem hiding this comment.
This additional fix is causing two tests to fail because there are more suggested fixes than expected. I updated the test in #142.


Avoid warning about crossing ways when the two ways’ date ranges don’t overlap or only touch. Mention the possibility of temporal separation in the validation rule’s message and suggestions.
Fixes OpenHistoricalMap/issues#288.