
However, if we plot the cells on a sphere, we see that they are of equal area, as promised: #Replot on a spherical projection Note that the cells are distorted by the projection of this flat map. Geom_path (data=grid, aes(x=long, y=lat, group=group), alpha=0.4, color="white") Geom_polygon(data=grid, aes(x=long, y=lat, group=group), fill="green", alpha=0.4) + Geom_polygon(data=countries, aes(x=long, y=lat, group=group), fill=NA, color="black") + #Get polygons for each country of the world Grid <- dgcellstogrid(dggs,df$cell,frame=TRUE,wrapcells=TRUE) #Get the grid in a more convenient format Be wary of doing this if you have too many samples, though. WriteOGR(grid, "dgg_sample_cells.kml", "cells", "KML")Īt this point you're done! You can parse weed out any highly unlikely pentagons by counting vertices in the KML, if need be.įor kicks, let's plot which polygons were chosen. #Save the hex boundaries to a handy KML file for use in your project Grid <- dgcellstogrid(dggs,df$cell,frame=FALSE) #Get the corresponding grid cells for each randomly chosen lat-longĭf$cell <- dgtransform(dggs,df$lat,df$lon) This means that they functionally have their own sections of the grid and a path that offers little in the way of deviation until they reach the end. On the Standard Grid, all party members begin very far away from one other. #Future versions of the package will make it easier to reject the pentagonsĭggs <- dgconstruct(area=100000, metric=FALSE, resround='nearest') The starkest difference between the two grids in Final Fantasy 10 is where each character starts on it. #But, with millions and millions of hexes, you are unlikely to choose one #Note: 12 cells are actually pentagons with an area 5/6 that of the hexagons When you feel the time is right, conclude by expressing gratitude for the crystals' support. It sometimes helps to visualize the energy torus around the grid growing larger. Then go around and 'connect the dots' with your wand or hand hovering over each crystal in your gird. #will tell you which area is closest to the one you want. Visualize it lighting up with your intention and the influx of energy. #Note: Cells can only have certain areas, the `dgconstruct()` function below You could, of course, choose a much smaller value, but these #Construct a global grid in which every hexagonal cell has an area of #Distribute the points uniformly on a sphere using equations from It also saves the vertices of these hexagonal cells to a file for use in other contexts.
SIMPLE GRIDS ON SPHERES CODE
The following code accomplishes what you want by distributing hexagonal cells of equal area uniformly across the surface of the Earth.

You're also right that they're the only way you're going to get cells of equal area.įortunately, I've built an R package called dggridR which makes it easy to work with them. You're right that geodesic grids are tricky. This solution also produces an output file in a standard format that any language should be able to read. If you need a different language, many of them have interfaces to R that you could use. You don't specify if you have a language preference.
