Hi,
just two short question concerning the creation of random cells.
So far I used r.random to create e.g. a map with 20% cells (of my input raster).
I’d like to know:
- Is there a way to create randomly spatially clumped rasters cells so that the cells
look aggregated like patches, while still setting the e.g. 20% limit? Maybe
with a factor of spatial autocorrelation!? Maybe somebody has an example
- Is there a way to set a fixed seed to make reproducible results with r.random
and similar modules?
/Johannes
On Thu, Jan 9, 2014 at 4:09 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:
Hi,
just two short question concerning the creation of random cells.
So far I used r.random to create e.g. a map with 20% cells (of my input
raster).
I'd like to know:
1) Is there a way to create randomly spatially clumped rasters cells so that
the cells
look aggregated like patches, while still setting the e.g. 20% limit? Maybe
with a factor of spatial autocorrelation!? Maybe somebody has an example
2) Is there a way to set a fixed seed to make reproducible results with
r.random and similar modules?
While likely not a solution for you but take a look at
http://grass.osgeo.org/grass70/manuals/r.random.cells.html
Markus
Hi Markus,
so far as I understood r.random.cell creates spatially most disaggregated cells (based on the distance parameter). So instead of clumping them this module does the opposite.
However, I am just trying another solution which might be promising: With r.random.surface
it is possible to generate a spatially dependent surface (like a landscape with mountains and valleys). Then I can use r.quantile to get the lowest/highest e.g 20% of all values and consequently I can use r.mapcalc to reclassify all values smaller than the threshold value I yielded from r.quantile. First trials yielded good results although the 20% threshold did not exactly translate into 20% of all cells. I’ve to investigate a little bit more into that. Any other suggestions?
Best regards,
Johannes
···
On Fri, Jan 10, 2014 at 12:43 AM, Markus Neteler <neteler@osgeo.org> wrote:
On Thu, Jan 9, 2014 at 4:09 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:
Hi,
just two short question concerning the creation of random cells.
So far I used r.random to create e.g. a map with 20% cells (of my input
raster).
I’d like to know:
- Is there a way to create randomly spatially clumped rasters cells so that
the cells
look aggregated like patches, while still setting the e.g. 20% limit? Maybe
with a factor of spatial autocorrelation!? Maybe somebody has an example
- Is there a way to set a fixed seed to make reproducible results with
r.random and similar modules?
While likely not a solution for you but take a look at
http://grass.osgeo.org/grass70/manuals/r.random.cells.html
Markus
Hi Johannes
another path might be to use the excellent tools of the R package spatstat to
simulate various cluster processes. Those generated point patterns could then
be translated to rasters.
Functions for random point processes exhibiting clustering in spatstat are
e.g. rThomas, rGaussPoisson, rMatClust, rcell (retrieved from the help page
of rpoispp).
The simulated point density will of course not always have exactly the
requested density.
cheers
robert
Am Freitag, 10. Januar 2014, 08:17:50 schrieb Johannes Radinger:
Hi Markus,
so far as I understood r.random.cell creates spatially most disaggregated
cells (based on the distance parameter). So instead of clumping them this
module does the opposite.
However, I am just trying another solution which might be promising: With
r.random.surface
it is possible to generate a spatially dependent surface (like a landscape
with mountains and valleys). Then I can use r.quantile to get the
lowest/highest e.g 20% of all values and consequently I can use r.mapcalc
to reclassify all values smaller than the threshold value I yielded from
r.quantile. First trials yielded good results although the 20% threshold
did not exactly translate into 20% of all cells. I've to investigate a
little bit more into that. Any other suggestions?
Best regards,
Johannes
On Fri, Jan 10, 2014 at 12:43 AM, Markus Neteler <neteler@osgeo.org> wrote:
> On Thu, Jan 9, 2014 at 4:09 PM, Johannes Radinger
>
> <johannesradinger@gmail.com> wrote:
> > Hi,
> >
> > just two short question concerning the creation of random cells.
> > So far I used r.random to create e.g. a map with 20% cells (of my input
> > raster).
> > I'd like to know:
> > 1) Is there a way to create randomly spatially clumped rasters cells so
>
> that
>
> > the cells
> > look aggregated like patches, while still setting the e.g. 20% limit?
>
> Maybe
>
> > with a factor of spatial autocorrelation!? Maybe somebody has an example
> > 2) Is there a way to set a fixed seed to make reproducible results with
> > r.random and similar modules?
>
> While likely not a solution for you but take a look at
> http://grass.osgeo.org/grass70/manuals/r.random.cells.html
>
> Markus
Hi Martin,
r.pi.nlm sounds really suitable for such tasks, I should really have a look into it. As I recognized you as one of the maintainers, do you think it’ll be available also as an add-on for GRASS7?
cheers,
Johannes
···
On Fri, Jan 10, 2014 at 11:59 AM, M Wegmann <wegmann2011@gmail.com> wrote:
Hi Johannes,
you might want to look into the r.pi. suit[1]. You will find a command called
r.pi.nlm which generates random landscapes based on some settings (e.g. %
coverage).
cheers, Martin
http://svn.osgeo.org/grass/grass-addons/grass6/raster/r.pi/
On Friday, January 10, 2014 09:57:12 AM Robert Nuske wrote:
Hi Johannes
another path might be to use the excellent tools of the R package spatstat
to simulate various cluster processes. Those generated point patterns could
then be translated to rasters.
Functions for random point processes exhibiting clustering in spatstat are
e.g. rThomas, rGaussPoisson, rMatClust, rcell (retrieved from the help page
of rpoispp).
The simulated point density will of course not always have exactly the
requested density.
cheers
robert
Am Freitag, 10. Januar 2014, 08:17:50 schrieb Johannes Radinger:
Hi Markus,
so far as I understood r.random.cell creates spatially most disaggregated
cells (based on the distance parameter). So instead of clumping them this
module does the opposite.
However, I am just trying another solution which might be promising: With
r.random.surface
it is possible to generate a spatially dependent surface (like a landscape
with mountains and valleys). Then I can use r.quantile to get the
lowest/highest e.g 20% of all values and consequently I can use r.mapcalc
to reclassify all values smaller than the threshold value I yielded from
r.quantile. First trials yielded good results although the 20% threshold
did not exactly translate into 20% of all cells. I’ve to investigate a
little bit more into that. Any other suggestions?
Best regards,
Johannes
On Fri, Jan 10, 2014 at 12:43 AM, Markus Neteler <neteler@osgeo.org>
wrote:
On Thu, Jan 9, 2014 at 4:09 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:
Hi,
just two short question concerning the creation of random cells.
So far I used r.random to create e.g. a map with 20% cells (of my
input
raster).
I’d like to know:
- Is there a way to create randomly spatially clumped rasters cells
so
that
the cells
look aggregated like patches, while still setting the e.g. 20% limit?
Maybe
with a factor of spatial autocorrelation!? Maybe somebody has an
example
2) Is there a way to set a fixed seed to make reproducible results
with
r.random and similar modules?
While likely not a solution for you but take a look at
http://grass.osgeo.org/grass70/manuals/r.random.cells.html
Markus
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user