turf README

The project's README from github.com/Turfjs/turf. As one markdown file: README.md.

turf

GitHub Actions Status Version Badge Gitter chat Backers on Open Collective Sponsors on Open Collective Coverage Status

A modular geospatial engine written in JavaScript

Turf is a JavaScript library for spatial analysis. It includes traditional spatial operations, helper functions for creating GeoJSON data, and data classification and statistics tools. Turf can be added to your website as a client-side module, or you can run Turf server-side with Node.js (see below).

Getting Started

Read our getting started guide to begin working with Turf.

Or explore the Turf API and examples at turfjs.org.

Runtime support

Turf is currently published to work with any reasonably modern Javascript runtime.

Node is a first class citizen, and we recommend using an Active or Maintenance LTS release.

Other runtimes, such as Deno or Bun, are not officially supported. We would be very interested to hear your experiences though.

When bundling Turf for the browser, ensure your build setup transpiles and polyfills Turf along with all of its transitive dependencies to match your target browsers.

Browser support

@turf/turf includes a browser bundle that combines, transpiles, and minifies all Turf modules into a single JavaScript file. We periodically update our minimum browser targets using Browserslist's default preset.

Contributors

This project exists thanks to all the people who contribute. If you are interested in helping, check out the Contributing Guide.

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

turf (Turfjs/turf)

Searching Database…

10.5K ·GitHub
这是做什么的?Turf 是一个面向 JavaScript 和 TypeScript 的模块化地理空间引擎——一个处理 GeoJSON 数据、用于空间分析的库。
它是加到我代码里的库,还是要运行的应用?它是一个本身没有界面的库:可以作为客户端模块加到网站上,也可以在服务端用 Node.js 运行。
我该怎么上手?先从 npm 安装 @turf/turf 包,然后按照入门指南操作,再到 turfjs.org 浏览带示例的 API 文档。
它能在哪些 JavaScript 运行环境上跑?任何比较新的 JS 运行环境都行——Node 是一等公民(请使用处于 Active 或 Maintenance 状态的 LTS 版本)。Deno 和 Bun 不在官方支持范围内。
把 Turf 打包到浏览器端有什么坑?有——构建时必须把 Turf 及其所有传递依赖一起转译并加上 polyfill,以适配你的目标浏览器,否则老浏览器可能无法运行。
它在浏览器里也能用吗,还是只能在 Node 上跑?两者都可以。@turf/turf 包自带一个预构建的浏览器 bundle——所有模块合并、转译并压缩成一个 JavaScript 文件。
它包含哪些空间处理工具?传统的空间运算、用于创建 GeoJSON 数据的辅助函数,以及数据分类和统计工具。
Turf 号称模块化,实际是什么意思?Turf 是拆成许多按函数划分的小模块来开发的;@turf/turf 包把它们组合在一起,它的浏览器构建会把每个模块编译成一个压缩后的文件。
Turf 能画地图吗,还是只负责算数据?它只负责计算:空间运算、生成 GeoJSON 和做统计。README 里没有提到任何渲染或界面功能,所以可视化要靠你用来展示结果的地图工具。
这个项目还在积极维护吗?是的——它从 2013 年开发至今,在 GitHub 上有一万多个 star,并使用自动化的 CI 和发布流程。
Creator
Turfjs
Size
57.6 MB
Stars
10.5K
Age
13y
Commits · 90 Days