I have 2 polygons in separate files: a hand-digitized boundary (blue) & the county shapefile (red). My goal is to find out which counties the boundary intersects. However, some parts of the boundary do not align with the county boundary (due to silvers that are not snapped) so my results returned counties that were not supposed to be included.
Example of my explaination: the county boundary on the top is included when it's shouldn't be
I'm trying to snap the polygon to the county boundary so that the nearest points in the polygon aligns with the county boundary and then I will use st.intersect()
to retrieve the names of the intersecting boundary.
I tried using st.snap
but it is giving me an error.
county <- st_transform(county, 4269) # CRS to (EPSG:4269)
p <- st_transform(p, 4269)
snapped <- st_snap(p, county, 1000)
# Error in st_snap.sfc(st_geometry(x), st_geometry(y), tolerance) :
# st_snap for longitude/latitude data not supported; use st_transform first?
I'm basically trying to perform what this post is explaining but in R, preferebly with the sf package.
Any help would be great. Please let me know if there are any clarifications needed.