好了,只是想解开各种方式的十六进制值...
#! /usr/bin/python
import struct
import binascii
a = '04867C279DE2D6EC'
b = '04867C27C030085E'
c = '04867C27C230A5FE'
formats = ['2I', '2i', '2f', 'd', '4h', '4H']
formats += ['>'+item for item in formats]
for fmt in formats:
print fmt, '-->'
for item in [a,b,c]:
coords = struct.unpack(fmt, binascii.unhexlify(item))
print ' ', coords
取得了一些想法......
2I -->
(662472196, 3973505693)
(662472196, 1577595072)
(662472196, 4272238786)
2i -->
(662472196, -321461603)
(662472196, 1577595072)
(662472196, -22728510)
2f -->
(3.5044675291578432e-15, -2.07824221089183e+27)
(3.5044675291578432e-15, 2.4533886735682109e+18)
(3.5044675291578432e-15, -1.0978789217059195e+38)
d -->
(-1.9722947342913136e+216,)
(9.4395557694675488e+144,)
(-1.135288151092706e+302,)
4h -->
(-31228, 10108, -7523, -4906)
(-31228, 10108, 12480, 24072)
(-31228, 10108, 12482, -347)
4H -->
(34308, 10108, 58013, 60630)
(34308, 10108, 12480, 24072)
(34308, 10108, 12482, 65189)
>2I -->
(75922471, 2648889068)
(75922471, 3224373342)
(75922471, 3257968126)
>2i -->
(75922471, -1646078228)
(75922471, -1070593954)
(75922471, -1036999170)
>2f -->
(3.1617264522911893e-36, -6.0043925910101893e-21)
(3.1617264522911893e-36, -2.7505106925964355)
(3.1617264522911893e-36, -44.162101745605469)
>d -->
(7.3832340678903009e-287,)
(7.3832347392384709e-287,)
(7.383234778429458e-287,)
>4h -->
(1158, 31783, -25118, -10516)
(1158, 31783, -16336, 2142)
(1158, 31783, -15824, -23042)
>4H -->
(1158, 31783, 40418, 55020)
(1158, 31783, 49200, 2142)
(1158, 31783, 49712, 42494)
拆开它作为一个大端无符号32位整数( > 2I)看起来有点像它可能被投射某种坐标......
(-32.063657, 115.7658683) --> (75922471, 2648889068)
(-32.0633982, 115.7649085) --> (75922471, 3224373342)
(-32.0633846, 115.7653336) --> (75922471, 3257968126)
如果是在UTM,它的可能是UTM Zone 50S,基于lat,long ...我们不知道基准,但是这不应该超过几百米的差距。
有关区域50S:
(lat, long) --> (Easting, Northing)
(-32.063657, 115.7658683) --> (383506.31320936838, 6451842.2821839228)
(-32.0633982, 115.7649085) --> (383415.3800562254, 6451869.9348384682)
(-32.0633846, 115.7653336) --> (383455.49221963808, 6451871.9016738012)
(使用OSR的(可怕unpythonic)Python包装......)
from osgeo import osr
def latlong2utm(lat, long):
epsg_wgs84 = 4326
epsg_utm50S = 32750
inproj = osr.SpatialReference()
inproj.ImportFromEPSG(epsg_wgs84)
outproj = osr.SpatialReference()
outproj.ImportFromEPSG(epsg_utm50S)
transform = osr.CoordinateTransformation(inproj, outproj)
x,y,_ = transform.TransformPoint(long, lat)
return x, y
不幸的是,它看起来并不像UTM区50S,反正.. 。和区域49不看任何好转...
所以,没有太大的帮助,但我想我会张贴此帮助谁可能试图在同一路径其他人......(我也试过拆包IBM转而采用o的东西f IEEE漂浮...没有运气那里要么...)也许我只是愚蠢的,但我没有想法。希望这有助于一点,但...
还有一组<十六进制,纬度,经度>将使这个问题交代。 – msw 2010-06-28 06:35:14
已添加。但是,我不确定那些坐标是否完全准确;可能会有一些四舍五入的情况发生。 – 2010-06-28 06:50:37