Thread Subject: Mapping Toolbox: Averaging gridded and polygon data

Subject: Mapping Toolbox: Averaging gridded and polygon data

From: Rick Wayne

Date: 5 Oct, 2009 15:43:58

Message: 1 of 2

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

Subject: Mapping Toolbox: Averaging gridded and polygon data

From: Wolfgang Schwanghart

Date: 16 Oct, 2009 07:57:04

Message: 2 of 2

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

Tags for this Thread

Everyone's Tags:

gis

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
gis Wolfgang Schwanghart 16 Oct, 2009 03:59:07
rssFeed for this Thread

Contact us at files@mathworks.com