I'm quite new to geospatial analysis in R and need help with dissolving polygons based on their location.
I have a shapefile with about 1500 polygons. Each polygon has a property code. There are a total of 4 properties in the shape attribute table. I needed to dissolve all polygons that have the same property code if they are within a distance of up to 20 meters from each other. Any insights on how can I do this?
Thanks in advance!
data subset:
> dput(SpatialPolygons(list(Polygons(list(Polygon(shp_sub)), 1))), control="all")
new("SpatialPolygons", polygons = list(new("Polygons", Polygons = list(
new("Polygon", labpt = c(662107.09446353489, 670702.83409774397
), area = 15642909.541120354, hole = FALSE, ringDir = 1L,
coords = structure(c(662914.16988108843, 660819.24410834303,
661686.14174023282, 655590.40998587455, 662663.06165560661,
654986.60489466891, 656554.61134749465, 662744.22298060439,
653763.25605930295, 654452.19243265921, 662809.59039208689,
660147.03013036621, 662176.09769302572, 660630.43945095874,
664144.72288613662, 662914.16988108843, 663103.61422573915,
666180.53174116358, 665542.97683514666, 665529.15833193157,
664023.14232105017, 663416.57999173785, 664675.82179644238,
663715.85020686744, 663411.2359451541, 663617.32660092064,
663030.70651094906, 676394.80790592649, 675262.54310305626,
672662.00823758543, 671630.53395956859, 663103.61422573915
), .Dim = c(16L, 2L)))), plotOrder = 1L, labpt = c(662107.09446353489,
670702.83409774397), ID = "1", area = 15642909.541120354)), plotOrder = 1L,
bbox = structure(c(653763.25605930295, 663030.70651094906,
664144.72288613662, 676394.80790592649), .Dim = c(2L, 2L), .Dimnames = list(
c("x", "y"), c("min", "max"))), proj4string = new("CRS",
projargs = NA_character_))