I have to do a task in Python/ArcPy/GDAL/whatever because I'm trying to automate this process for a hundred or so different raster/shapefile combos.
This is what I need to do:
I have an empty raster and a shapefile with thousands of points. I would like to update the value of each cell/pixel in the raster to reflect the number of times a unique point lands within that cell.
At first I was thinking something like this:
for cell in raster:
for point in shapefile:
if point intersects with (/is contained in) cell: cell_value + = 1
However, I don't know how to implement this because I don't see how to intersect a raster and a polygon. Converting the raster into polygons is out of the question because the rasters are very large with a lot of cells.
I'm not married to the idea of looping through both the individual cells and points because I feel like it's unnecessary, so if there is an ArcGIS tool(s) that I could manipulate, and/or another method in python I could use to reach my goal, I'm more than happy to try that out.
COUNT
for the cell_assignment option). Would it be feasible for you to convert all your point shapefiles into rasters, then analyze the raster values (which will be point counts)?assignmentType = "COUNT"
instead of"MAXIMUM"
). I honestly don't know how its speed would compare to counting. It will be making a raster for each of your point shapefiles, so storage may become a concern (although you can delete the raster after you're done with it).