问题描述
我已将.SHP文件上传到sql中的表中,并获得了包含数据的geometry列.我可以在sql server中的空间结果"选项卡上看到点,这一切都很好.当我在sql server中运行此行
I've uploaded .SHP files to my table in sql and I got geometry column with data. I can see points on "Spatial results" tab in sql server and that's all fine.When I run this line in sql server
从myTable中选择[geom] .STAsText()
SELECT [geom].STAsText() FROM myTable
我得到了这样的结果
要点(444386.4927124856 5073381.9183241855)
POINT (444386.4927124856 5073381.9183241855)
那么有什么方法可以将其转换为常规的纬度和经度.
So is there any way to convert this to regular latitude and longitude.
推荐答案
我已经在.NET中开发了一个库,该库可以从事务sql调用,将WGS84/UTM坐标转换为纬度和经度
I have developed a library in .NET to be called from transact sql Converts WGS84/UTM coordinates to Latitude and Longitude
您可以从github下载它:
You can download it from github:
https://github.com/j-v-garcia/UTM2LATITUDE
用法:
SELECT dbo.UTM2LATITUDE(723399.51,4373328.5,'S',30)AS纬度,dbo.UTM2LONGITUDE(723399.51,4373328.5,'S',30)AS经度
SELECT dbo.UTM2LATITUDE(723399.51,4373328.5,'S',30) AS Latitude, dbo.UTM2LONGITUDE(723399.51,4373328.5,'S',30) AS Longitude
结果:
39,4805657453054 -0,402592727245112
<param name="XUTM">pos UTM X</param>
<param name="YUTM">pos UTM Y</param>
<param name="LatBand">Latitude band grid zone designation letter (see http://www.dmap.co.uk/utmworld.htm) </param>
<param name="LongBand">Longitude band grid zone designation number (see http://www.dmap.co.uk/utmworld.htm) </param>
这篇关于将几何(空间)转换为经度和纬度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!