我从我的SQL查询中获取信息(名称、描述、纬度、经度),但我无法将其转换为GeoRSS的正确格式,以便我的虚拟地球地图可以使用它。FOR XML AUTO没有给出我想要的结果,而且我似乎找不到任何示例来说明如何将SQL查询的输出提取到GeoRSS。
下面是我正在寻找的GeoRSS格式的示例:
<channel>
<title>Reported Road Hazards</title>
<link/>
<description>Road hazards reported to the city</description>
<item>
<title>Traffic Light</title>
<description>Traffic light on north west corner out</description>
<geo:lat>43.64887</geo:lat>
<geo:long>-79.385362</geo:long>
</item>
</channel>发布于 2009-12-02 23:46:49
我已经通过SQL得到了我想要的输出。
With XMLNAMESPACES ( 'http://www.w3.org/2003/01/geo/wqs84_pos#' as geo)
Select Name as title, [Description], Lat as 'geo:lat', Long as 'geo:long'
From myTable
FOR XML PATH ('item'), ROOT('rss')这个基本模式将提供GeoRSS格式的XML,供Bing Maps、Google Maps等服务使用。
https://stackoverflow.com/questions/1757827
复制相似问题