Create a tile for an island that can be added to an existing tile map layout.

create_island(tile_map, position)

Arguments

tile_map

An sfc_POLYGON object representing the layout of a tile map.

position

Either a numeric vector of length 2 giving the coordinates for the centroid of the new tile, or a string equal to "upper left", "lower left", "upper right", or "lower right" indicating in which corner of the original tile map the new tile should be located.

Value

Returns an object of class sfc_POLYGON representing a single tile of the same shape and size as the tiles in the original tile map.

Details

Creates a single tile of the same shape and size as the tiles in the given tile map. This tile can be added to the layout of the given tile map to represent an island or region that is not connected to the region represented by the given tile map. The location of the new tile is determined by the position argument. Setting the position argument equal to "upper left", "lower left", "upper right", or "lower right" will generate a tile which is located in the specified corner of the given tile map. Setting the position argument to a numeric vector of length 2 will generate a tile whose centroid is located at the coordinates given in the vector.

Examples

#> Linking to GEOS 3.8.1, GDAL 2.4.4, PROJ 7.0.0
northeast <- governors[c(6,7,17,18,19,27,28,30,36,37,43),] tile_map <- generate_map(northeast$geometry, square = FALSE) tile_map <- append(tile_map, create_island(tile_map, "lower right"))