Scale the vertex values of geometric objects to a values range.
gt_scale(obj, range = NULL, fid = NULL, update = TRUE)
obj | [ |
---|---|
range | [ |
fid | [ |
update | [ |
geom
of the scaled obj
.
Other geometry tools:
gt_filter()
,
gt_locate()
,
gt_pull()
,
gt_reflect()
,
gt_rotate()
,
gt_skew()
,
gt_stretch()
,
gt_translate()
# rescale to values between -10 and 10 visualise(gtGeoms$polygon, linewidth = 3) newPoly <- gt_scale(obj = gtGeoms$polygon, update = FALSE, range = data.frame(x = c(-10, 10), y = c(-10, 10))) visualise(geom = newPoly, linecol = "green", new = FALSE) # rescale a single feature visualise(gtGeoms$polygon, linewidth = 3) newPoly <- gt_scale(obj = gtGeoms$polygon, update = FALSE, fid = 2, range = data.frame(x = c(-10, 10), y = c(-10, 10))) visualise(geom = newPoly, linecol = "green", new = FALSE)