OK, how I did this, is loop through creating ring buffers on objects, and saving the output as a new featureclass in a standlone datasets collection. I then merged the featureclasses, like so:
tmp_merge = "path to area"\+ "tmp_merge"
final_out_path_agg = final_staging + "_Agg"
final_out_path_simp = final_staging + "_Simp"
#check if files exist and delete if they do; assume nothing
if (arcpy.Exists(tmp_merge)):
arcpy.Delete_management(tmp_merge)
#set up folder to search for polygon data
arcpy.env.workspace = scratchDB + "mytmpBuff.gdb/Polygons/"
#collate FC
fcs = arcpy.ListFeatureClasses()
L = []
count = 0
try:
for fc in fcs:
#append to array ready for merging
L.append(fc)
count = count + 1
except:
print "Error collating FeatureClasses."
try:
if count > 1:
arcpy.Merge_management(L, tmp_merge)
elif count == 0:
arcpy.AddMessage("No FeatureClass Polygons located.")
arcpy.AddMessage("Error collating FeatureClasses.")
sys.exit(-1)
except:
arcpy.AddMessage("Error merging FeatureClasses.")
Then dissolved them
#overlaps dissolved
arcpy.Dissolve_management(tmp_merge, final_out_path_agg, "Name", [["RunID","FIRST"],["AltiLwr","FIRST"],["AltUpr","FIRST"],["TimeSl","FIRST"],["ConcentrationBand","FIRST"],["ConcLvl","FIRST"],["IsC","FIRST"]])
arcpy.DeleteField_management(final_out_path_agg, "NAME")
The buffers are created in a loop and stored in arcpy.env.workspace = scratchDB + "mytmpBuff.gdb/Polygons/" before I later loop through them.
It works, or it does if I have understood your issue correctly!
Using QGIS and the Multi-distance buffer plugin, your buffer zones around the locations of traffic intersections would be non-overlapping, and each zone would be identified in the attribute distance by the distance to the outer border of the zone.
That means that you can do a simple spatial join or point-polygon overlay to get the buffer zone added to your "location of road accidents" dataset.
Spatial join:
Vector-> Data management tools-> Join attributes by location
Use your "accidents" point dataset as target and your buffer dataset as join. Take attribute of first located feature. For Output table choose the option that suits you.
Overlay:
Vector-> Geoprocessing tools-> Intersect
Vector-> Geoprocessing tools-> Union
Use the "accidents" point dataset as input and the buffer dataset as intersect / union layer.
If you want to select points within the 50m buffer while excluding those that fall outside it and within the 25m buffer, you would select the features with a value of 50 for the distance attribute in the resulting dataset.
Best Answer
A multi-ring buffer can be made using
ogr2ogr
with the SQLite dialect. The trick consists into making the difference between buffers and then uniting the inner buffer. Here's an example with two buffer respectively of 5 and 10 map units:A dynamic
R
solution:Since, OP was also about a usage in
R
, this approach could also be used inR
'sgdalUtils
function in an automated way. This example creates a multiring buffer of rings from 1 km to 100 km (by 1 km).