index.d.cts 772 B

1234567891011121314151617181920212223
  1. import { AllGeoJSON } from '@turf/helpers';
  2. /**
  3. * Takes input features and flips all of their coordinates from `[x, y]` to `[y, x]`.
  4. *
  5. * @function
  6. * @param {GeoJSON} geojson input features
  7. * @param {Object} [options={}] Optional parameters
  8. * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)
  9. * @returns {GeoJSON} a feature or set of features of the same type as `input` with flipped coordinates
  10. * @example
  11. * var serbia = turf.point([20.566406, 43.421008]);
  12. *
  13. * var saudiArabia = turf.flip(serbia);
  14. *
  15. * //addToMap
  16. * var addToMap = [serbia, saudiArabia];
  17. */
  18. declare function flip<T extends AllGeoJSON>(geojson: T, options?: {
  19. mutate?: boolean;
  20. }): T;
  21. export { flip as default, flip };