I have a geospatial problem that I can't seem to figure out, and I'm wondering what combination of geoprocessing tools, if any, could get me the result I need. Also open to any suggestions outside of the box for how to solve this.
I have roadway segments (lines), road intersections (points), and "adjacent block areas" (polygons). For all parts of the roadway segment that are touching an adjacent block area, I want to use that adjacent block polygon for my calculation. But where there is no adjacent block, I want to use a 2000' buffer. Either way, I need to calculate the number of intersection points inside my selected polygons.
In the image below, the green areas are the adjacent polygons and the blue area is just a 2000' buffer. The areas outlined in the orange dashed line are what I'm trying to remove from the analysis. I need to calculate the number of points that touch the green polygons PLUS the number of points that touch the 2000' buffer but only where there is no green polygon for that part of the roadway, looking at the left and right sides of the road separately.
I was staring at this for minutes trying to figure out where the polygons were until I broke out the eyedropper tool. For anyone else with some red-green color blindness, here's a version of the OP's image with the polygons' contrast blown out:
I don't have a solution right now, but to confirm some things: is the attached data and image consistent with how your data is laid out? Have I classified my demo points correctly based on the results you're looking for?
Alright, given the limited test data I've made, I think I have a working concept. This requires that the roadway segments don't have any gaps in each working area, and the block areas touch the roadway segments in at least two places.
line = next(arcpy.da.SearchCursor("Dissolved Roadway Segments", "SHAPE@"))[0]
def _sort_by_length(row):
return line.measureOnLine(row[1])
sorted_points = sorted(arcpy.da.SearchCursor("Spatial Join Points", ("OID@", "SHAPE@")), key=_sort_by_length)Phew, that was a lot! But from my limited testing this gives you a bunch of polygons that indicate points to exclude from further processing. Hope this gets you started on something. I also welcome anyone reading this to reply with better ways to do all the geometry nonsense I laid out.
Just thought of one last thing to try: if you have a 3D Analyst license you can extrude your block areas into extremely tall buildings and poke around the Visibility tools. This might be the most accurate way to figure out which areas are "in shadow" and can be culled.