GIS之家

愿大家在GIS的海洋里自由遨游

导航

经纬度点与投影坐标系下坐标点的互相转换

Posted on 2008-06-13 23:47  雨衣blog  阅读(2857)  评论(2编辑  收藏  举报
经纬度点与投影坐标系下坐标点的互相转换
经纬度点与投影坐标系下坐标点的互相转换是AE编程中经常遇到的,下面以WGS84 和北京54为例介绍如何转换

源码如下:
'''
''' 将经纬度点转换为某投影下的坐标点
'''

'''
''' 某投影下的坐标点
''' 其中pPoint的X是经度,Y是纬度,单位都是度,千万不要搞错,否则转换出来的值是不对的或转换不出值
Private Function GetProjectPoint(ByVal pPoint As IPoint) As IPoint
Dim pSRF As ISpatialReferenceFactory = New SpatialReferenceEnvironment
pPoint.SpatialReference = pSRF.CreateGeographicCoordinateSystem(esriSRGeoCSType.esriSRGeoCS_WGS1984)
pPoint.Project(pSRF.CreateProjectedCoordinateSystem(esriSRProjCSType.esriSRProjCS_Beijing1954GK_23N))
Return pPoint
End Function
'''
''' 将点转换为经纬度点
'''

'''
'''
''' 经纬度点
'''
Private Function GetGeoPoint(ByVal x As Double, ByVal y As Double) As IPoint
Dim pProPoint As IPoint = New Point
pProPoint.PutCoords(x, y)
Dim pSRF As ISpatialReferenceFactory = New SpatialReferenceEnvironment
pProPoint.SpatialReference = pSRF.CreateProjectedCoordinateSystem(esriSRProjCSType.esriSRProjCS_Beijing1954GK_23N)
pProPoint.Project(pSRF.CreateGeographicCoordinateSystem(esriSRGeoCSType.esriSRGeoCS_WGS1984))
Return pProPoint
End Function