# transformTranslate
Moves any geojson Feature or Geometry of a specified distance along a Rhumb Line on the provided direction angle.
在给定的方向角上沿沿恒向线移动指定距离的任何geojsonFeature
或几何图形。
参数
参数 | 类型 | 描述 |
---|---|---|
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 | 可选参数:见下文 |
options选项
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
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);