[R-sig-Geo] accumulate gridcells to a specific value - summary
Alexander.Herr at csiro.au
Alexander.Herr at csiro.au
Wed Aug 13 01:08:26 CEST 2008
Hi list,
Attached code from Barry Rowling to estimate variable radii based on a given allocation value (ie matrix cell sums). The code will calculate the radii of circles that sum to a given value. It starts from the hightest value in a matrix, than second highest etc. and excludes values already allocated to a circle. The output is a matrix of circles/semi-circles and dataframe of result. See circle_allocate.r for a trial.
Cheers
Herry
-----Original Message-----
From: Matthew Perry [mailto:perrygeo at gmail.com]
Sent: Saturday, August 02, 2008 3:12 AM
To: Herr, Alexander Herr - Herry (CSE, Gungahlin)
Cc: r-sig-geo at stat.math.ethz.ch
Subject: Re: [R-sig-Geo] accumulate gridcells to a specific value
This might be what you're looking for ...
http://grass.itc.it/grass62/manuals/html62_user/r.cost.html
On Thu, Jul 31, 2008 at 4:51 PM, <Alexander.Herr at csiro.au> wrote:
> Hi Barry,
>
>> Can you explain a bit more about your problem?
>> * What are the inputs? Just a grid of values or are there some
> starting points?
>
> Inputs is a floating grid. Starting point is 1) the highest values in
> the grid. Once first accumulation achieved, exclude this area and 2)
> find highest value on grid for next starting points and so on.
>
>> * What are the outputs? A list of grid cells that add up to your
> accumulated value?
>
> outputs: accumulation areas where sum of grid points (within areas) is
> a given value.
>
>
> Does that clarify?
> Cheers
> Herry
>
> -----Original Message-----
> From: b.rowlingson at googlemail.com [mailto:b.rowlingson at googlemail.com]
> On Behalf Of Barry Rowlingson
> Sent: Thursday, July 31, 2008 7:09 PM
> To: Herr, Alexander Herr - Herry (CSE, Gungahlin)
> Cc: r-sig-geo at stat.math.ethz.ch
> Subject: Re: [R-sig-Geo] accumulate gridcells to a specific value
>
> 2008/7/31 <Alexander.Herr at csiro.au>:
>
>> I am trying to accumulate gridcells to a specific value. This means I
>> need to extent the nearest neighbours (or search radius) to a size so
>> that the sum of gridcell values reaches the desired value (or stops
>> if
>
>> sum value of gridcells/radius goes beyond a specific size). It should
>> start with the highest gridcell value then next remaining highest etc.
>>
>> Of course this could also work with points/polygons or on a matrix.
>>
>> Rather than re-inventing the wheel I was wondering if anyone has or
>> knows of a tool/script.
>
> It's not totally clear what you want to do, but it sounds like the
> sort of raster operation that GRASS GIS does.
>
> http://grass.itc.it/
>
> Can you explain a bit more about your problem?
>
> * What are the inputs? Just a grid of values or are there some
> starting points?
> * What are the outputs? A list of grid cells that add up to your
> accumulated value?
>
> I ask this because this week I wrote some code that did something
> very similar, namely:
>
> Given a grid of resource values and a number of population centres,
> compute the areas on the grid that allocate a given resource total to
> each population centre by minimising the distance from each centre,
> and not allowing any grid square to be allocated to more than one centre.
>
> It basically grows areas out from the centres, by finding the minimum
> centre-resource cell distance for unallocated cells and allocating
> that cell to that centre.
>
> This was written in Python and used gdal to read grids. Took me a day
> to write and a day to document.
>
> I'll have to start charging for this :)
>
> Barry
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
·´¯`·.¸. , . .·´¯`·.. ><((((º>`·.¸¸.·´¯`·.¸.·´¯`·...¸><((((º>
"The best way to predict the future is to invent it." -- Alan Kay Matthew T. Perry http://www.perrygeo.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: variable_radius.zip
Type: application/x-zip-compressed
Size: 2065 bytes
Desc: variable_radius.zip
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20080813/a97fda83/attachment.bin>
More information about the R-sig-Geo
mailing list