zoukankan      html  css  js  c++  java
  • nds坐标获取瓦片编号

    Eiffel Tower 2.2945° 48.858222° 27374451 582901293 0x1a1b373 0x22be5e2d

    nds使用的是WGS84坐标系统(the World Geodetic System dating from 1984),就是平常我们说的经纬度。当我们说一个具体的位置的时候,就说这个问题位置的经度是多少,纬度是多少,这样就可以唯一的定位到一个精确的点。

    nds使用EGM96(the Earth Gravitational Model from 1996)来表示高度信息。EGM96描述的高度信息很好的近似海拔高度,它比WGS84中的高度信息更准确。

    规定经度使用32位int编码,可表示范围是[-180,180],纬度使用31位int编码,可表示范围是[-90,90]

    例: 艾菲尔铁塔的计算如下(Eiffel Tower 2.2945° 48.858222°)

    lon = 2.2945
    lon_to_int32 = pow(2, 31) * 2.2945 / 180
    = 2147483648 * 2.2945 / 180
    = 27374451.279644444444444444444444
    = 27374451 (使用向下取整法floor)
    = 0x1a1b373 (十六进制)
    = ‭0001101000011011001101110011‬ (二进制)

    lat = 48.858222
    lat_to_int32 = pow(2, 30) * 48.858222 / 90
    = 1073741824 * 48.858222 / 90
    = 582901293.41863253333333333333333
    = 582901293 (使用向下取整法floor)
    = 0x22be5e2d (十六进制)
    = ‭00100010101111100101111000101101‬ (二进制)

    使用莫顿码(morton code)进行编码
    x = x31x30...x1x0
    y = y30...y1y0
    c = x31y30x30...y1x1y0x0 总长度为63(32+31)位

    x = 0x1a1b373                                                          1 1 0 1 0 0 0 0 1 1 0 1 1 0 0 1 1 0 1 1 1 0 0 1 1
    y = 0x22be5e2d                                        1 0 0 0 1 0 1 0 1 1 1 1 1 0 0 1 0 1 1 1 1 0 0 0 1 0 1 1 0 1
    c = 0x809cea967ad1da7 100000001001110011101010100101100111101011010001110110100111

    规整为63位 000100000001001110011101010100101100111101011010001110110100111

    故该点在Level10的Tile Number为
    Level10 = c.left(2n+1) = c.left(2*10+1) = c.left(21) = 0 0010 0000 0010 0111 0011
    = 0x‭20273‬
    = ‭131699‬

    故该点在Level13的Tile Number为
    Level13 = c.left(2n+1) = c.left(2*13+1) = c.left(27) = 000 1000 0000 1001 1100 1110 1010
    = 0x‭‭809CEA‬
    = ‭8428778‬

  • 相关阅读:
    The Python Standard Library
    Python 中的round函数
    Python文件类型
    Python中import的用法
    Python Symbols 各种符号
    python 一行写多个语句
    免费SSL证书(https网站)申请,便宜SSL https证书申请
    元宇宙游戏Axie龙头axs分析
    OLE DB provider "SQLNCLI10" for linked server "x.x.x.x" returned message "No transaction is active.".
    The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "xxx.xxx.xxx.xxx" was unable to begin a distributed transaction.
  • 原文地址:https://www.cnblogs.com/jobgeo/p/9492831.html
Copyright © 2011-2022 走看看