在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Turfjs/turf开源软件地址:https://github.com/Turfjs/turf开源编程语言:JavaScript 69.6%开源软件介绍: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 plugin, or you can run Turf server-side with Node.js (see below). InstallationIn Node.js# get all of turf
npm install @turf/turf
# or get individual packages
npm install @turf/helpers
npm install @turf/buffer In browserDownload the minified file, and include it in a script tag. This will expose a global variable named <script src="turf.min.js" charset="utf-8"></script> You can also include it directly from a CDN: <script src="https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js"></script> TypeScriptTypeScript definitions are packaged with each module. No DefinitelyTyped packages required. Other languagesPorts of Turf.js are available in:
Data in TurfTurf uses GeoJSON for all geographic data. Turf expects the data to be standard WGS84 longitude, latitude coordinates. Check out geojson.io for a tool to easily create this data.
Most Turf functions work with GeoJSON features. These are pieces of data that represent a collection of properties (ie: population, elevation, zipcode, etc.) along with a geometry. GeoJSON has several geometry types such as:
Turf provides a few geometry functions of its own. These are nothing more than simple (and optional) wrappers that output plain old GeoJSON. For example, these two methods of creating a point are functionally equivalent: // Note order: longitude, latitude.
var point1 = turf.point([-73.988214, 40.749128]);
var point2 = {
type: 'Feature',
geometry: {
type: 'Point',
// Note order: longitude, latitude.
coordinates: [-73.988214, 40.749128]
},
properties: {}
}; Browser supportTurf packages are compiled to target ES2017. However, the browser version of @turf/turf is transpiled to also include support for IE11. If you are using these packages and need to target IE11, please transpile the following packages as part of your build:
ContributorsThis project exists thanks to all the people who contribute. If you are interested in helping, check out the Contributing Guide. BackersThank you to all our backers! |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论