GIS
Posted mol1995
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了GIS相关的知识,希望对你有一定的参考价值。
https://github.com/Turfjs/turf/tree/master/packages
https://github.com/Turfjs/turf/blob/master/packages/turf-destination/index.ts //经纬度计算的算法,js方法名就是turf-destination
http://turfjs.org/docs/#destination //各种空间计算方法
const coordinates1 = getCoord(origin);
const longitude1 = degreesToRadians(coordinates1[0]);
const latitude1 = degreesToRadians(coordinates1[1]);
const bearingRad = degreesToRadians(bearing);
const radians = lengthToRadians(distance, options.units);
// Main
const latitude2 = Math.asin(Math.sin(latitude1) * Math.cos(radians) +
Math.cos(latitude1) * Math.sin(radians) * Math.cos(bearingRad));
const longitude2 = longitude1 + Math.atan2(Math.sin(bearingRad) * Math.sin(radians) * Math.cos(latitude1),
Math.cos(radians) - Math.sin(latitude1) * Math.sin(latitude2));
const lng = radiansToDegrees(longitude2);
const lat = radiansToDegrees(latitude2);
return point([lng, lat], options.properties);
以上是关于GIS的主要内容,如果未能解决你的问题,请参考以下文章