-
Notifications
You must be signed in to change notification settings - Fork 11
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
Reprojection Short Circuting #209
Reprojection Short Circuting #209
Conversation
/** Reproject to different CRS with explicit sampling reprojectOptions. | ||
* @see [[geotrellis.raster.reproject.Reproject]] | ||
* @group reproject | ||
*/ | ||
def reproject(crs: CRS, reprojectOptions: Reproject.Options, strategy: OverviewStrategy): RasterSource | ||
def reproject(crs: CRS, reprojectOptions: Reproject.Options, strategy: OverviewStrategy): RasterSource = | ||
if (crs == this.crs) this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be aware that this can be very computationally expensive. See locationtech/geotrellis#3022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also: locationtech/rasterframes#134
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good overall, but I'm not comfortable OKing the use of internal
for methods expected of implementers. This deserves a bit more thought
168d995
to
6d57130
Compare
I've thought about this a bit and I've got a potential solution which may be controversial. Instead of val rs: RasterSource = GeotiffRasterSource(...)
rs.projected(crs, reprojectOptions, strategy) Our expectation via the trait, on the other hand, would be a method named |
@moradology @echeipesh @pomadchin have we decided on a naming strategy for the externally facing method? |
Another option brought up by @pomadchin which I think deserves our attention and would be simpler for now is to use |
I think they're both good options. @pomadchin's might be better in the short term, as it doesn't require a refactor, but I think we should implement something similar to what @moradology suggested later on. |
@jbouffard I think thats a reasonable compromise to close out this PR. @jbouffard / @moradology |
…ojection can be skipped Signed-off-by: Jacob Bouffard <jbouffard@azavea.com> Updated the CHANGELOG Signed-off-by: Jacob Bouffard <jbouffard@azavea.com> Updated remaining reproject method Signed-off-by: Jacob Bouffard <jbouffard@azavea.com> Fixed failing test Signed-off-by: Jacob Bouffard <jbouffard@azavea.com> Renamed _reproject to reprojectInternal Signed-off-by: Jacob Bouffard <jbouffard@azavea.com> Fixed spelling Signed-off-by: Jacob Bouffard <jbouffard@azavea.com> Renamed the reprojectInternal method to reprojection Signed-off-by: Jacob Bouffard <jbouffard@azavea.com>
6d57130
to
dc58f04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Overview
This PR adds logic that checks to see if the target
RasterSource
need to be reprojected. If they don't, then they are either resampled are just returned as-is.Checklist
Closes #102