However, most subsets of your data do not contain that conflict. I don't know what a "side location conflict" is. However, your data in particular generates an error when you try to do this: st_intersection(polls_buffer_400) This is built in to the st_intersection function for finding intersections of sfc objects with themselves.
Lastly, there should be a better way to generate your intersecting polygons that already counts overlaps. Geom_sf(aes(alpha = 0.2*n_overlaps), fill = "red") Mutate(n_overlaps = lengths(st_covered_by(geometry, polls_buffer_400))) %>% It makes it very clear how you associate an attribute like colour with a specific variable.įor example, here is an example mapping the alpha (transparency) of each polygon to a scaled version of the n_overlaps column: library(ggplot2) If you want to plot these things I highly recommend using ggplot2. Mutate(n_overlaps = lengths(st_within(geometry, polls_buffer_400)))Īnd this is the bit I'm not sure about, to get to the output I want (which will show "Hotspots" of polling stations in this case) how do I colour things? Similarly, for your sfc collection of intersecting polygons, you could add a column that counts the number of buffer polygons that contain each intersection polygon: polls_intersection %>% Mutate(n_neighbors = lengths(st_is_within_distance(polls, dist = 400))) # n_neighbors shows how many polling stations are within 400m Note that the minimum value is 1 because a polling station is always within 400m of itself.
#Create an intersection layer in transcad how to
Here is how to add a column to your initial sfc of pollings stations that tells you how many polling stations are within 400m of each feature in that sfc. How can I : asess the degree of spatial proximity of each point to other equivalent points by looking at the number of others within 400m (5 minute walk). What am I colouring here? I mean it looks nice but I really don't know what I'm doing. 5)) summary(lengths(st_intersects(polls_intersection))) Plot(polls_intersection$geometry,col = sf.colors(categorical = TRUE, alpha =. This gives the intersections different colours which is great. It's probably terribly bad form but here's my original GIS question Needed%group_by()%>%count()Īnd this is the bit I'm not sure about, to get to the output I want (which will show "Hotspots" of polling stations in this case) how do I colour things? How can I :Īsess the degree of spatial proximity of each point to other equivalent points by looking at the number of others within 400m (5 minute walk).
#Create an intersection layer in transcad code
To simplify here's some code # load packages I've asked this question in GIS overflow, but I'm not sure it's going to get answered for ArcGIS and I think I'd prefer to do the work in R. This number of overlaps should relate back to the original point so I can see which point has the highest number of overlaps and therefore if I were to walk 400 m from that point I could determine how many other points I could get to. I want to determine which buffers overlap and then count the number of overlaps. I can draw a simple 400 m buffer around them. I want to assess the degree of spatial proximity of each point to other equivalent points by looking at the number of others within 400m (5 minute walk).