Basic function to create a 'world file' as used by various non-geo image formats
Reformat to world vector.
geo_world0(px, ul, sh = c(0, 0))
geotransform_to_world(x)
pixel resolution (XY, Y-negative)
grid offset, top-left corner
affine shear (XY)
geotransform parameters, as per geo_transform0()
vector of parameters xres, yskew, xskew, yres, xmin, ymax
world vector, as per geo_world0()
Note that xmin/xmax are centre_of_cell (of top-left cell) unlike the geotransform which is top-left corner_of_cell. The parameters are otherwise the same, but in a different order.
geo_world0(px = c(1, -1), ul = c(0, 0))
#> xres yskew xskew yres xmin ymax
#> 1.0 0.0 0.0 -1.0 0.5 -0.5
(gt <- geo_transform0(px = c(1, -1), ul = c(0, 0)))
#> xmin xres yskew ymax xskew yres
#> 0 1 0 0 0 -1
wf <- geotransform_to_world(gt)
world_to_geotransform(wf)
#> xmin xres yskew ymax xskew yres
#> 0 1 0 0 0 -1