Friday, 16 October 2015

Intersecting overlapping polygons individually in ArcGIS Desktop


Map Layers:



  • Census Tract ShapeFile with Population Data

  • Set of Store Locations with 5 Mile Buffers (Significant Overlap Between Buffers)



I have create feature layers for both and I am trying to intersect the population data and the buffer data. However, the overlap between the buffer polygons is leading to significant duplication/over counting, as the polygons draw from the census tract layer as well as the overlap with other polygons.


Is there a way to intersect the polygons individually so that they are only drawing from the census tract data?



Answer



This question likely should be split into two (how to intersect overlapping polygons, and how to split results proportionally), but here is my method, inspired largely by Calculating zonal statistics of raster data in multiple overlapping zones and combining them into one table, which is more recent.



  1. Calculate population density for each census tract (people per square metre, people per square mile, etc.). Works best if density unit matches cell size used in next step.

  2. Convert census tract to raster, using density as cell value. Now, each cell represents the actual number of people contained within, on average.

  3. Run following Python code to calculate Zonal Statistics for each buffer, then merge all results together.


store_buffs = r"C:\junk\overlap\store_buffer.shp" density_ras = r"C:\junk\overlap\density.tif" table_list = [] with arcpy.da.SearchCursor(store_buffs, ["FID"]) as cursor: for row in cursor: exp = '"FID" = ' + str(row[0]) temp_table = r"in_memory\temp_table" + str(row[0]) temp_shp = r'in_memory\temp_shp' arcpy.Select_analysis(store_buffs, temp_shp, exp) arcpy.sa.ZonalStatisticsAsTable(temp_shp, 'FID', density_ras, temp_table, 'DATA', 'SUM') table_list.append(temp_table) del row final_table = r"C:\junk\overlap\pop.dbf" arcpy.Merge_management(table_list, final_table)




  1. Join the output table to your store points to get total estimated population within store buffer


enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...