This question is similar to Create polygons from point dataset, where each polygon contains 3 points from the dataset, and in particular my problem is actually described in this comment to that question. But the problem were never solved there.
I have three sets of points. I want to partition the area which is covered by the points into polygons. Each polygon must have at least one point from each set of points.
The more polygons the better solution. I use R, so solutions written in R are preferred.
Ideally, the solution would be general enough to apply to a situation where there were two sets of points, or four sets of points.
My data is available here, and with this code, a map with the points can rendered:
library(ggmap) load(url("http://hansekbrand.se/gis.RData")) ## this loads "gis" and "my.map" my.map + geom_point(aes(colour = Generation, x = lon, y = lat), size = 0.01, data = gis)
The type of point is given by the variable
Generation in the object
str(gis) 'data.frame': 875 obs. of 3 variables: $ lon : num -1.52 -2.42 -2.35 -1.57 -1.53 ... $ lat : num 12.4 13.6 13.2 13.6 13.3 ... $ Generation: Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ...