Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepInputs tests failing due to different extents #93

Closed
achubaty opened this issue Jan 8, 2019 · 5 comments
Closed

prepInputs tests failing due to different extents #93

achubaty opened this issue Jan 8, 2019 · 5 comments

Comments

@achubaty
Copy link
Collaborator

@achubaty achubaty commented Jan 8, 2019

Some prepInputs tests not run on appveyor/travis/CRAN are failing:

4. Failure: prepInputs doesn't work (@test-prepInputs.R#148) 
5. Failure: prepInputs doesn't work (@test-prepInputs.R#264) 

Both fail because of non-matching extents:

> extent(LCC2005)[1:4]
[1] -1473500  -202250  7283000  8563250
> round(extent(StudyAreaCRSLCC2005)[1:4] / 250, 0) * 250
[1] -1473750  -202000  7282750  8563250
achubaty added a commit that referenced this issue Jan 8, 2019
@achubaty
Copy link
Collaborator Author

@achubaty achubaty commented Mar 1, 2019

this is still failing, but now with different values:

> extent(LCC2005)[1:4]
[1] -1710250  -186750  7231750  8678500
> round(extent(StudyAreaCRSLCC2005)[1:4] / 250, 0) * 250
[1] -1473750  -202000  7282750  8563250

achubaty added a commit that referenced this issue Mar 1, 2019
@eliotmcintire
Copy link
Contributor

@eliotmcintire eliotmcintire commented Mar 15, 2019

Fixed with cc75c4d

It was a case of intransitivity of operations...
Needed to spTransform the studyArea directly in cropInputs, instead of the much faster/simpler spTransform of the extent of studyArea. These are the same if the studyArea fills the extent (like a Raster does), but it is not correct otherwise.

eliotmcintire added a commit that referenced this issue Mar 15, 2019
@achubaty achubaty reopened this Oct 4, 2019
@achubaty
Copy link
Collaborator Author

@achubaty achubaty commented Oct 4, 2019

seems this is back (on macOS at least). need to confirm we didn't lose the prev fix somehow in merge problems. otherwise need to revisit.

@achubaty
Copy link
Collaborator Author

@achubaty achubaty commented Oct 4, 2019

this change exists in development branch...so something else is going on, producing same error.

1. Failure: prepInputs doesn't work (part 1) (@test-prepInputs.R#152) 
extent(LCC2005)[1:4] not identical to round(extent(StudyAreaCRSLCC2005)[1:4]/250, 0) * 250.
4/4 mismatches (average diff: 12.6)
[1] -1473725 - -1473750 == 25.067
[2]  -201975 -  -202000 == 25.067
[3]  7282750 -  7282750 ==  0.127
[4]  8563250 -  8563250 ==  0.127
2. Failure: prepInputs doesn't work (part 1) (@test-prepInputs.R#274) 
extent(LCC2005)[1:4] not identical to round(extent(StudyAreaCRSLCC2005)[1:4]/250, 0) * 250.
4/4 mismatches (average diff: 12.6)
[1] -1473725 - -1473750 == 25.067
[2]  -201975 -  -202000 == 25.067
[3]  7282750 -  7282750 ==  0.127
[4]  8563250 -  8563250 ==  0.127

@achubaty achubaty changed the title prepInputs tests failing prepInputs tests failing due to different extents Oct 4, 2019
@achubaty
Copy link
Collaborator Author

@achubaty achubaty commented Feb 17, 2020

resolved in a567b68

@achubaty achubaty closed this Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants