{"action":"created","comment":{"url":"https://api.github.com/repos/mapbox/rasterio/pulls/comments/34418367","id":34418367,"diff_hunk":"@@ -582,6 +582,20 @@ cdef class DatasetReader(object):\n     def kwds(self):\n         return self.tags(ns='rio_creation_kwds')\n \n+\n+    # Overviews.\n+    def overviews(self, bidx):\n+        cdef void *hovband = NULL\n+        cdef void *hband = self.band(bidx)\n+        num_overviews = _gdal.GDALGetOverviewCount(hband)\n+        factors = []\n+        for i in range(num_overviews):\n+            hovband = _gdal.GDALGetOverview(hband, i)\n+            xsize = _gdal.GDALGetRasterBandXSize(hovband)\n+            ysize = _gdal.GDALGetRasterBandYSize(hovband)","path":"rasterio/_base.pyx","position":14,"original_position":14,"commit_id":"fde8b02b7eb2600a9e99dbec070255d0e323ad9a","original_commit_id":"fde8b02b7eb2600a9e99dbec070255d0e323ad9a","user":{"login":"brendan-ward","id":3375604,"avatar_url":"https://avatars.githubusercontent.com/u/3375604?v=3","gravatar_id":"","url":"https://api.github.com/users/brendan-ward","html_url":"https://github.com/brendan-ward","followers_url":"https://api.github.com/users/brendan-ward/followers","following_url":"https://api.github.com/users/brendan-ward/following{/other_user}","gists_url":"https://api.github.com/users/brendan-ward/gists{/gist_id}","starred_url":"https://api.github.com/users/brendan-ward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendan-ward/subscriptions","organizations_url":"https://api.github.com/users/brendan-ward/orgs","repos_url":"https://api.github.com/users/brendan-ward/repos","events_url":"https://api.github.com/users/brendan-ward/events{/privacy}","received_events_url":"https://api.github.com/users/brendan-ward/received_events","type":"User","site_admin":false},"body":"@sgillies this line not needed?  ```ysize``` not used below...","created_at":"2015-07-12T03:32:47Z","updated_at":"2015-07-12T03:32:47Z","html_url":"https://github.com/mapbox/rasterio/pull/408#discussion_r34418367","pull_request_url":"https://api.github.com/repos/mapbox/rasterio/pulls/408","_links":{"self":{"href":"https://api.github.com/repos/mapbox/rasterio/pulls/comments/34418367"},"html":{"href":"https://github.com/mapbox/rasterio/pull/408#discussion_r34418367"},"pull_request":{"href":"https://api.github.com/repos/mapbox/rasterio/pulls/408"}}},"pull_request":{"url":"https://api.github.com/repos/mapbox/rasterio/pulls/408","id":39423252,"html_url":"https://github.com/mapbox/rasterio/pull/408","diff_url":"https://github.com/mapbox/rasterio/pull/408.diff","patch_url":"https://github.com/mapbox/rasterio/pull/408.patch","issue_url":"https://api.github.com/repos/mapbox/rasterio/issues/408","number":408,"state":"open","locked":false,"title":"rio-pyramid","user":{"login":"sgillies","id":33697,"avatar_url":"https://avatars.githubusercontent.com/u/33697?v=3","gravatar_id":"","url":"https://api.github.com/users/sgillies","html_url":"https://github.com/sgillies","followers_url":"https://api.github.com/users/sgillies/followers","following_url":"https://api.github.com/users/sgillies/following{/other_user}","gists_url":"https://api.github.com/users/sgillies/gists{/gist_id}","starred_url":"https://api.github.com/users/sgillies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgillies/subscriptions","organizations_url":"https://api.github.com/users/sgillies/orgs","repos_url":"https://api.github.com/users/sgillies/repos","events_url":"https://api.github.com/users/sgillies/events{/privacy}","received_events_url":"https://api.github.com/users/sgillies/received_events","type":"User","site_admin":false},"body":"Initial impl of rio-pyramid.\r\n\r\nCloses #388.\r\n\r\nAdds two methods to Dataset classes and a new enum of resampling algorithms.\r\n\r\nHere's the help:\r\n\r\n```bash\r\n$ rio pyramid --help\r\nUsage: rio pyramid [OPTIONS] INPUT\r\n\r\n  Construct overviews in an existing dataset.\r\n\r\n  A pyramid of overviews computed once and stored in the dataset can improve\r\n  performance in some applications.\r\n\r\n  The decimation levels at which to build overviews can be specified as a\r\n  comma separated list\r\n\r\n    rio pyramid --build 2,4,8,16\r\n\r\n  or a base and range of exponents.\r\n\r\n    rio pyramid --build 2^1..4\r\n\r\n  Note that overviews can not currently be removed and are not\r\n  automatically updated when the dataset's primary bands are modified.\r\n\r\n  Information about existing overviews can be printed using the --ls option.\r\n\r\n    rio pyramid --ls\r\n\r\nOptions:\r\n  --build f1,f2,…|b^min..max      A sequence of decimation factors specied as\r\n                                  comma-separated list of numbers or a base\r\n                                  and range of exponents.\r\n  --ls                            Print the overviews for each band.\r\n  --resampling [nearest|gauss|cubic|average|mode|average_magphase|none]\r\n                                  Resampling algorithm.  [default: nearest]\r\n  --help                          Show this message and exit.\r\n```\r\n\r\nThe `--ls` option produces this output\r\n\r\n```bash\r\n$ rio pyramid --ls rgb.tif\r\nBand 1: 2,4\r\nBand 2: 2,4\r\nBand 3: 2,4\r\n```\r\n\r\nI'm open to suggestions on how to format that. Adding overviews to the JSON of rio-info seems like a good idea, too.","created_at":"2015-07-07T22:20:23Z","updated_at":"2015-07-12T03:32:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71ec64adf568280c43430e650d826cbfa08343bf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/rasterio/pulls/408/commits","review_comments_url":"https://api.github.com/repos/mapbox/rasterio/pulls/408/comments","review_comment_url":"https://api.github.com/repos/mapbox/rasterio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/rasterio/issues/408/comments","statuses_url":"https://api.github.com/repos/mapbox/rasterio/statuses/fde8b02b7eb2600a9e99dbec070255d0e323ad9a","head":{"label":"mapbox:rio-addov","ref":"rio-addov","sha":"fde8b02b7eb2600a9e99dbec070255d0e323ad9a","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":14116604,"name":"rasterio","full_name":"mapbox/rasterio","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/rasterio","description":"Clean and fast and geospatial raster I/O for Python programmers who use Numpy","fork":false,"url":"https://api.github.com/repos/mapbox/rasterio","forks_url":"https://api.github.com/repos/mapbox/rasterio/forks","keys_url":"https://api.github.com/repos/mapbox/rasterio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/rasterio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/rasterio/teams","hooks_url":"https://api.github.com/repos/mapbox/rasterio/hooks","issue_events_url":"https://api.github.com/repos/mapbox/rasterio/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/rasterio/events","assignees_url":"https://api.github.com/repos/mapbox/rasterio/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/rasterio/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/rasterio/tags","blobs_url":"https://api.github.com/repos/mapbox/rasterio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/rasterio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/rasterio/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/rasterio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/rasterio/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/rasterio/languages","stargazers_url":"https://api.github.com/repos/mapbox/rasterio/stargazers","contributors_url":"https://api.github.com/repos/mapbox/rasterio/contributors","subscribers_url":"https://api.github.com/repos/mapbox/rasterio/subscribers","subscription_url":"https://api.github.com/repos/mapbox/rasterio/subscription","commits_url":"https://api.github.com/repos/mapbox/rasterio/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/rasterio/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/rasterio/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/rasterio/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/rasterio/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/rasterio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/rasterio/merges","archive_url":"https://api.github.com/repos/mapbox/rasterio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/rasterio/downloads","issues_url":"https://api.github.com/repos/mapbox/rasterio/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/rasterio/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/rasterio/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/rasterio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/rasterio/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/rasterio/releases{/id}","created_at":"2013-11-04T16:36:27Z","updated_at":"2015-07-11T23:30:16Z","pushed_at":"2015-07-11T20:24:54Z","git_url":"git://github.com/mapbox/rasterio.git","ssh_url":"git@github.com:mapbox/rasterio.git","clone_url":"https://github.com/mapbox/rasterio.git","svn_url":"https://github.com/mapbox/rasterio","homepage":"","size":5000,"stargazers_count":273,"watchers_count":273,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":66,"mirror_url":null,"open_issues_count":35,"forks":66,"open_issues":35,"watchers":273,"default_branch":"master"}},"base":{"label":"mapbox:master","ref":"master","sha":"9a0876ac277102bc5499bd520fd9ff650691fb93","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":14116604,"name":"rasterio","full_name":"mapbox/rasterio","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/rasterio","description":"Clean and fast and geospatial raster I/O for Python programmers who use Numpy","fork":false,"url":"https://api.github.com/repos/mapbox/rasterio","forks_url":"https://api.github.com/repos/mapbox/rasterio/forks","keys_url":"https://api.github.com/repos/mapbox/rasterio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/rasterio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/rasterio/teams","hooks_url":"https://api.github.com/repos/mapbox/rasterio/hooks","issue_events_url":"https://api.github.com/repos/mapbox/rasterio/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/rasterio/events","assignees_url":"https://api.github.com/repos/mapbox/rasterio/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/rasterio/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/rasterio/tags","blobs_url":"https://api.github.com/repos/mapbox/rasterio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/rasterio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/rasterio/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/rasterio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/rasterio/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/rasterio/languages","stargazers_url":"https://api.github.com/repos/mapbox/rasterio/stargazers","contributors_url":"https://api.github.com/repos/mapbox/rasterio/contributors","subscribers_url":"https://api.github.com/repos/mapbox/rasterio/subscribers","subscription_url":"https://api.github.com/repos/mapbox/rasterio/subscription","commits_url":"https://api.github.com/repos/mapbox/rasterio/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/rasterio/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/rasterio/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/rasterio/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/rasterio/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/rasterio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/rasterio/merges","archive_url":"https://api.github.com/repos/mapbox/rasterio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/rasterio/downloads","issues_url":"https://api.github.com/repos/mapbox/rasterio/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/rasterio/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/rasterio/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/rasterio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/rasterio/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/rasterio/releases{/id}","created_at":"2013-11-04T16:36:27Z","updated_at":"2015-07-11T23:30:16Z","pushed_at":"2015-07-11T20:24:54Z","git_url":"git://github.com/mapbox/rasterio.git","ssh_url":"git@github.com:mapbox/rasterio.git","clone_url":"https://github.com/mapbox/rasterio.git","svn_url":"https://github.com/mapbox/rasterio","homepage":"","size":5000,"stargazers_count":273,"watchers_count":273,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":66,"mirror_url":null,"open_issues_count":35,"forks":66,"open_issues":35,"watchers":273,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/rasterio/pulls/408"},"html":{"href":"https://github.com/mapbox/rasterio/pull/408"},"issue":{"href":"https://api.github.com/repos/mapbox/rasterio/issues/408"},"comments":{"href":"https://api.github.com/repos/mapbox/rasterio/issues/408/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/rasterio/pulls/408/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/rasterio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/rasterio/pulls/408/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/rasterio/statuses/fde8b02b7eb2600a9e99dbec070255d0e323ad9a"}}}}