# transformTranslate

Moves any geojson Feature or Geometry of a specified distance along a Rhumb Line on the provided direction angle.


参数 类型 描述
geojson GeoJSON object to be translated
distance number length of the motion; negative values determine motion in opposite direction
direction number of the motion; angle from North in decimal degrees, positive clockwise
options Object 可选参数:见下文


属性 类型 默认值 描述
units string kilometers in which
zTranslation number 0 length of the vertical motion, same unit of distance
mutate boolean false 允许修改GeoJSON输入(如果为真,性能将显著提高)


GeoJSON - the translated GeoJSON object


// 注意:polygon首尾坐标要一致
var poly = turf.polygon([[[0,29],[3.5,29],[2.5,32],[0,29]]]);
var translatedPoly = turf.transformTranslate(poly, 100, 35);
Last Updated: 6/23/2023, 10:33:35 PM