Skip to main content
added 41 characters in body
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

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 this, more recent postCalculating 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

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 this, more recent post.

  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

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

replaced http://gis.stackexchange.com/ with https://gis.stackexchange.com/
Source Link

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 this, more recent postthis, more recent post.

  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

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 this, more recent post.

  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

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 this, more recent post.

  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

Source Link
phloem
  • 4.7k
  • 16
  • 30

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 this, more recent post.

  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