[GRASS-user] Simulation in grass 6

Hi

I am planning to write a spatial simulation model, simulating the spread of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which scripting language. I am using Linux and have quite a bit of experience with R, so I thought that R (together with spgrass6) would be a nice scripting language to write the simulation and sending the grass commands through to grass, because it offers me quite a bit more concerning strtucturing on the modelling side then using a normal shell script
But the simulation should also run under Windows and I don't have any experience with grass and R under windows.

I have the following questions:

1) Does R and grasswork together (via spgrass6) under windows as they do under Linux?

2) Is there anything I have to look at when writing a simulation model
under Linux which should also run under Windows?

3) Is any other scripting language more suitable for what I want to achieve (I have no experience with C / C++, but quite a bit with Delphi. I have never used the likes of perl et al. and bash scrips seem a bit awkward to me for bigger projects.)?

Thanks in advance for your help,

Rainer

--
NEW EMAIL ADDRESS AND ADDRESS:

Rainer.Krug@uct.ac.za

RKrug@sun.ac.za WILL BE DISCONTINUED END OF MARCH

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Tel: +27 - (0)21 650 5776 (w)
Fax: +27 - (0)86 516 2782
Fax: +27 - (0)21 650 2440 (w)
Cell: +27 - (0)83 9479 042

Skype: RMkrug

email: Rainer.Krug@uct.ac.za
         Rainer@krugs.de

Rainer M. Krug wrote:

I am planning to write a spatial simulation model, simulating the spread
of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which
scripting language. I am using Linux and have quite a bit of experience
with R, so I thought that R (together with spgrass6) would be a nice
scripting language to write the simulation and sending the grass
commands through to grass, because it offers me quite a bit more
concerning strtucturing on the modelling side then using a normal shell
script
But the simulation should also run under Windows and I don't have any
experience with grass and R under windows.

It sounds very well suited for Linux or MacOSX, but I've little idea about the
GRASS+R Windows situation. Maybe someone on the statsgrass mailing list knows?
(taking the liberty to cc)

I have the following questions:

..

3) Is any other scripting language more suitable for what I want to
achieve (I have no experience with C / C++, but quite a bit with Delphi.
I have never used the likes of perl et al. and bash scrips seem a bit
awkward to me for bigger projects.)?

You could try python. The next version of GRASS will use python heavily for the
GUI, so expect lots of example scripts, help on the mailing list from fellow
travelers, and tight integration with the code.

Learn python in 10 min: http://www.poromenos.org/tutorials/python

Also there is a SWIG/Python interface to any needed GIS library functions,
which is pretty cool, although the grass modules generally give you what you
need without having to resort to using any low-level libgis functions.

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python
     http://freegis.org/cgi-bin/viewcvs.cgi/grass6/swig/python/

Hamish

      ____________________________________________________________________________________
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

Hamish wrote:

Rainer M. Krug wrote:

I am planning to write a spatial simulation model, simulating the spread of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which scripting language. I am using Linux and have quite a bit of experience with R, so I thought that R (together with spgrass6) would be a nice scripting language to write the simulation and sending the grass commands through to grass, because it offers me quite a bit more concerning strtucturing on the modelling side then using a normal shell script
But the simulation should also run under Windows and I don't have any experience with grass and R under windows.

It sounds very well suited for Linux or MacOSX, but I've little idea about the
GRASS+R Windows situation. Maybe someone on the statsgrass mailing list knows?
(taking the liberty to cc)

Thanks a lot - I am subscribed to this list now - strange that I overlooked that lisat before...

I have the following questions:

..

3) Is any other scripting language more suitable for what I want to achieve (I have no experience with C / C++, but quite a bit with Delphi. I have never used the likes of perl et al. and bash scrips seem a bit awkward to me for bigger projects.)?

You could try python. The next version of GRASS will use python heavily for the
GUI, so expect lots of example scripts, help on the mailing list from fellow
travelers, and tight integration with the code.

Sounds very interesting - I'll take a look at it.

Learn python in 10 min: http://www.poromenos.org/tutorials/python

Python doesn't look as difficult as I thought the first time I looked at it (a few years back...). Looks similar to what I am used to in Delphi.

Also there is a SWIG/Python interface to any needed GIS library functions,
which is pretty cool, although the grass modules generally give you what you
need without having to resort to using any low-level libgis functions.

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python

Looking at the document, I must say it seems to be a usefull approach to use Python - and it is crossplatform. One thing which I did not see that quickly is how I can execute grass commands from python - I guess it is easy, but I didn't find it when I looked at the document.

Thanks a lot for your usefull and very helpfull hints,

Rainer

     http://freegis.org/cgi-bin/viewcvs.cgi/grass6/swig/python/

Hamish

      ____________________________________________________________________________________
Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

--
NEW EMAIL ADDRESS AND ADDRESS:

Rainer.Krug@uct.ac.za

RKrug@sun.ac.za WILL BE DISCONTINUED END OF MARCH

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Tel: +27 - (0)21 650 5776 (w)
Fax: +27 - (0)86 516 2782
Fax: +27 - (0)21 650 2440 (w)
Cell: +27 - (0)83 9479 042

Skype: RMkrug

email: Rainer.Krug@uct.ac.za
         Rainer@krugs.de

Actually, I often use R as an scripting language
for grass. The problem is that grass commands have
to be issued using system(), which, for a complex code,
becomes inconvenient (lots of paste() for generating the
actual grass command).
Not being an expert at all on python, I wonder
if making R able of executing grass commands without
having to use system() could not be a valid alternative
to python, at least in some cases.

Anyway, I think that the real solution would be having a GIS
able of displaying R objects, sort of RGis.

Agus

Hamish escribió:

Rainer M. Krug wrote:

I am planning to write a spatial simulation model, simulating the spread of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which scripting language. I am using Linux and have quite a bit of experience with R, so I thought that R (together with spgrass6) would be a nice scripting language to write the simulation and sending the grass commands through to grass, because it offers me quite a bit more concerning strtucturing on the modelling side then using a normal shell script
But the simulation should also run under Windows and I don't have any experience with grass and R under windows.

It sounds very well suited for Linux or MacOSX, but I've little idea about the
GRASS+R Windows situation. Maybe someone on the statsgrass mailing list knows?
(taking the liberty to cc)

I have the following questions:

..

3) Is any other scripting language more suitable for what I want to achieve (I have no experience with C / C++, but quite a bit with Delphi. I have never used the likes of perl et al. and bash scrips seem a bit awkward to me for bigger projects.)?

You could try python. The next version of GRASS will use python heavily for the
GUI, so expect lots of example scripts, help on the mailing list from fellow
travelers, and tight integration with the code.

Learn python in 10 min: http://www.poromenos.org/tutorials/python

Also there is a SWIG/Python interface to any needed GIS library functions,
which is pretty cool, although the grass modules generally give you what you
need without having to resort to using any low-level libgis functions.

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python
     http://freegis.org/cgi-bin/viewcvs.cgi/grass6/swig/python/

Hamish

      ____________________________________________________________________________________
Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

_______________________________________________
statsgrass mailing list
statsgrass@grass.itc.it
http://grass.itc.it/mailman/listinfo/statsgrass

--
Dr. Agustin Lobo
Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: Agustin.Lobo@ija.csic.es
http://www.ija.csic.es/gt/obster

Agustin Lobo wrote:

Actually, I often use R as an scripting language
for grass. The problem is that grass commands have
to be issued using system(), which, for a complex code,
becomes inconvenient (lots of paste() for generating the
actual grass command).

This is indeed a hassle, but I wrote a small R function which is pasting all the parameters supplied together and executing them via system() - still not perfect, but it works nicer then the system(paste(...)) approach.

Not being an expert at all on python, I wonder
if making R able of executing grass commands without
having to use system() could not be a valid alternative
to python, at least in some cases.

I think this would, at least, make using grass from R much easier. And it shouldn't be to dificult to do that - just defining a function with the same name as in R and execute it via system() - I think about using this in my simulation.

Thanks,

Rainer

Anyway, I think that the real solution would be having a GIS
able of displaying R objects, sort of RGis.

Agus

Hamish escribió:

Rainer M. Krug wrote:

I am planning to write a spatial simulation model, simulating the spread of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which scripting language. I am using Linux and have quite a bit of experience with R, so I thought that R (together with spgrass6) would be a nice scripting language to write the simulation and sending the grass commands through to grass, because it offers me quite a bit more concerning strtucturing on the modelling side then using a normal shell script
But the simulation should also run under Windows and I don't have any experience with grass and R under windows.

It sounds very well suited for Linux or MacOSX, but I've little idea about the
GRASS+R Windows situation. Maybe someone on the statsgrass mailing list knows?
(taking the liberty to cc)

I have the following questions:

..

3) Is any other scripting language more suitable for what I want to achieve (I have no experience with C / C++, but quite a bit with Delphi. I have never used the likes of perl et al. and bash scrips seem a bit awkward to me for bigger projects.)?

You could try python. The next version of GRASS will use python heavily for the
GUI, so expect lots of example scripts, help on the mailing list from fellow
travelers, and tight integration with the code.

Learn python in 10 min: http://www.poromenos.org/tutorials/python

Also there is a SWIG/Python interface to any needed GIS library functions,
which is pretty cool, although the grass modules generally give you what you
need without having to resort to using any low-level libgis functions.

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python
     http://freegis.org/cgi-bin/viewcvs.cgi/grass6/swig/python/

Hamish

      ____________________________________________________________________________________

Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

_______________________________________________
statsgrass mailing list
statsgrass@grass.itc.it
http://grass.itc.it/mailman/listinfo/statsgrass

--
NEW EMAIL ADDRESS AND ADDRESS:

Rainer.Krug@uct.ac.za

RKrug@sun.ac.za WILL BE DISCONTINUED END OF MARCH

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Tel: +27 - (0)21 650 5776 (w)
Fax: +27 - (0)86 516 2782
Fax: +27 - (0)21 650 2440 (w)
Cell: +27 - (0)83 9479 042

Skype: RMkrug

email: Rainer.Krug@uct.ac.za
         Rainer@krugs.de

I don't know if this will help you.
Just thinking about your reasons to use windows, maybe it's because you
need to execute some windows program.
My solution is to use R-GRASS in Linux for simulation, what is excellent
beacuse of the wealth of R functions for statistical evaluation of the
models, and the matrix operations in R. Also you can call C compiled
code from your R script to speed up bottlenecks in your code, as pieces
with a lot of loopings etc.
And if you need to execute some windows program, you can also execute
them remotely in a windows machina via ssh and get bak your results to
your linux machine. This also works right.
Good luck
Javier
----------------------------------------

Agustin Lobo wrote:

Actually, I often use R as an scripting language
for grass. The problem is that grass commands have
to be issued using system(), which, for a complex code,
becomes inconvenient (lots of paste() for generating the
actual grass command).
Not being an expert at all on python, I wonder
if making R able of executing grass commands without
having to use system() could not be a valid alternative
to python, at least in some cases.

Anyway, I think that the real solution would be having a GIS
able of displaying R objects, sort of RGis.

Agus

Hamish escribió:

Rainer M. Krug wrote:

I am planning to write a spatial simulation model, simulating the
spread of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which
scripting language. I am using Linux and have quite a bit of
experience with R, so I thought that R (together with spgrass6)
would be a nice scripting language to write the simulation and
sending the grass commands through to grass, because it offers me
quite a bit more concerning strtucturing on the modelling side then
using a normal shell script
But the simulation should also run under Windows and I don't have
any experience with grass and R under windows.

It sounds very well suited for Linux or MacOSX, but I've little idea
about the
GRASS+R Windows situation. Maybe someone on the statsgrass mailing
list knows?
(taking the liberty to cc)

I have the following questions:

..

3) Is any other scripting language more suitable for what I want to
achieve (I have no experience with C / C++, but quite a bit with
Delphi. I have never used the likes of perl et al. and bash scrips
seem a bit awkward to me for bigger projects.)?

You could try python. The next version of GRASS will use python
heavily for the
GUI, so expect lots of example scripts, help on the mailing list from
fellow
travelers, and tight integration with the code.

Learn python in 10 min: http://www.poromenos.org/tutorials/python

Also there is a SWIG/Python interface to any needed GIS library
functions,
which is pretty cool, although the grass modules generally give you
what you
need without having to resort to using any low-level libgis functions.

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python
     http://freegis.org/cgi-bin/viewcvs.cgi/grass6/swig/python/

Hamish

____________________________________________________________________________________

Luggage? GPS? Comic books? Check out fitting gifts for grads at
Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

_______________________________________________
statsgrass mailing list
statsgrass@grass.itc.it
http://grass.itc.it/mailman/listinfo/statsgrass

--
Javier García-Pintado
Institute of Earth Sciences Jaume Almera (CSIC)
Lluis Sole Sabaris s/n, 08028 Barcelona
Phone: +34 934095410
Fax: +34 934110012
e-mail:jgarcia@ija.csic.es

Hamish:

> see http://grass.gdf-hannover.de/wiki/GRASS_and_Python

Rainer:

Looking at the document, I must say it seems to be a usefull approach to
use Python - and it is crossplatform. One thing which I did not see that
quickly is how I can execute grass commands from python - I guess it is
easy, but I didn't find it when I looked at the document.

I defer to the GUI programmers to answer that.

Thanks a lot for your usefull and very helpfull hints,

no worries.

Hamish

      ____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7

Hamish wrote:

Hamish:
> > see http://grass.gdf-hannover.de/wiki/GRASS_and_Python
Rainer:
> Looking at the document, I must say it seems to be a usefull approach to
> use Python - and it is crossplatform. One thing which I did not see that
> quickly is how I can execute grass commands from python - I guess it is
> easy, but I didn't find it when I looked at the document.

For information on running external commands from Python, see:

  http://docs.python.org/lib/module-subprocess.html

Avoid using the older os.* functions. Section 17.1.3 lists equivalents
using the Popen() interface, which is more robust (particularly on
Windows).

--
Glynn Clements <glynn@gclements.plus.com>

Ranier,

On 9/25/07 2:02 AM, "Hamish" <hamish_nospam@yahoo.com> wrote:

Rainer M. Krug wrote:

I am planning to write a spatial simulation model, simulating the spread
of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which
scripting language. I am using Linux and have quite a bit of experience
with R, so I thought that R (together with spgrass6) would be a nice
scripting language to write the simulation and sending the grass
commands through to grass, because it offers me quite a bit more
concerning strtucturing on the modelling side then using a normal shell
script
But the simulation should also run under Windows and I don't have any
experience with grass and R under windows.

You might want to take a look at the wildfire modeling routines already in
GRASS. I think that with minimal work, these could be modified to become
general spread-modeling routines. I've used these (with some difficulty) to
model the spread of other phenomena than wildfires and would love to have
general spread routines in GRASS.

It sounds very well suited for Linux or MacOSX, but I've little idea about the
GRASS+R Windows situation. Maybe someone on the statsgrass mailing list knows?
(taking the liberty to cc)

I have the following questions:

..

3) Is any other scripting language more suitable for what I want to
achieve (I have no experience with C / C++, but quite a bit with Delphi.
I have never used the likes of perl et al. and bash scrips seem a bit
awkward to me for bigger projects.)?

You could try python. The next version of GRASS will use python heavily for
the
GUI, so expect lots of example scripts, help on the mailing list from fellow
travelers, and tight integration with the code.

Learn python in 10 min: http://www.poromenos.org/tutorials/python

Also there is a SWIG/Python interface to any needed GIS library functions,
which is pretty cool, although the grass modules generally give you what you
need without having to resort to using any low-level libgis functions.

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python
     http://freegis.org/cgi-bin/viewcvs.cgi/grass6/swig/python/

Hamish

I also want to second Hamish's mention of Python. It is a powerful and
(relatively) easy to learn language that will become increasingly important
to GRASS in the future. Extensions scipy and numpy give it additional
abilities.

Michael

______________________________________________________________________________
______
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

javier garcia-pintado wrote:

I don't know if this will help you.
Just thinking about your reasons to use windows, maybe it's because you
need to execute some windows program.

No - I am absolutely happy with Linux and would prefer to not have to think about windows any more - but there is always somebody who is paying you, in my pase the one who contracted us. They want to use it finally under windows...

Rainer

SNIP
--
NEW EMAIL ADDRESS AND ADDRESS:

Rainer.Krug@uct.ac.za

RKrug@sun.ac.za WILL BE DISCONTINUED END OF MARCH

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Tel: +27 - (0)21 650 5776 (w)
Fax: +27 - (0)86 516 2782
Fax: +27 - (0)21 650 2440 (w)
Cell: +27 - (0)83 9479 042

Skype: RMkrug

email: Rainer.Krug@uct.ac.za
         Rainer@krugs.de

javier garcia-pintado wrote:

I don't know if this will help you.
Just thinking about your reasons to use windows, maybe it's because you
need to execute some windows program.

No - I am absolutely happy with Linux and would prefer to not have to think about windows any more - but there is always somebody who is paying you, in my pase the one who contracted us. They want to use it finally under windows...

Rainer

SNIP
--
NEW EMAIL ADDRESS AND ADDRESS:

Rainer.Krug@uct.ac.za

RKrug@sun.ac.za WILL BE DISCONTINUED END OF MARCH

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Tel: +27 - (0)21 650 5776 (w)
Fax: +27 - (0)86 516 2782
Fax: +27 - (0)21 650 2440 (w)
Cell: +27 - (0)83 9479 042

Skype: RMkrug

email: Rainer.Krug@uct.ac.za
         Rainer@krugs.de

Glynn Clements wrote:

Hamish wrote:

Hamish:

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python

Rainer:

Looking at the document, I must say it seems to be a usefull approach to use Python - and it is crossplatform. One thing which I did not see that quickly is how I can execute grass commands from python - I guess it is easy, but I didn't find it when I looked at the document.

For information on running external commands from Python, see:

  http://docs.python.org/lib/module-subprocess.html

Avoid using the older os.* functions. Section 17.1.3 lists equivalents
using the Popen() interface, which is more robust (particularly on
Windows).

Thanks a lot - I will take a look at them.

--
NEW EMAIL ADDRESS AND ADDRESS:

Rainer.Krug@uct.ac.za

RKrug@sun.ac.za WILL BE DISCONTINUED END OF MARCH

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Tel: +27 - (0)21 650 5776 (w)
Fax: +27 - (0)86 516 2782
Fax: +27 - (0)21 650 2440 (w)
Cell: +27 - (0)83 9479 042

Skype: RMkrug

email: Rainer.Krug@uct.ac.za
         Rainer@krugs.de

Michael Barton wrote:

Ranier,

On 9/25/07 2:02 AM, "Hamish" <hamish_nospam@yahoo.com> wrote:

Rainer M. Krug wrote:

I am planning to write a spatial simulation model, simulating the spread
of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which
scripting language. I am using Linux and have quite a bit of experience
with R, so I thought that R (together with spgrass6) would be a nice
scripting language to write the simulation and sending the grass
commands through to grass, because it offers me quite a bit more
concerning strtucturing on the modelling side then using a normal shell
script
But the simulation should also run under Windows and I don't have any
experience with grass and R under windows.

You might want to take a look at the wildfire modeling routines already in
GRASS. I think that with minimal work, these could be modified to become
general spread-modeling routines. I've used these (with some difficulty) to
model the spread of other phenomena than wildfires and would love to have
general spread routines in GRASS.

Good idea - I haven't thought about them. I'll see what I can do with them.

It sounds very well suited for Linux or MacOSX, but I've little idea about the
GRASS+R Windows situation. Maybe someone on the statsgrass mailing list knows?
(taking the liberty to cc)

I have the following questions:

..

3) Is any other scripting language more suitable for what I want to
achieve (I have no experience with C / C++, but quite a bit with Delphi.
I have never used the likes of perl et al. and bash scrips seem a bit
awkward to me for bigger projects.)?

You could try python. The next version of GRASS will use python heavily for
the
GUI, so expect lots of example scripts, help on the mailing list from fellow
travelers, and tight integration with the code.

Learn python in 10 min: http://www.poromenos.org/tutorials/python

Also there is a SWIG/Python interface to any needed GIS library functions,
which is pretty cool, although the grass modules generally give you what you
need without having to resort to using any low-level libgis functions.

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python
     http://freegis.org/cgi-bin/viewcvs.cgi/grass6/swig/python/

Hamish

I also want to second Hamish's mention of Python. It is a powerful and
(relatively) easy to learn language that will become increasingly important
to GRASS in the future. Extensions scipy and numpy give it additional
abilities.

Michael

      ______________________________________________________________________________
______
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

--
NEW EMAIL ADDRESS AND ADDRESS:

Rainer.Krug@uct.ac.za

RKrug@sun.ac.za WILL BE DISCONTINUED END OF MARCH

Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

Tel: +27 - (0)21 650 5776 (w)
Fax: +27 - (0)86 516 2782
Fax: +27 - (0)21 650 2440 (w)
Cell: +27 - (0)83 9479 042

Skype: RMkrug

email: Rainer.Krug@uct.ac.za
         Rainer@krugs.de

I might soon have some time available to look into modifying
r.wildfire and generalizing it for applications in archaeology,
human geography ... or astrobiology.

Do you have any pointers to publications that I could look into
as a starting point for some inspiration?

Benjamin

Michael Barton wrote:

Ranier,

On 9/25/07 2:02 AM, "Hamish" <hamish_nospam@yahoo.com> wrote:

Rainer M. Krug wrote:

I am planning to write a spatial simulation model, simulating the spread
of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which
scripting language. I am using Linux and have quite a bit of experience
with R, so I thought that R (together with spgrass6) would be a nice
scripting language to write the simulation and sending the grass
commands through to grass, because it offers me quite a bit more
concerning strtucturing on the modelling side then using a normal shell
script
But the simulation should also run under Windows and I don't have any
experience with grass and R under windows.

You might want to take a look at the wildfire modeling routines already in
GRASS. I think that with minimal work, these could be modified to become
general spread-modeling routines. I've used these (with some difficulty) to
model the spread of other phenomena than wildfires and would love to have
general spread routines in GRASS.

It sounds very well suited for Linux or MacOSX, but I've little idea about the
GRASS+R Windows situation. Maybe someone on the statsgrass mailing list knows?
(taking the liberty to cc)

I have the following questions:

..

3) Is any other scripting language more suitable for what I want to
achieve (I have no experience with C / C++, but quite a bit with Delphi.
I have never used the likes of perl et al. and bash scrips seem a bit
awkward to me for bigger projects.)?

You could try python. The next version of GRASS will use python heavily for
the
GUI, so expect lots of example scripts, help on the mailing list from fellow
travelers, and tight integration with the code.

Learn python in 10 min: http://www.poromenos.org/tutorials/python

Also there is a SWIG/Python interface to any needed GIS library functions,
which is pretty cool, although the grass modules generally give you what you
need without having to resort to using any low-level libgis functions.

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python
     http://freegis.org/cgi-bin/viewcvs.cgi/grass6/swig/python/

Hamish

I also want to second Hamish's mention of Python. It is a powerful and
(relatively) easy to learn language that will become increasingly important
to GRASS in the future. Extensions scipy and numpy give it additional
abilities.

Michael

      ______________________________________________________________________________
______
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

I might soon have some time available to look into modifying
r.wildfire and generalizing it for applications in archaeology,
human geography ... or astrobiology.

Do you have any pointers to publications that I could look into
as a starting point for some inspiration?

Benjamin

Michael Barton wrote:

Ranier,

On 9/25/07 2:02 AM, "Hamish" <hamish_nospam@yahoo.com> wrote:

Rainer M. Krug wrote:

I am planning to write a spatial simulation model, simulating the spread
of alien species on a landscape scale by using grass.
My question how I should write the simulation model, i.e. in which
scripting language. I am using Linux and have quite a bit of experience
with R, so I thought that R (together with spgrass6) would be a nice
scripting language to write the simulation and sending the grass
commands through to grass, because it offers me quite a bit more
concerning strtucturing on the modelling side then using a normal shell
script
But the simulation should also run under Windows and I don't have any
experience with grass and R under windows.

You might want to take a look at the wildfire modeling routines already in
GRASS. I think that with minimal work, these could be modified to become
general spread-modeling routines. I've used these (with some difficulty) to
model the spread of other phenomena than wildfires and would love to have
general spread routines in GRASS.

It sounds very well suited for Linux or MacOSX, but I've little idea about the
GRASS+R Windows situation. Maybe someone on the statsgrass mailing list knows?
(taking the liberty to cc)

I have the following questions:

..

3) Is any other scripting language more suitable for what I want to
achieve (I have no experience with C / C++, but quite a bit with Delphi.
I have never used the likes of perl et al. and bash scrips seem a bit
awkward to me for bigger projects.)?

You could try python. The next version of GRASS will use python heavily for
the
GUI, so expect lots of example scripts, help on the mailing list from fellow
travelers, and tight integration with the code.

Learn python in 10 min: http://www.poromenos.org/tutorials/python

Also there is a SWIG/Python interface to any needed GIS library functions,
which is pretty cool, although the grass modules generally give you what you
need without having to resort to using any low-level libgis functions.

see http://grass.gdf-hannover.de/wiki/GRASS_and_Python
     http://freegis.org/cgi-bin/viewcvs.cgi/grass6/swig/python/

Hamish

I also want to second Hamish's mention of Python. It is a powerful and
(relatively) easy to learn language that will become increasingly important
to GRASS in the future. Extensions scipy and numpy give it additional
abilities.

Michael

      ______________________________________________________________________________
______
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser