뉴욕시 x/y 좌표를 가져 와서 위/아래 소수점으로 변환하는 프로그램을 작성하려고합니다. 새로운 평면/글로브 매핑. 필자는 NYC가 웹 사이트에 제공 한 상수를 포함 시켰습니다. 또한이 작업을 수행하는 방법에 대한 좋은 기사가 있으면 배우고 싶습니다! 아래는 내가 밑줄에 주석 처리 된 결과와 함께 작성한 프로그램과 이상적인 값이 있어야하는 프로그램입니다. Im는 이것 위에서 어두운 데에서 단지 비틀 거리는 단지 약간을 만난다.평면 x/y를 위도/경도로 변환
#!/usr/bin/python
from math import *
"""
Supplied by NYC
Lambert Conformal Conic:
Standard Parallel: 40.666667
Standard Parallel: 41.033333
Longitude of Central Meridian: -74.000000
Latitude of Projection Origin: 40.166667
False Easting: 984250.000000
False Northing: 0.000000
"""
x = 981106 #nyc x coord
y = 195544 #nyc y coord
a = 6378137 #' major radius of ellipsoid, map units (NAD 83)
e = 0.08181922146 #' eccentricity of ellipsoid (NAD 83)
angRad = pi/180 #' number of radians in a degree
pi4 = pi/4 #' Pi/4
p0 = 40.166667 * angRad #' latitude of origin
p1 = 40.666667 * angRad #' latitude of first standard parallel
p2 = 41.033333 * angRad #' latitude of second standard parallel
m0 = -74.000000 * angRad #' central meridian
x0 = 984250.000000 #' False easting of central meridian, map units
m1 = cos(p1)/sqrt(1 - ((e ** 2) * sin(p1) ** 2))
m2 = cos(p2)/sqrt(1 - ((e ** 2) * sin(p2) ** 2))
t0 = tan(pi4 - (p0/2))
t1 = tan(pi4 - (p1/2))
t2 = tan(pi4 - (p2/2))
t0 = t0/(((1 - (e * (sin(p0))))/(1 + (e * (sin(p0)))))**(e/2))
t1 = t1/(((1 - (e * (sin(p1))))/(1 + (e * (sin(p1)))))**(e/2))
t2 = t2/(((1 - (e * (sin(p2))))/(1 + (e * (sin(p2)))))**(e/2))
n = log(m1/m2)/log(t1/t2)
f = m1/(n * (t1 ** n))
rho0 = a * f * (t0 ** n)
x = x - x0
pi2 = pi4 * 2
rho = sqrt((x ** 2) + ((rho0 - y) ** 2))
theta = atan(x/(rho0 - y))
t = (rho/(a * f)) ** (1/n)
lon = (theta/n) + m0
x = x + x0
lat0 = pi2 - (2 * atan(t))
part1 = (1 - (e * sin(lat0)))/(1 + (e * sin(lat0)))
lat1 = pi2 - (2 * atan(t * (part1 ** (e/2))))
while abs(lat1 - lat0) < 0.000000002:
lat0 = lat1
part1 = (1 - (e * sin(lat0)))/(1 + (e * sin(lat0)))
lat1 = pi2 - (2 * atan(t * (part1^(e/2))))
lat = lat1/angRad
lon = lon/angRad
print lat,lon
#output : 41.9266666432 -74.0378981653
#should be 40.703778, -74.011829
임 꽤 붙어, 나는 어떤 도움을-지오 코딩 감사를 필요로하는 이들의 톤이있다!
어쩌면 http://en.wikipedia.org/wiki/Map_projection가 시작하기 수 있을까? –
사용 된 투영에 대한 자세한 내용은 다음을 참조하십시오. http://en.wikipedia.org/wiki/Lambert_conformal_conic_projection – arboc7
그냥 해당 문서를 읽고 수식 구현을 시작한 다음 타원형 변환을 수행하고 수식이 모두 존재하지 않는다는 것을 깨달았습니다. 타원형 데이텀에 대한 공식이 더 관련되어 있습니다. – busbina