Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a beginner in programming but i have to work with GRASS at work, and do it quickly.

I'm completely lost with all the variety of tutorials that are existing and to me, don't look the same...and nothing of them answer my basic questions (how to make very simple loops on multiple raster).

So I want to clarify where to start and what to use. I'm using GRASS with the 6.4.2 command line, under Windows 7 OS.

I don't know if I have to use Unix syntax or other, and I don't know if I have to directly use the Python shell more than the basic grass shell.

Anybody can help me to get started with very simple tutorials for using shell (loops, work with data from mapsets, using variables, import, export...) ?

share|improve this question

GRASS is written in C and have a ctypes python lib and recently an improved high level python library called pygrass. see pygrass documentation here. To work with raster data please refer to raster section of pygrass.

I would suggest you to start with python than using shell programming because all shell scripts are ported to python for cross-platform compatibility.

grass is a multi binary package. Each module runs as a separate process. To do an analysis users just call these modules with correct parameters.

These examples shows how to run grass modules by code

share|improve this answer
Thank you Rashad for those informations. These examples are very useful. I have no skills in batch and in C, so It suits me to get into Python. – Samy-DT Apr 26 '13 at 4:54
Rashad do you know how install pygrass on windows ? I don't find any tutorial about it. – Samy-DT Apr 26 '13 at 15:09
you can download pygrass source from here and python install will build and install it on your system. Btw It will be great to have a windows installer. I will inform the guy who developed pygrass about it – rashad Apr 27 '13 at 3:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.