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 -2.26083472 -1.1376084          1          1 -2.260835 -1.137608
#>  2:     2  0.94365484  1.2942131          2          2  1.443655  1.794213
#>  3:     1  0.37716224  1.6626269          3          3  1.377162  2.662627
#>  4:     2  0.33581674  0.1502654          4          4  1.835817  1.650265
#>  5:     1  0.12472951  0.2937739          5          5  2.124730  2.293774
#>  6:     2 -0.08986899 -1.0288914          6          6  2.410131  1.471109
#>  7:     1 -0.38854237  0.3402909          7          7  2.611458  3.340291
#>  8:     2 -1.47164718  1.1854245          8          8  2.028353  4.685424
#>  9:     1 -0.57802680 -0.2015273          9          9  3.421973  3.798473
#> 10:     2 -1.85267588 -0.5780507         10         10  2.647324  3.921949