# transformScale

Scale a GeoJSON from a given point by a factor of scaling (ex: factor=2 would make the GeoJSON 200% larger). If a FeatureCollection is provided, the origin point will be calculated based on each individual Feature.


参数 类型 描述
geojson GeoJSON GeoJSON to be scaled
factor number of scaling, positive or negative values greater than 0
options Object Optional parameters: see below


属性 类型 默认值 描述
origin (string Coord) centroid
mutate boolean | false allows GeoJSON input to be mutated (significant performance increase if true)


GeoJSON - scaled GeoJSON


var poly = turf.polygon([[[0,29],[3.5,29],[2.5,32],[0,29]]]);
var scaledPoly = turf.transformScale(poly, 3);
Last Updated: 1/19/2021, 10:59:20 AM