I am working with QGIS and I have two different polygons, one with municipalities and another with conservation units (from Brazil).

I need find out which Conservation units falls within 50 km from every municipality.

It would be great to create a new polygon layer only with municipalities that are close to a Conservation Unit and with an attribute called UCs that contains every Conservation Units within a 50 km distance (but also keeping the original municipalities attributes).

Have I made myself clear?

I'm using QGIS because it seems easier , but, latter on, I will read this data from R. If the calculations are performed better with R, it would be better for me.

  • 3
    Have you tried making a 50km buffer round your municipalities and then intersecting with conservation units? You need to decide if conservation units can be partly or totally inside your 50km region though. Can also be done in R with rgeos package and gBuffer function. – Spacedman Jan 20 '17 at 18:05

I belive you would want to make a 50km buffer around the municipalities (as stated before). Once the buffer has been applied, you can open the attribute table and see which conservation units fall within the boundaries. You can then right click on the layer, Export, Save Feature As, select the format you want to save in (likely Shapefile), name the Shapefile (UCs, as you said), and click 'Save only selected features' under Enconding.

You mentioned wanting to maintain the attribute elements of the municipalities layer. In order to do this, I would frist perform a spatial join with the municipalities layer and conservation units layer. This would create one layer for both of them and will hold both of their attributes. Then, when you performed the buffer and exported the new shapefile, all of the details will be maintained.

I'm not sure about doing this in R, but using the arcpy package in Python is very useful and very fast. https://pro.arcgis.com/en/pro-app/arcpy/get-started/what-is-arcpy-.htm

If you scroll to the middle of the page, you can see examples and syntax of the arcpy buffer_analysis tool. It is relatively easy to navigate and, as I said, fast!: http://desktop.arcgis.com/en/arcmap/10.3/tools/analysis-toolbox/buffer.htm

| improve this answer | |

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.