【问题标题】:Outputting SQL query results to GeoRSS将 SQL 查询结果输出到 GeoRSS
【发布时间】:2009-11-18 17:49:57
【问题描述】:

我从我的 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>

【问题讨论】:

    标签: sql xml virtual-earth


    【解决方案1】:

    我已经通过 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 地图、谷歌地图等服务使用......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 2010-09-26
      • 1970-01-01
      相关资源
      最近更新 更多