I am working with mathematical-ecological modeling and I am also a new user of QGIS Software. First I am creating 3 circular buffers with same center (shape center) covering a region with roads (shape roads), so I have initialy two shapes and after I create 3 circular buffers. All mathematical work I use R software to produce the number of intermediary rings and distances with each these intermediary rings that will be between the pair of main circular buffers.

My firsts questions are: How could I create automated the process of rings or buffers between the main circulars buffers? Are there scripts or other solution for this?

My second and last: I have roads crossing the buffers and in case of creation of rings (or intermediary buffers) how could I calculate the length of the roads between the two intermediary rings?


enter image description here

The problem is the rings made with a non automate process and also made in atribute table. So I wish make together the automate process with the calculation of the roads that cross the pair of rings. Using R like you said it is possible, but I would like to know the both process because it will be better to know how will be more easy for me. it is my first work with QGIS.

  • 2
    Welcome to GIS.se. I'm not sure I understand your question - is there any chance you can add a diagram that shows examples of what you are trying to do? Also, this site format is Q&A, which works better if you ask only one question per post. I'd suggest that you update your question (just click edit below the question) to include only one sentence that ends with a question mark - in your case, the first questions can be easily folded into a single question, and the second held over for a second question, which would link to this question. – BradHards May 4 '14 at 20:58
  • 1
    Also, you don't need to sign your question - every post gets your name below it, which you can see above. So you can remove that when you edit. – BradHards May 4 '14 at 20:59

I will answer to your Question. Please open another Post for the second one.

You can automate tasks in QGIS using the graphical modeller or python scripts. Both work fine and you can find nice documentations to it. If you already work with R it may be handy for you to perform the GIS-Parts in R too. The rgeos and rgdal packages should have all the tools you need (readOGR(), gBuffer()). If you know how you want to solve this task you can get additional Help.

To make it a bit easyer I wrote a little Buffer-Loop in R for you:


points <- readOGR(dsn="C:/local_work/example", layer="points_wgs84_pm")
distances <- seq(1000,2000,100)
buffers <- list()
for(i in distances){
  buffers[as.character(i)] <- gBuffer(points, width=i)

You can export the Buffers using writeOGR() if you like, but you can also keep working in R.

  • But should I do this inside the QGIS or out (in R only)? – Paulo Pimenta May 7 '14 at 0:31
  • Both is possible. If you got advanced R Skills it may be more easy for you to perform the whole project directly in R. QGIS is maybe more intuitive and you can check your results more easyly. Take a look to the graphical modeller, here you can predefine workflows, but there is no easy way to create something like a loop: qgis.org/en/docs/user_manual/processing/modeler.html . – Julian May 7 '14 at 7:20
  • I update the status. Inside QGIS there is a R link, but I couldn't do nothing because my scripts have not run. Although R can process the mathematical part I need integrate with QGIS to improve with the other results like the sum of the roads that cross the rings. – Paulo Pimenta May 8 '14 at 1:59
  • Beside the fact that this should be possible in R too, this sounds like you should use Python to control QGIS. I havent done this bevore, but it shouldn't be to hard if you can program R, Python is not to different. Here you can learn how to create a QGIS-Python script: qgis.org/en/docs/pyqgis_developer_cookbook/index.html – Julian May 8 '14 at 10:31
  • it sounds great. Beside following these postings I have been seeing some other topics here at forum and many doubts like mine were solved using python. Maybe it is a good idea to try python! – Paulo Pimenta May 9 '14 at 0:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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