编程语言/地图:修订间差异
来自康健生活
| (未显示同一用户的10个中间版本) | |||
| 第34行: | 第34行: | ||
=== 赤道 === | === 赤道 === | ||
=== 本初子午线 === | === 本初子午线 === | ||
子午线总长约为 40008km。 | |||
=== 地球半径 === | |||
地球半径约为 6378137m。 | |||
=== 扁率 === | |||
==== 参考椭球 ==== | |||
=== 赤道 === | |||
赤道周长为 <math>2\pi6378137</math> = 40,075,016.0019724 | |||
赤道分为了 360 ,1 为 40,075,016.0019724/360=111,319.4888943678m≈111km | |||
=== NullIsland === | === NullIsland === | ||
Natural Earth GIS Data 在 2011 年提出一种观点,即 | Natural Earth GIS Data 在 2011 年提出一种观点,即 0° 经线与 0° 纬线的交汇处为 1m * 1m 的虚构岛屿。 | ||
=== 经纬度小数点与米制换算 === | |||
==== 经度米制换算 ==== | |||
{| class="wikitable" | |||
|- | |||
! 经度 !! 米 | |||
|- | |||
| 0.00001° || 1m | |||
|- | |||
| 0.0001° || 10m | |||
|- | |||
| 0.1° || 10,000m | |||
|- | |||
| 1° || 100,000m | |||
|} | |||
==== 纬度米制换算 ==== | |||
1 度为 60 分,1 分为 60 秒,推导为 1° = 60′,0.1° = 6′,假设纬度为 x,公式为 <math>111\cos x</math>。所以 1° 为 111km,1' 约为 1.85km,1" 约为 30.9m。 | |||
{| class="wikitable" | |||
|- | |||
! 纬度 !! 米 | |||
|- | |||
| 0.00001° || 1.1m | |||
|- | |||
| 0.0001° || 11m | |||
|- | |||
| 0.001° || 111m | |||
|- | |||
| 0.01° || 1113m | |||
|- | |||
| 0.1° || 11132m | |||
|- | |||
| 1° || 111000m | |||
|} | |||
=== 影像瓦片级别对应精度(天地图) === | |||
=== 高程级别对应瓦片精度 === | |||
== 基本方法 == | == 基本方法 == | ||
| 第70行: | 第124行: | ||
==== 等距圆柱投影 ==== | ==== 等距圆柱投影 ==== | ||
图示: | |||
[[文件:等距圆柱投影-1.png|700px|替代=等距圆柱投影-1|等距圆柱投影-1]] | |||
<syntaxhighlight lang="html5"> | |||
<script src="https://d3js.org/d3.v7.min.js"></script> | |||
<script src="https://lib.baomitu.com/topojson/3.0.2/topojson.min.js"></script> | |||
<script> | |||
const width = 1000; | |||
const height = 500; | |||
const svg = d3.select('body') | |||
.append('svg') | |||
.attr('width', width) | |||
.attr('height', height); | |||
const path = d3.geoPath().projection( | |||
d3.geoEquirectangular() | |||
.translate([width / 2, height / 2]) | |||
); | |||
d3.json('https://gist.githubusercontent.com/whatsthebeef/6361969/raw/2717d4d1635bccd141001ffb1dacccaece7f6d52/world.json').then(function(root) { | |||
const countries = topojson.feature(root, root.objects.countries); | |||
const land = topojson.feature(root, root.objects.land); | |||
svg.append('g').selectAll('path') | |||
.data(countries.features.concat(land.features)) | |||
.enter() | |||
.append('path') | |||
.attr('class', 'country') | |||
.style('fill', function(d, i) { | |||
return d3.schemeCategory10[i % 10]; | |||
}) | |||
.attr('d', path); | |||
}); | |||
</script></syntaxhighlight> | |||
==== 等积圆柱投影 ==== | ==== 等积圆柱投影 ==== | ||