|
Hi Rick,
I guess that you mean something like zonal statistics (as it is termed in ArcGIS). As far as I know, there is no straightforward algorithm in Matlab but there may be work-arounds. One option might be to convert the basin shapefile (using ArcGIS (or different GIS software) or multiple use of inpolygon) to an integer raster with same extent and cell size as your precipitation raster. In Matlab you may then use the function accumarray to calculate all sorts of statistics for each basin.
HTH, Wolfgang
Rick Wayne <fewayne@gmail.com> wrote in message <e936038a-37ff-4324-8c5e-62758bb251f7@s6g2000vbp.googlegroups.com>...
> Hey all,
>
> I have a shapefile with a bunch of regions (watershed basins in
> Wisconsin) and a second data set in lat/long grids (probability of
> precip, aka PoP).
>
> Is there an easy way to interpolate and average the two in MATLAB?
> What I want to do is derive a reasonably defensible PoP value for a
> watershed basin, and of course the grid cells and basins don't line up
> one-to-one. I could try to do a geospatial query, calculate areas, and
> do my own interpolation, but I'm betting dollars to donuts someone has
> already written this, I just can't dig it out of the API docs.
>
> In the GRASS gis, there's a raster function that AFAIK does exactly
> that, r.average (http://grass.itc.it/grass64/manuals/html64_user/
> raster.html).
>
> Thanks much for the help,
>
> Rick
> U of Wisconsin Soil Sciences
> Madison, WI
|