[Oracle Spatial] 中Google Map对应坐标体系

博客首页 » Oracle Spatial 中Google Map对应坐标体系

发布于 08 Jun 2014 03:34
标签 blog
项目需要把Google Map映射到Oracle Spatial中。一开始以为Google Map是相当精确的,直到看到了这一段Oracle文档。

这段文档说明,Google Map使用的是一个标准的球体来表述坐标体系,而Oracle WGS 84/EPSG 默认描述地球是一个椭圆形,所以如此计算会产生偏差。明明是老牌的地图厂商的解决方案更精确,不过还是要向Google低头啊。
http://docs.oracle.com/cd/E11882_01/appdev.112/e11830/sdo_cs_concepts.htm#CIHJFBFG
http://docs.oracle.com/cd/E16338_01/appdev.112/b72087/sdo_cs_concepts.htm#CIHJFBFG

6.12 Google Maps Considerations

Google Maps uses spherical math in its projections, as opposed to the ellipsoidal math used by Oracle Spatial. This difference can lead to inconsistencies in applications, such as when overlaying a map based on Google Maps with a map based on an Oracle Spatial ellipsoidal projection. For example, an Oracle Spatial transformation from the ellipsoidal SRID 8307 to the spherical SRID 3785 accounts, by default, for the different ellipsoidal shapes, whereas Google Maps does not consider ellipsoidal shapes.

If you want Oracle Spatial to accommodate the Google Maps results, consider the following options:

Use the spherical SRID 4055 instead of the ellipsoidal SRID 8307. This may be the simplest approach; however, if you need to accommodate SRID 8307-based data (such as from a third-party tool) as if it were spherical, you must use another option.

Use SRID 3857 instead of SRID 3785. This more convenient than the next two options, because using SRID 3857 does not require that you declare an EPSG rule or that you specify the USE_SPHERICAL use case name in order to produce Google-compatible results.

Declare an EPSG rule between the ellipsoidal and spherical coordinate systems. For example, declare an EPSG rule between SRIDs 8307 and 3785, ignoring the ellipsoidal shape of SRID 8307, as in the following example:

CALL sdo_cs.create_pref_concatenated_op(
302,
'CONCATENATED OPERATION',
TFM_PLAN(SDO_TFM_CHAIN(8307, 1000000000, 4055, 19847, 3785)),
NULL);
In this example, operation 1000000000 represents no-operation, causing the datum transformation between ellipsoid and sphere to be ignored.

With this approach, you must declare a rule for each desired SRID pair (ellipsoidal and spherical).

Specify a use case name of USE_SPHERICAL with the SDO_CS.TRANSFORM function or the SDO_CS.TRANSFORM_LAYER procedure, as in the following examples:

SELECT
SDO_CS.TRANSFORM(
sdo_geometry(
2001,
4326,
sdo_point_type(1, 1, null),
null,
null),
'USE_SPHERICAL',
3785)
FROM DUAL;

CALL SDO_CS.TRANSFORM_LAYER(
'source_geoms',
'GEOMETRY',
'GEO_CS_3785_SPHERICAL',
'USE_SPHERICAL',
3785);
If you specify a use_case parameter value of USE_SPHERICAL in such cases, the transformation defaults to using spherical math instead of ellipsoidal math, thereby accommodating Google Maps and some other third-party tools that use spherical math.

If you use this approach (specifying 'USE_SPHERICAL') but you have also declared an EPSG rule requiring that ellipsoidal math be used in transformations between two specified SRIDs, then the declared EPSG rule takes precedence and ellipsoidal math is used for transformations between those two SRIDs.


本页面的文字允许在知识共享 署名-相同方式共享 3.0协议和GNU自由文档许可证下修改和再使用,仅有一个特殊要求,请用链接方式注明文章引用出处及作者。请协助维护作者合法权益。


系列文章

文章列表

  • Oracle Spatial 中Google Map对应坐标体系

这篇文章对你有帮助吗,投个票吧?

rating: 0+x

留下你的评论

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License