v.count.points.sh

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 pointing out some unsafe pieces of code and helping for a faster code. v.count.points.sh 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!

Pubblicato da

Stefano Costa

Archaeologist, I study the Late Antique and Early Medieval/Byzantine period on the northern side of the Mediterranean, focusing on pottery usage patterns. I'm also involved in open source and open knowledge communities, like OSGeo, the IOSA project and the Open Knowledge Foundation.

Rispondi