osgEarth的Rex引擎原理分析(三十五)osgEarth地球椭球体ellipsoid 大地基准面datum 地图投影Projection详解

2023-10-30

目标:(二十九)中的问题83

地球椭球体的中心为地心,形状为椭球体

大地基准面是适应某一区域的椭球体,球体中心不一定在地心

地图投影是球面和平面映射关系的方法

 

Horizontal Datum

A datum is a reference point (or set of points) against which geospatial measurements are made. The same location on earth can have different coordinates depending on which datum is in use. There are two classes of datum:

A horizontal datum measures positions on the earth. Since the earth is not a perfect sphere or even a perfect ellipsoid, particular datums are usually designed to approximate the shape of the earth in a particular region. Common datums include WGS84 and NAD83 in North America, and ETR89 in Europe.

Vertical Datum

A vertical datum measures elevation. There are several classes of vertical datum; osgEarth supports geodetic (based on an ellipsoid) and geoid (based on a sample set of elevation points around the planet).

osgEarth has the following vertical datums built in:

  • Geodetic - the default; osgEarth uses the Horizontal datum ellipsoid as a reference
  • EGM84 geoid
  • EGM96 geoid - commonly called MSL; used in DTED and KML
  • EGM2008 geoid

By default, SRS’s in osgEarth use a geodetic vertical datum; i.e., altitude is measured as “height above ellipsoid (HAE)”.

 

地理坐标系一般是指由经度、纬度和高度组成的坐标系,能够标示地球上的任何一个位置。前面提到了,不同地区可能会使用不同的参考椭球体,即使是使用相同的椭球体,也可能会为了让椭球体更好地吻合当地的大地水准面,而调整椭球体的方位,甚至大小。这就需要使用不同的大地测量系统(Geodetic datum)来标识。因此,对于地球上某一个位置来说,使用不同的测量系统,得到的坐标是不一样的。我们在处理地理数据时,必须先确认数据所用的测量系统。事实上,随着我们对地球形状测量的越来越精确,北美使用的 NAD83 基准和欧洲使用的 ETRS89 基准,与 WGS 84 基准是基本一致的,甚至我国的 CGCS2000 与WGS84之间的差异也是非常小的。但是差异非常小,不代表完全一致,以 NAD83 为例,因为它要保证北美地区的恒定,所以它与 WGS84 之间的差异在不断变化,对于美国大部分地区来说,每年有1-2cm的差异。

 

rex支持的投影见

osgEarth/SpatialReference.cpp
SpatialReference*
SpatialReference::create(const Key& key)
{
    // now try to resolve the horizontal SRS:
    osg::ref_ptr<SpatialReference> srs;

    // shortcut for spherical-mercator:
    if (key.horizLower == "spherical-mercator" || 
        key.horizLower == "epsg:900913"        || 
        key.horizLower == "epsg:3785"          || 
        key.horizLower == "epsg:102113")
    {
        // note the use of nadgrids=@null (see http://proj.maptools.org/faq.html)
        srs = createFromPROJ4(
            "+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 +towgs84=0,0,0,0,0,0,0 +wktext +no_defs",
            "Spherical Mercator" );
    }

    // ellipsoidal ("world") mercator:
    else 
        if (key.horizLower == "world-mercator" ||
            key.horizLower == "epsg:54004"     ||
            key.horizLower == "epsg:9804"      ||
            key.horizLower == "epsg:3832"      ||
            key.horizLower == "epsg:102100"    ||
            key.horizLower == "esri:102100"    || 
            key.horizLower == "osgeo:41001" )

    {
        srs = createFromPROJ4(
            "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs",
            "World Mercator" );
    }

    // common WGS84:
    else
        if (key.horizLower == "epsg:4326" ||
            key.horizLower == "wgs84")
    {
        srs = createFromPROJ4(
            "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
            "WGS84" );
    }

    // WGS84 Plate Carre:
    else if (key.horizLower == "plate-carre")
    {
        srs = createFromPROJ4(
            "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
            "WGS84" );

        srs->_is_plate_carre = true;
        srs->_is_geographic  = false;
    }

    // custom srs for the unified cube
    else if (key.horizLower == "unified-cube" )
    {
        srs = createCube();
    }

    else if (key.horizLower.find( "+" ) == 0 )
    {
        srs = createFromPROJ4( key.horiz, key.horiz );
    }
    else if (key.horizLower.find( "epsg:" )  == 0 ||
             key.horizLower.find( "osgeo:" ) == 0 )
    {
        srs = createFromPROJ4( std::string("+init=") + key.horizLower, key.horiz );
    }
    else if (key.horizLower.find( "projcs" ) == 0 || 
             key.horizLower.find( "geogcs" ) == 0 )
    {
        srs = createFromWKT( key.horiz, key.horiz );
    }
    else
    {
        // Try to set it from the user input.  This will handle things like CRS:84
        // createFromUserInput will actually handle all valid inputs from GDAL, so we might be able to
        // simplify this function and just call createFromUserInput.
        srs = createFromUserInput( key.horiz, key.horiz );
    }

    // bail out if no SRS exists by this point
    if ( srs == 0L )
    {
        return 0L;
    }

    // next, resolve the vertical SRS:
    if ( !key.vert.empty() && !ciEquals(key.vert, "geodetic") )
    {
        srs->_vdatum = VerticalDatum::get( key.vert );
        if ( !srs->_vdatum.valid() )
        {
            OE_WARN << LC << "Failed to locate vertical datum \"" << key.vert << "\"" << std::endl;
        }
    }

    srs->_key = key;

    return srs.release();
}

这里spherical-mercator"、epsg:900913、epsg:3785、epsg:3875、epsg:102113都是一致的,

3785.prj类似于web meator投影,为google map所采用的投影。

EPSG:3857 is a Spherical Mercator projection coordinate system popularized by web services such as Google and later OpenStreetMap.

history

    2007/08/06 - Christopher Schmidt of OpenLayers announces use of the number 900913 to describe the "Google Projection"
    2007/09/11 - Christopher Schmidt checks in OpenLayers/Layer/SphericalMercator.js with WKID 900913
    2003/06/25 (or earlier) - Google (or a user) begins using WKID 54004, either as EPSG:54004 or ESRI:54004
    2008/05/?? - EPSG updates mailing list that EPSG:3785 will be added to version 6.15
    2009/02/09 - EPSG changed EPSG:3785 to EPSG:3857
    2008/08/05 - Google Support thread on the use of Web Mercator in which it's noted (less technically) that the projection formerly used by Google Maps did not preserve azimuth at high latitudes.
     ?? - ESRI ArcGIS 10 changed the WKID for this projection from ESRI:102100 to EPSG:3857
    2010/09/15 - Noel Zinn from Hydrometrics gave a presentation at GIS in the Rockies on the mathematical uncertainty introduced by Web Mercator

 

 

待继续分析列表:

9、earth文件中都有哪些options((九)中问题)

10、如何根据earth文件options创建不同的地理信息引擎节点((九)中问题)

11、rex地理信息引擎的四梁八柱((九)中问题)

12、osgEarth::TerrainEngineNode中setMap方法作用((十二)中问题)

13、RexTerrainEngineNode中_mapFrame的作用((十二)中问题)

14、地形变形(Terrain morphing)((十二)中问题)

15、地球瓦片过期门限的含义((十二)中问题)

16、高分辨率优先的含义((十二)中问题)

17、OSGEARTH_DEBUG_NORMALS环境变量的作用((十二)中问题)

18、活跃瓦片寄存器的作用((十二)中问题)

19、资源释放器子节点的作用((十二)中问题)

20、共享几何图形池子节点的作用((十二)中问题)

21、分页瓦片加载器子节点的作用((十二)中问题)

22、分页瓦片卸载器子节点的作用((十二)中问题)

23、栅格化器子节点的作用((十二)中问题)

24、地形子节点的作用((十二)中问题)

25、绑定渲染器的作用((十二)中问题)

26、地图回调函数的作用((十二)中问题)

27、如何将地图图层添加到rex引擎中((十二)中问题)

28、选择信息的作用((十二)中问题)

29、瓦片包围盒修改回调函数的作用((十二)中问题)

30、刷新rex引擎((十二)中问题)

31、刷新边界作用((十二)中问题)

32、osgEarth::Metrics类的意义((十四)中问题)

33、请求合并队列_mergeQueue((十四)中问题)

34、分页瓦片加载器在更新遍历时对请求处理过程((十四)中问题)

35、分页瓦片加载器在更新遍历时对已处理请求裁剪过程((十四)中问题)

36、已处理的请求队列_requests((十四)中问题)

37、DatabasePager中的_fileRequestQueue和_httpRequestQueue((十六)中问题)

38、瓦片请求的生成到处理过程详解((十六)中问题)

39、瓦片节点TileNode的创建过程((十七)中问题)

40、request请求加载瓦片优先级的含义((十七)中问题)

41、request的_internalHandle的作用((十七)中问题)

42、DatabaseRequest中_objectCache含义((十七)中问题)

42、osgEarth的多线程分析((十七)中问题)

43、osgEarth的缓存及其结构((十七)中问题)

44、DatabaseThread从缓存加载数据过程((十七)中问题)

45、DatabaseThread从文件加载数据过程((十七)中问题)

46、决定创建TileNode的时机条件((十七)中问题)

47、TerrainEngineNode的createTileModel过程详解((十七)中问题)

48、DatabaseThread中CompileSet的含义((十七)中问题)

48、PagerLoader的traverse过程详解((十七)中问题)

49、DatabaseThread的run过程详解((十七)中问题)

50、LoadTileData的invoke过程详解((十七)中问题)

51、TileNode的cull过程详解((十七)中问题)

52、遮罩生成器osgEarth::Drivers::RexTerrainEngine::MaskGenerator((十八)中问题)

53、RexTerrainEngineNode::traverse过程详解((十八)中问题)

54、TileNode节点下的场景树分析((十八)中问题)

55、地形瓦片大小尺寸和LOD的关系((十八)中问题)

56、TileNode的_tileKeyValue作用((十八)中问题)

57、TileNode的_morphConstants作用((十八)中问题)

58、TileNode的_stitchNormalMap作用((十八)中问题)

59、TileNode的_renderModel作用((十八)中问题)

60、初始化高程栅格过程详解((十八)中问题)

61、LoadTileData中的CreateTileModelFilter作用((十八)中问题)

62、TileNode节点何时会从场景树中移除((十八)中问题)

63、osgEarth::Map的Profile创建过程((二十)中问题)

64、osgEarth::TerrainTileModelFactory添加颜色层和影像层的区别((二十一)中问题)

65、osgEarth::PatchLayer修补层的作用((二十一)中问题)

66、osgEarth::TerrainLayer中的_memCache(osgEarth::MemCache)详解((二十一)中问题)

67、osgEarth::Layer::RenderType图层渲染类型的作用((二十一)中问题)

68、osgEarth::TerrainLayer中TileSource的作用((二十一)中问题)

69、earth文件没有设置高程图层会不会有默认高程层(高程均为0)((二十一)中问题)

70、TerrainTileModelFactory::addColorLayers过程详解((二十一)中问题)

71、TerrainTileModelFactory::addElevation过程详解((二十一)中问题)

72、osgearth中可能用到的几个全局实例对象(osgDB::Registry osgEarth::Registry osg::Timer osg::DisplaySetting)((二十三)中问题)

73、osgEarth::Map::addLayer过程详解((二十三)中问题)

74、TileNode::setDirty过程详解((二十三)中问题)

75、请求四个状态的含义(IDLE RUNNING MERGING FINISHED)((二十三)中问题)

76、什么时候删除TileNode节点,不会一直增加吧((二十三)中问题)

77、寄存器中请求状态活动记录的含义Registry::instance()->endActivity( req->getName() )((二十三)中问题)

78、瓦片TileNode的生命周期流程详解((二十三)中问题)

79、rex引擎如何将瓦片构造成地球形状((二十五)中问题)

80、高程、影像文件格式详解((二十五)中问题)

81、TileNode的merge过程详解((二十六)中问题)

82、osgEarth支持的空间参考坐标系详解(osgEarth::SpatialReference、osgEarth::CubeSpatialReference、osgEarth::TangentPlaneSpatialReference)((二十九)中问题)

83、osgEarth地球椭球体ellipsoid 大地基准面datum 地图投影Projection详解((二十九)中问题)

84、空间参考坐标系和坐标系统类型的关系(geocentric projected)((二十九)中问题)

85、proj4是什么((二十九)中问题)

86、为什么要删除设置过的垂直水准面((二十九)中问题)

87、osgEarth如何对投影坐标系和大地坐标系进行显示处理的((二十九)中问题)

88、TileNode的节点构成,一个surface、tilenode((三十)中问题)

89、MapFram和MapInfo的关系((三十)中问题)

90、ModifyBoundingBoxCallback的使用时机和场合((三十)中问题)

91、MapFrame为什么要单独存放高程层_elevationLayers,而不是放在图层_layers中((三十)中问题)

92、MapFrame和Map中高程池的作用osg::ref_ptr<ElevationPool> _elevationPool((三十)中问题)

93、osgEarth::Drivers::RexTerrainEngine::TileDrawable分析((三十)中问题)

94、请求读取地理信息失败会如何处理((三十二)中问题)

95、RexTerrainEngineNode的遍历过程详解((三十三)中问题)

96、osgEarth::Drivers::RexTerrainEngine::TerrainCuller的apply过程详解((三十三)中问题)

97、RexTerrainEngineNode的updateState过程详解 设置了很多着色器变量((三十三)中问题)

98、什么时候分配opengl资源((三十三)中问题)

99、TileNode释放opengl资源过程releaseGLObjects详解((三十三)中问题)

100、最近一次遍历的帧号和时间是怎么设置呢(在渲染遍历里),怎么就不会再渲染遍历该瓦片节点了((三十三)中问题)

101、osg::State和osg::StateSet的关系((三十四)中问题)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

osgEarth的Rex引擎原理分析(三十五)osgEarth地球椭球体ellipsoid 大地基准面datum 地图投影Projection详解 的相关文章

随机推荐