index.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { AllGeoJSON, Position } from "@turf/helpers";
  2. /**
  3. * Converts a WGS84 GeoJSON object into Mercator (EPSG:900913) projection
  4. *
  5. * @name toMercator
  6. * @param {GeoJSON|Position} geojson WGS84 GeoJSON object
  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} Projected GeoJSON
  10. * @example
  11. * var pt = turf.point([-71,41]);
  12. * var converted = turf.toMercator(pt);
  13. *
  14. * //addToMap
  15. * var addToMap = [pt, converted];
  16. */
  17. export declare function toMercator<G = AllGeoJSON | Position>(geojson: G, options?: {
  18. mutate?: boolean;
  19. }): G;
  20. /**
  21. * Converts a Mercator (EPSG:900913) GeoJSON object into WGS84 projection
  22. *
  23. * @name toWgs84
  24. * @param {GeoJSON|Position} geojson Mercator GeoJSON object
  25. * @param {Object} [options] Optional parameters
  26. * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)
  27. * @returns {GeoJSON} Projected GeoJSON
  28. * @example
  29. * var pt = turf.point([-7903683.846322424, 5012341.663847514]);
  30. * var converted = turf.toWgs84(pt);
  31. *
  32. * //addToMap
  33. * var addToMap = [pt, converted];
  34. */
  35. export declare function toWgs84<G = AllGeoJSON | Position>(geojson: G, options?: {
  36. mutate?: boolean;
  37. }): G;