Repository navigation
RDD Reproject for TileFeatures, RasterRegionReproject - #2803
Merged
echeipesh merged 6 commits intoSep 15, 2018
Merged
Conversation
echeipesh
commented
Sep 12, 2018
| * @param region polygon boundry of source raster in target CRS | ||
| * @param resampleMethod cell value resample method | ||
| */ | ||
| def regionReprojectMutable(raster: Raster[T], src: CRS, dest: CRS, target: Raster[T], region: Polygon, resampleMethod: ResampleMethod): Raster[T] |
Contributor
Author
There was a problem hiding this comment.
Strange convention but needed to find a name that would not break binary compatibility.
echeipesh
commented
Sep 12, 2018
| val bands = Array.ofDim[MutableArrayTile](raster.tile.bandCount) | ||
| cfor(0)(_ < bands.length, _ + 1) { i => | ||
| bands(i) = raster.tile.band(i).prototype(rasterExtent.cols, rasterExtent.rows).mutable | ||
| bands(i) = ArrayTile.empty(raster.tile.band(i).cellType, rasterExtent.cols, rasterExtent.rows) |
Contributor
Author
There was a problem hiding this comment.
Change for clarity only
echeipesh
commented
Sep 12, 2018
| Raster(MultibandTile(bands), bufferRE.extent) | ||
| } | ||
|
|
||
| private def reprojectToBuffer(raster: Raster[MultibandTile], src: CRS, dest: CRS, buffer: Array[MutableArrayTile], rasterExtent: RasterExtent, region: Polygon, resampleMethod: ResampleMethod): Unit = { |
Contributor
Author
There was a problem hiding this comment.
These could be DRYied out with single-band case, but might as well include the most specific version with the least conditionals
echeipesh
force-pushed
the
fix/region-reproject-mutability
branch
from
September 12, 2018 21:19
46a25b0 to
da0377f
Compare
pomadchin
force-pushed
the
fix/region-reproject-mutability
branch
2 times, most recently
from
September 14, 2018 15:55
39b42b6 to
992d523
Compare
Added overload methods to keep API compatability with 2.0
echeipesh
force-pushed
the
fix/region-reproject-mutability
branch
from
September 14, 2018 16:51
992d523 to
5c30e09
Compare
Contributor
Author
|
Backported to |
echeipesh
added a commit
that referenced
this pull request
Oct 2, 2018
* RasterRegionReproject works with TileFeature * Use approximate line scan in RasterRegionReproject for performance * Test for RDD reproject of TileFeatures * Clarify Tile.mutable scaladoc [skip-ci] * Pass errorThreshold to RasterRegionReproject * Added overload methods to RasterRegionReproject keep API compatability with 2.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2799
Mostly this PR reworks the
RasterRegionReprojectto allow composition of instances such that reprojection ofTileFeatureRDD could be supported. Adding a unit test for this revealed another missing implicit which is added here.The mutability remains an important optimization specifically in the RDD case where it allows using a tile as an accumulator when multiple source tiles contribute pixels during the reproject operation without allocating memory for each intermediate result. Hopefully expanded documentation is enough to steer users in the right direction and use this feature responsibly.
RasterRegionReprojectto allow creating an instance forTileFeature[T, D]RasterRegionReproject[MultibandTile]instanceStitcher[TileFeature[T, D]]instanceerrorThresholdargument fromReproject.OptionstoRasterRegionReprojecterrorThresholdinTileRDDReprojectChecklist
docs/CHANGELOG.rstupdated, if necessarydocsguides update, if necessary