Skip to contents

Helper function to stitch tile coordinates together to form one complete picture

Usage

stitchTileCoordinates(location_file, Xtilespan, Ytilespan)

Arguments

location_file

location dataframe with X and Y coordinates

Xtilespan

numerical value specifying the width of each tile

Ytilespan

numerical value specifying the height of each tile

Value

data.table

Examples

location_file <- data.table::data.table(
    field = rep(c(1, 2), 5),
    X.X = rnorm(10), Y.Y = rnorm(10), XtileIndex = seq_len(10),
    YtileIndex = seq_len(10)
)

stitchTileCoordinates(location_file, Xtilespan = 0.5, Ytilespan = 0.5)
#>     field         X.X        Y.Y XtileIndex YtileIndex     Xcoord      Ycoord
#>     <num>       <num>      <num>      <int>      <int>      <num>       <num>
#>  1:     1  1.18770051 -0.4300296          1          1  1.1877005 -0.43002963
#>  2:     2  0.01308331  0.7811606          2          2  0.5130833  1.28116058
#>  3:     1  0.64365001  0.3784188          3          3  1.6436500  1.37841880
#>  4:     2 -2.48768926 -1.0124020          4          4 -0.9876893  0.48759798
#>  5:     1  0.93101913 -2.0656557          5          5  2.9310191 -0.06565571
#>  6:     2 -1.89955741  1.0928168          6          6  0.6004426  3.59281676
#>  7:     1  1.21015863 -1.7202851          7          7  4.2101586  1.27971492
#>  8:     2 -1.46457418 -0.3058085          8          8  2.0354258  3.19419149
#>  9:     1  0.75557357 -0.3731366          9          9  4.7555736  3.62686344
#> 10:     2  0.42274803  0.4004511         10         10  4.9227480  4.90045106