Google Map以及VirtualEarth等web gis都采用一种特殊的投影坐标系EPSG:900913,其实这个900913并不是EPSG分配的编号,而是设计Google Map的工程师自己选定的一个编号。该投影坐标系一开始不被EPSG组织承认(EPSG认为这个坐标系的参数设定非常不符合地理科学),后来因为使用的人越来越多,不得已承认了,但分配了一个别的编号epsg:3785而不是900913。但是大多数程序员不知道,还一直使用900913,呵呵。
关于epsg:3785投影坐标系的详细参数如下:(参考 http://spatialreference.org/ref/epsg/3785/)
+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
上面这组参数是用于PROJ4(一个著名的地理投影变换开源库)的,我用以上参数以及从中国国家测绘局下载的中国地图数据和Google Map对照了一下发现x坐标(经度)没有差异,但是y坐标有较大的差异。后来在下述网页http://proj.maptools.org/faq.html的最后一个问题上发现需要一个额外的参数:
The coordinate system definition for Virtual Earth Mercator is as follows, which uses a sphere as the earth model for the mercator projection.
+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +no_defs
But, if you do something like:
cs2cs +proj=latlong +datum=WGS84 +to +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +no_defs
to convert between WGS84 and mercator on the sphere there will be substantial shifts in the Y mercator coordinates. This is because internally cs2cs is having to adjust the lat/long coordinates from being on the sphere to being on the WGS84 datum which has a quite differently shaped ellipsoid.
In this case, and many other cases using spherical projections, the desired approach is to actually treat the lat/long locations on the sphere as if they were on WGS84 without any adjustments when using them for converting to other coordinate systems. The solution is to "trick" PROJ.4 into applying no change to the lat/long values when going to (and through) WGS84. This can be accomplished by asking PROJ to use a null grid shift file for switching from your spherical lat/long coordinates to WGS84.
cs2cs +proj=latlong +datum=WGS84
+to +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs
Note the strategic addition of +nadgrids=@null to the spherical projection definition.
Similar issues apply with many other datasets distributed with projections based on a spherical earth model - such as many NASA datasets, and also (I think) the Google Maps mercator projection.
原来缺少+nadgrids=@null参数用来避免sphere lat/long调节就可以了,最终的PROJ4参数如下:
+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +nagrids=@null +no_defs
这回数据就非常符合Google Map了。
分享到:
相关推荐
GIS地图辅助工具,最流行的坐标转换算法,内涵dll、.h和lib文件,可内嵌unity直接开发,也可以内嵌c++做二次封装
maven依赖 <groupId>io.jeo <artifactId>proj4j <version>0.1.1 </dependency>
PDF Manual proj.pdf https://proj.org/download.html 手册文档
Proj4js实现客户端坐标转换 从GPS坐标系 转换 google坐标系统
基于开源的proj4实现的wgs84到北京54的坐标转换,适用于x86平台,包换源码及开源库。
proj.4坐标转换库说明书,proj.4坐标转换库说明书,proj.4坐标转换库说明书。
基于Proj_4的空间坐标转换_盖森——空间坐标转换
坐标系转换proj库源码
外国著名 地理信息转换开源项目 projnet 完整搬砖 支持各种投影的转换
proj4 javascript投影坐标转换 已测试 可用 准确proj4 javascript投影
如果需要地理坐标 转换 投影做 可以下载这个库,java 资源很少,大部分都是 C语言需要编译
详细解释坐标转换原理,里面包含源码下载地址!能提供各种地方坐标转换
proj4js web坐标转换js库 。
范例使用SuperMap iClient 7C for JavaScript开发模式,通过proj4对SuperMap 不支持或者用户自定义的投影进行投影转换。一般通过GPS采集到的坐标是经纬度坐标,而地图是投影坐标系,就可以用该方法转换。虽然转换...
PROJ PROJ是一种通用坐标转换软件,可将坐标从一个坐标参考系统(CRS)转换为另一个坐标参考系统。 这包括制图投影以及大地测量转换。 F PROJ PROJ是一种通用坐标转换软件,可将坐标从一个坐标参考系统(CRS)转换为...
不需要七参数,不需要同名点,只需根据坐标系的部分已知参数,就可以实现坐标系直接的转换
一个开源的坐标系转换软件,包括常见坐标系与地图投影,不错的GIS开源软件。
最新投影库
PROJ4JS Proj4js是一个JavaScript库,用于将点坐标从一个坐标系转换到另一个坐标系,包括基准转换。 最初是 ( )和GCTCP C( )的端口,它是项目组的一部分。正在安装根据您的喜好npm install proj4bower install ...
Proj4js 一个JavaScript库,用于将点坐标从一个坐标系转换到另一个坐标系,包括基准变换