1. 程式人生 > >D3學習之:D3.js中的12中地圖投影方式

D3學習之:D3.js中的12中地圖投影方式

特別感謝:1.【張天旭】的D3API漢化說明,已被引用到官方網站;

2.【饅頭華華】提供的ourd3js.com上提供的學習系列教程,讓我們這些新人起碼有了一個方向。

不得不說,學習國外的新技術真的是一個很艱苦的過程。

在學習D3繪製地圖的過程中,有朋友建議看一下其中投影的說明比較好,於是,憑藉我這半吊子不到的英文水平,大致給翻譯了下來,僅供參考:

D3中一共提供了12種地圖投影方式(每一種說明後面的藍色字型是例子的超連結),分別如下:

# d3.geo.albersUsa()

The Albers USA projection is a composite projection of four Albers projections 
designed to display the forty-eight lower United States alongside Alaska and Hawaii.
 Although intended for choropleths, it scales the area of Alaska by a factor of 0.35x (a lie factor of 3); 
 Hawaii is shown at the same scale as the lower forty-eight.

The Albers USA projection does not support rotation or centering.

譯:阿伯斯投影
阿伯斯投影是被設計用4個阿伯斯投影把美國的阿拉斯加州和夏威夷州顯示到本圖旁邊的複合投影,儘管用了等值線圖,它把阿拉斯加州縮放了0.35倍,
夏威夷州雖然還是一樣的比例,但偏移了48度(沒查過距離資料,不過夏威夷確實是向東移動了)。

阿伯斯投影不支援旋轉和設定中心。
# d3.geo.azimuthalEqualArea()

The azimuthal equal-area projection is also suitable for choropleths.
 A polar aspect of this projection is used for the United Nations logo.
 
等面積方位投影
等面積方位投影也適合等值線圖,這個投影的極座標方向被用來作為聯合國圖示。
# d3.geo.azimuthalEquidistant()
The azimuthal equidistant projection preserves distances from the projection’s center:
the distance from any projected point to the projection’s center is proportional to the great arc distance.
Thus, circles around the projection’s center are projected to circles on the Cartesian plane.
This can be useful for visualizing distances relative to a point of reference, such as commute distances.

等距方位投影
等距方位投影儲存著投影中心,從投影上的任何點到投影中心的弧線距離都是成比例的。因此,圓形的投影圍繞著投影中心被投影在用圓圈住的一個笛卡爾平面上。
這可以用於將距離參考點的資料視覺化顯示,比如通勤距離。
# d3.geo.conicConformal()
Lambert’s conformal conic projection projects the globe conformally onto a cone.
圓錐共形投影
蘭伯特的圓錐共形投影將地球投影在一個圓錐上。

# conicConformal.parallels([parallels])
If parallels is specified, sets the projection’s standard parallels to the specified two-element array of latitudes (in degrees) and returns the projection.
 If parallels is not specified, returns the current parallels.
 圓錐共形投影.平行線([經緯度陣列])
 如果指定平行線,使投影的標準平行變為以經緯度(單位:度)表示的兩個元素的陣列並返回投影。如果不指定平行線,返回當前的投影。
# d3.geo.conicEqualArea()
The Albers projection, as an equal-area projection, is recommended for choropleths as it preserves the relative areas of geographic features.
圓錐等面積投影
阿伯斯投影,作為一種等面積投影,被推薦作為等值線圖,因為它保留了相對區域的地理特徵。
# conicEqualArea.parallels([parallels])
If parallels is specified, sets the Albers projection’s standard parallels to the specified two-element
array of latitudes (in degrees) and returns the projection. If parallels is not specified, returns the current parallels.
To minimize distortion, the parallels should be chosen to surround the projection’s center.
圓錐等面積投影.平行線([經緯度陣列])
如果指定平行線,設定阿伯斯投影的標準平行變為以經緯度(單位:度)表示的兩個元素的陣列並返回投影。如果不指定平行線,返回當前的投影。
為了減少失真,平行線應該選擇在投影中心周圍。
# d3.geo.conicEquidistant()
圓錐等距投影
# conicEquidistant.parallels([parallels])

If parallels is specified, sets the projection’s standard parallels to the specified two-element array of latitudes (in degrees) and returns the projection.
 If parallels is not specified, returns the current parallels.
 圓錐等距投影.平行線(陣列)
 如果指定平行線,設定阿伯斯投影的標準平行變為以經緯度(單位:度)表示的兩個元素的陣列並返回投影。如果不指定平行線,返回當前的投影。
# d3.geo.equirectangular()

The equirectangular, or plate carrée projection, is the simplest possible geographic projection: the identity function.
 It is neither equal-area nor conformal, but is sometimes used for raster data. See raster reprojection for an example;
 the source image uses the equirectangular projection.
 相等矩形投影
 相等矩形投影,或者叫普拉特方形投影(貌似這是法國的叫法),是最簡單可能的地理投影:標記功能(正比例函式,都是網上釋義,我也搞不清楚這裡的意思)。
 它既不等面積也不保持形狀,不過有時候用於柵格資料。這個網站是一個用相等矩形投影的例子。
# d3.geo.gnomonic()
The gnomonic projection is an azimuthal projection that projects great circles as straight lines. See the interactive gnomonic for an example.
球心投影
球心投影是一種方位投影,它連續不斷地投影一個巨大的包圍圈。這個網站就是一個例子(你可以想象一下從地球儀中心看地球地圖的感覺)。
# d3.geo.mercator()

The spherical Mercator projection is commonly used by tiled mapping libraries (such as OpenLayers and Leaflet).
For an example displaying raster tiles with the Mercator projection, see the d3.geo.tile plugin.
It is conformal; however, it introduces severe area distortion at world scale and thus is not recommended for choropleths.

墨卡託投影
球形的墨卡託投影在對映平鋪的資料時是最常用的,例如用墨卡託投影顯示柵格,例如http://bl.ocks.org/mbostock/4150951這個頁面,
它是正形的,然而,它將地圖上的許多地方進行了嚴重變形,因此,不建議使用等值線圖。
# d3.geo.orthographic()

The orthographic projection is an azimuthal projection suitable for displaying a single hemisphere;
the point of perspective is at infinity. See the animated world tour and interactive orthographic for examples.
 For a general perspective projection, see the satellite projection.
 正射投影
 正射投影也是一種方位投影,它適合顯示一個半球:角度無窮大。
# d3.geo.stereographic()

The stereographic projection is another perspective (azimuthal) projection. The point of perspective is on the surface of the sphere, looking in;
 it is thus commonly used for celestial charts. See the interactive stereographic for an example.
 極射赤平投影
 極射赤平投影是另一個角度的方位投影。它的視角相當於站在地球的表面向裡面看(跟球心投影相反),它因此被經常用於天體圖。
# d3.geo.transverseMercator()

The transverse Mercator projection.
橫向墨卡託投影
就是一個橫向的墨卡託投影。

注:由於原頁面引用的全是D3繪製的影象,所以無法路徑引用檢視圖片,你們懂的~