Skip to content

Commit

Permalink
Imagery validation fix (#5295)
Browse files Browse the repository at this point in the history
* Remove check for duplicate images
* Remove commented out code and add TODO
  • Loading branch information
shefalijoshi committed Jun 6, 2022
1 parent 7cad3c0 commit e286359
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/plugins/imagery/mixins/imageryData.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,17 @@ export default {
}
},
isDatumValid(datum) {
//TODO: Add a check to see if there are duplicate images (identical image timestamp and url subsequently)
if (!datum) {
return false;
}

// const [lastHistoryItem] = this.imageHistory.slice(-1);
const lastHistoryItem = this.imageHistory[this.imageHistory.length - 1];
const datumURL = this.formatImageUrl(datum);
const lastHistoryURL = this.formatImageUrl(lastHistoryItem);

// or it is before the last datum in the history
const datumTimeCheck = this.parseTime(datum);
const historyTimeCheck = this.parseTime(lastHistoryItem);
const bounds = this.timeContext.bounds();

// datum is not valid if it matches the last datum in history,
const matchesLast = (datumTimeCheck === historyTimeCheck) && (datumURL === lastHistoryURL);
const isOutOfBounds = datumTimeCheck < bounds.start || datumTimeCheck > bounds.end;

return !matchesLast && !isOutOfBounds;
return !isOutOfBounds;
},
formatImageUrl(datum) {
if (!datum) {
Expand Down

0 comments on commit e286359

Please sign in to comment.