Skip to content

EPSG4326到底是地理坐标还是投影坐标 #6

@lyj289

Description

@lyj289

EPSG全称 European Petroleum Survey Group,欧洲石油调查组织。

我们经常提到的EPSG Code,其实不是指上面的组织,而应该是 EPSG Geodetic Parameter Dataset中定义的某一项。

EPSG Geodetic Parameter Dataset官网是这样描述的:

The IOGP's EPSG Geodetic Parameter Dataset is a collection of definitions of coordinate reference systems and coordinate transformations which may be global, regional, national or local in application

Wiki是这样描述的:

EPSG Geodetic Parameter Dataset (also EPSG registry) is a public registry of geodetic datums, spatial reference systems, Earth ellipsoids, coordinate transformations and related units of measurement. Each entity is assigned an EPSG code between 1024-32767, along with a standard machine-readable well-known text (WKT) representation.

意思呢,EPSG Geodetic Parameter Dataset是一个数据库,包含了CRS (coordinate reference systems)的所有定义,这里面既有地理坐标系统,如EPSG:4326,也有投影坐标系统,如EPSG:3857,亦或还有datum, 比如 6214, 北京54datum

先列一些我们常听到的:

EPSG:4326是地理坐标还是投影坐标?

从定义看,EPSG:4326 表示地理坐标,即WGS84,但问题是为什么Leaflet和Openlayers中都提供了Projection: 'EPSG:4326'的配置,来展示地图,这种情况下不就是将数据以4326进行投影么?

其实,是没有办法在二维平面上来可视化WGS84坐标的,我们常说的像Leaflet和Openlayers内部都是用一种简单圆柱投影(equirectangular (EPSG:54001))来进行处理的,其实也是一种投影,就是将经纬度当作普通点,不做任何数学转换,直接绘制在二维平面上,也可以说是经纬度直投。

大部分时候, Web 地图在存储数据的时候都是使用的 WGS84 的坐标系统(在有些系统中,这个规格被称之为「未投影」的数据)并且在可视化的时候使用EPSG:3857 (Pseudo-Mercator)。但是有些时候,一个地图开发者可能会说他们想看一下 WGS84 的坐标系统(或者将这个描述为 EPSG:4326)。如上面所说, WGS84 是一个未投影的数据 — 在二维平面上是无法展现这个坐标系统的。如果有人说他们想看 WGS84 的数据,正确的做法是只能看到 Plate-Carrée 投影的数据 — Plate-Carrée 本质上就是将角度平铺在平面上。

There is no way to visualize the WGS84 coordinate system on a two-dimensional plane (map), so most software programs project these coordinates using an equirectangular projection (Plate-Carrée) (Esri uses EPSG:54001)

EPSG:4326 vs EPSG:3857

天地图提供了两种投影方式:Web Mercator 和经纬度投影, 效果如下:
image
Web Mercator 1级,4个瓦片

image
经纬度投影 1级,2个瓦片

经纬度投影方式,效果不是很好,整体显得有些扁,实际垂直交叉街道会显得不太垂直。

同时,在定义Tile的0级时,也有些不同。

Web Mercator 0级,只有一个Tile, 一般大小 为256 * 256,经纬度投影 0级,有两个Tile, 512 * 256, 如上图,这是一个明显差别。
image

Web Mercator

image image

经纬度投影

参考

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions