Skip to content

Multiband histogram methods - #1784

Merged
echeipesh merged 3 commits into
locationtech:masterfrom
echeipesh:feature/multiband-histogram
Nov 10, 2016
Merged

echeipesh merged 3 commits into
locationtech:masterfrom
echeipesh:feature/multiband-histogram

Conversation

@echeipesh

Copy link
Copy Markdown
Contributor

Adds method extensions for histogram and related stats functions to MultibandTile and RDD[(K, MultibandTile)].

Because MultibandTile is essentially a Vector[Tile] the extension methods have little choice than return an Array of their Tile counterpart.

Fixes: #1773

@lossyrob lossyrob left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpick, otherwise +1

* Create a histogram from double values in a raster.
*/
def histogramDouble(): Array[Histogram[Double]] =
self.bands.map(_.histogramDouble(StreamingHistogram.DEFAULT_NUM_BUCKETS)).toArray

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just pass to histogramDouble(StreamingHistogram.DEFAULT_NUM_BUCKETS) - it's a good practice to only let the last overload do any actual work, so that code changes will only have to ever happen there.

@echeipesh
echeipesh merged commit d8d4315 into locationtech:master Nov 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants