官术网_书友最值得收藏!

  • Mastering PostGIS
  • Dominik Mikiewicz Michal Mackiewicz Tomasz Nycz
  • 318字
  • 2021-07-02 22:52:27

General warning - mind the SRID!

Measurement functions come in two variants: planimetric and geodesic. The former operate on a flat surface, while the latter operate on a curved surface (sphere or spheroid). Planimetric functions are robust and computationally cheap (and thus fast to execute), but will yield accurate results if and only if the data is stored in a suitable Cartesian coordinate system. Examples include UTM, State Plane for the US, National Grid for the US and UK, DHDN for Germany, PUWG for Poland, S-JTSK for the Czech Republic, and so on. Geodesic functions, on the other hand, are suited for latitude-longitude coordinates, and consume more resources because of their more complicated formulas, but they work globally.

Trying to use planimetric functions on geodesic coordinates will not result in an error or warning, but will give meaningless results instead. For instance, the distance between Brasilia and Rio de Janeiro in Brazil or Kristiansand in Norway and Espoo in Finland is about 990 kilometers, but 9.1 decimal degrees in the first case and 16.79 decimal degrees in the second. This is because Earth is not flat, and the meridians converge towards the poles. The distance between two meridians is not uniform across the globe, so decimal degrees cannot be used as a reliable unit of measurement.

Attention should be paid to global flat coordinate systems, too. Web Mercator is probably the most notable example, as databases used primarily for web map tile rendering use it. Using planimetric measures in this coordinate system will result in exaggerated results--the closer to the poles, the bigger the distortion. For example, the area of Spain calculated using geodesic function is 507,000 square kilometers, but with Web Mercator it is 873,000 square kilometers (72 percent bigger), and the measurement of Sweden's area is 446,000 square kilometers with the geodesic function and more than 2 million square kilometers with Web Mercator (480 percent distortion!).

主站蜘蛛池模板: 邯郸县| 成都市| 汝城县| 阜阳市| 赤水市| 武威市| 灵宝市| 南召县| 壤塘县| 遂川县| 台中市| 临沭县| 潞城市| 温州市| 习水县| 康乐县| 彩票| 右玉县| 永年县| 湘阴县| 兴安县| 商丘市| 醴陵市| 荃湾区| 清河县| 绥棱县| 东山县| 宁陵县| 柯坪县| 剑阁县| 永昌县| 东源县| 巩义市| 保定市| 万安县| 临邑县| 武邑县| 五指山市| 宿松县| 遂平县| 贡嘎县|