Stefano Costa bio photo

Stefano Costa

Email Twitter Github

Last week I was looking at some slides from a lecture here at university. One slide caught my attention more than others, it was a map with some pie charts representing the distribution of different vegetal species in quadrats of an archaeological sites. Quite common and ordinary stuff in publications, indeed.

the result using d.vect.chart

The first question rising to my mind was: how do I do this in GRASS?. It turned out that there wasn't a module to automagically count the number of points within an area, and generate a report that keeps also information about the distribution of different classes. The chart stuff is already available since GRASS 6.0 and before, but I needed a module that could generate data from which I could plot charts.

Thanks to Giovanni Allegri, Markus Neteler I could end up with a bash script that does all this quite well, even though a bit slowly. Hamish Bowman helped a lot ointing out some unsafe pieces of code and helping for a faster code. is now the first of a series of tutorials about spatial analysis (this being a very simple form of analysis) for archaeology on the Quantitative Archaeology wiki.

Check out the script page on the wiki and let me know if you find errors. Patches are welcome!