{"action":"opened","issue":{"url":"https://api.github.com/repos/perrygeo/python-rasterstats/issues/73","labels_url":"https://api.github.com/repos/perrygeo/python-rasterstats/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/perrygeo/python-rasterstats/issues/73/comments","events_url":"https://api.github.com/repos/perrygeo/python-rasterstats/issues/73/events","html_url":"https://github.com/perrygeo/python-rasterstats/issues/73","id":101112493,"number":73,"title":"Multiband support","user":{"login":"perrygeo","id":1151287,"avatar_url":"https://avatars.githubusercontent.com/u/1151287?v=3","gravatar_id":"","url":"https://api.github.com/users/perrygeo","html_url":"https://github.com/perrygeo","followers_url":"https://api.github.com/users/perrygeo/followers","following_url":"https://api.github.com/users/perrygeo/following{/other_user}","gists_url":"https://api.github.com/users/perrygeo/gists{/gist_id}","starred_url":"https://api.github.com/users/perrygeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perrygeo/subscriptions","organizations_url":"https://api.github.com/users/perrygeo/orgs","repos_url":"https://api.github.com/users/perrygeo/repos","events_url":"https://api.github.com/users/perrygeo/events{/privacy}","received_events_url":"https://api.github.com/users/perrygeo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-14T22:08:47Z","updated_at":"2015-08-14T22:08:47Z","closed_at":null,"body":"`zonalstats` was originally optimized for large vector feature collections against a single raster band (i.e. thousands of polygons against a DEM raster)\r\n\r\nThere is another use case which `zonalstats` doesn't handle so well: many rasters/bands against a single geometry (i.e. the value at a single point for thousands of climate model simulations or a multispectral image). You can loop through and call zonal stats on each raster/band but this incurs the overhead of the rasterio.open each time. A more efficient mechanism might be to stack all the data into a multi-band raster and open it once, slice the 3D array and don't apply the aggregate functions to the 3rd dim - return an array rather than a scalar statistic.\r\n\r\nI'll have to do some research to see how much refactoring/code clutter this would cause. Otherwise, it might just be a new `zonalstats_multiband` function."}}