flip
描述
🌐 Description
接受输入特性并将它们的所有坐标从 [x, y] 翻转到 [y, x]。
🌐 Takes input features and flips all of their coordinates from [x, y] to [y, x].
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| geojson | GeoJSON | 输入特性 |
| options? | Object | 可选参数 (默认 {}) |
| options.mutate? | boolean | 允许修改 GeoJSON 输入(如果为真,性能将显著提高)(默认 false) |
返回
🌐 Returns
GeoJSON 与 input 类型相同的一项或一组特性,但坐标已翻转
示例
🌐 Examples
var serbia = turf.point([20.566406, 43.421008]);
var saudiArabia = turf.flip(serbia);
安装
🌐 Installation
$ npm install @turf/flip
import { flip } from "@turf/flip";
const result = flip(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.flip(...);