D3 learning: Map Projection Method in 12 in D3.js, d3d3. js
Special thanks: 1. The D3API Chinese description of [Zhang tianxu] has been referenced on the official website;
2. The course series provided by [Shantou Hua] On ourd3js.com gave us at least one direction for these newcomers.
I have to say that learning new technologies abroad is really a very difficult process.
When I learned how to draw a map with D3, A friend suggested that I take a look at the projection instructions. Therefore, I had to translate the information based on my skills in English, for reference only:
Link: https://github.com/mbostock/d3/wiki/Geo-Projections#albers
D3 provides a total of 12 map projection methods (each of which indicates that the blue font behind is the hyperlink of the example), as follows:
# D3.geo. albert Susa () 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. translation: The ambers projection is a composite projection designed to display Alaska and Hawaii next to this graph using four ambers projections, even though the isoplot is used, it scaled the State of Alaska by 0.35 times. Although the state of Hawaii is still in the same proportion, it shifted to 48 degrees (no distance data was found, but Hawaii did move east ). Chambers projection does not support rotation and center setting.
# D3.geo. azimuthalrentarea () The azimuthal equal-area projection is also suitable for choropleths. A polar aspect of this projection is used for the United Nations logo. the area azimuth projection is also suitable for the isoplot. The Polar Direction of this projection is used as the United Nations icon.
# 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. equidistance azimuth projection the equidistance azimuth projection stores the center of the projection. The Arc distance from any point on the projection to the center of the projection is proportional. Therefore, circular projection is projected around the center of the projection on a cartesian plane in a circle. This can be used to visualize the data from the reference point, such as commuting distance.
# D3.geo. conicConformal () Lambert's conformal conic projection projects the globe conformally onto a cone. cone-shaped projection the cone-shaped projection of lanbert projects the Earth on 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. cone-shaped projection. parallel line ([latitude and longitude array]) If a parallel line is specified, the standard parallelism of the projection is changed to an array of two elements expressed in latitude and longitude (unit: degree) and the projection is returned. If no parallel line is specified, the current projection is returned.
# D3.geo. conic1_area () The Albers projection, as an equal-area projection, is recommended for choropleths as it preserves the relative areas of geographic features. cone and other area projection Chambers projection, as an equal area projection, is recommended as an equivalent line chart because it retains the geographical characteristics of the relative area.
# Conic1_area. parallels ([parallels]) If parallels is specified, sets the Albers projection's standard parallels to the specified two-elementarray of latitudes (in degrees) and returns the projection. if parallels is not specified, returns the current parallels. to minimize distortion, the parallels shocould be chosen to surround the projection's center. cone and other area projection. parallel line ([latitude and longitude array]) If a parallel line is specified, set the standard parallelism of The ambers projection to take the latitude and longitude ( Unit: Degree) indicates the array of two elements and returns the projection. If no parallel line is specified, the current projection is returned. To reduce distortion, parallel lines should be arranged around the projection center.
# D3.geo. conicEquidistant () conical offset projection
# 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. cone offset projection. parallel lines (arrays) if parallel lines are specified, set the standard parallelism of The ambers projection to an array of two elements expressed in latitude and longitude (unit: degree) and return the projection. If no parallel line is specified, the current projection is returned.
# 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. equal rectangular projection equal rectangular projection, or prat square projection (which seems to be called by France), is the simplest possible geographic projection: marking Function (proportional function, which is interpreted on the internet, I don't know what it means ). It is neither area nor shape, but sometimes used for raster data. This website is an example of projection using equal rectangles.
# D3.geo. gnomonic () The gnomonic projection is an azimuthal projection that projects great circles as straight lines. see the interactive gnomonic for an example. ball center projection the ball center projection is a type of azimuth projection, which continuously projects a huge circle. This website is an example (you can imagine the feeling of viewing Earth maps from the center of the globe ).
# 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. mokto projection spherical mokto projection is the most commonly used in ing tiled data. For example, mokto projection displays a grid, such as http: // bl. Bytes.
# D3.geo. orthographic () The orthographic projection is an azimuthal projection suitable for displaying a single hemistion; 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. normal projection is also a type of azimuth projection, which is suitable for displaying a hemisphere: An infinite angle.
# 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. the polar projection is the azimuth projection of another angle. Its angle of view is equivalent to standing inside the Earth's surface (opposite to the ball center projection), so it is often used in astronomical graphs.
# D3.geo. transverseMercator () The transverse Mercator projection. Horizontal Mercato projection is a horizontal Mercato projection.
Note: because the original page references images drawn from D3, you cannot reference paths to view images ~