Nyall Dawson deba02b162 [feature][expressions] Add new "scale" function for scaling a geometry
Just like the 'rotate' function, 'scale' accepts an optional point
to apply the scaling from. If not specified, scaling is done
from the centre of the geometry's bounding box.
2021-10-23 05:18:09 +10:00

14 lines
910 B
Plaintext

{
"name": "scale",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns a scaled version of a geometry. Calculations are in the Spatial Reference System of this geometry.",
"arguments": [ {"arg":"geometry","description":"a geometry"},
{"arg":"x_scale","description":"x-axis scaling factor"},
{"arg":"y_scale","description":"y-axis scaling factor"},
{"arg":"center", "optional":true,"description":"scaling center point. If not specified, the center of the geometry's bounding box is used."}
],
"examples": [ { "expression":"scale($geometry, 2, 0.5, make_point(4, 5))", "returns":"geometry scaled twice horizontally and halved vertically, around the (4, 5) point"},
{ "expression":"scale($geometry, 2, 0.5)", "returns":"geometry twice horizontally and halved vertically, around the center of its bounding box"}]
}