偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

SQL Server 2008空間應(yīng)用之呈現(xiàn)GeoRSS訂閱的空間數(shù)據(jù)

數(shù)據(jù)庫(kù) SQL Server
GeoRSS是一種描述和查明互聯(lián)網(wǎng)內(nèi)容所在物理位置的方法。通過(guò)使用GeoRSS,搜索Web站點(diǎn)或者與地理位置有關(guān)的項(xiàng)目就成為可能。本文我們主要就介紹一下SQL Server 2008空間應(yīng)用之在Bing Maps呈現(xiàn)GeoRSS訂閱的空間數(shù)據(jù)的相關(guān)知識(shí),希望能夠?qū)δ兴鶐椭?/div>

SQL Server 2008空間應(yīng)用之呈現(xiàn)GeoRSS訂閱的空間數(shù)據(jù)的相關(guān)知識(shí)是本文我們主要要介紹的內(nèi)容,接下來(lái)就讓我們一起來(lái)了解一下這部分內(nèi)容。GeoRSS是一種描述和查明互聯(lián)網(wǎng)內(nèi)容所在物理位置的方法。通過(guò)使用GeoRSS,搜索Web站點(diǎn)或者與地理位置有關(guān)的項(xiàng)目就成為可能。

GeoRSS利用地理標(biāo)識(shí)語(yǔ)言(GML),即利用可擴(kuò)展標(biāo)記語(yǔ)言 (Extensible Markup Language, XML)存儲(chǔ)和傳輸?shù)乩頂?shù)據(jù)的方法。原始的GML模型以由World Wide Web聯(lián)盟(W3C)所開發(fā)的資源描述框架(RDF)為基礎(chǔ)。GML保持著RDF的許多特性,包括智能代理和一個(gè)用于描述和查詢數(shù)據(jù)的標(biāo)準(zhǔn)語(yǔ)法。

GeoRSS 是在RSS 訂閱源中包含地理空間數(shù)據(jù)時(shí)所用的一個(gè)標(biāo)準(zhǔn),它定義了一種名為GeoRSS GML 的特定格式,用來(lái)在訂閱源中包含GML 格式的數(shù)據(jù)??蛻舳藨?yīng)用程序可以訂閱GeoRSS 訂閱源,訂閱方式與訂閱常規(guī) RSS 訂閱源相同??梢暂p松地將 GeoRSS 格式的數(shù)據(jù)導(dǎo)入Microsoft Bing Maps、Google Maps中,同樣也可以將空間數(shù)據(jù)庫(kù)中的空間數(shù)據(jù)發(fā)布為GeoRss訂閱后快速的在GIS中呈現(xiàn),本篇將介紹如何基于微軟Bing Maps for Silverlight中呈現(xiàn)GeoRss訂閱的空間數(shù)據(jù)。

創(chuàng)建GeoRss閱讀器

創(chuàng)建GeoRss閱讀器的目的是為了動(dòng)態(tài)的請(qǐng)求GeoRss地址,將GeoRss數(shù)據(jù)解析為自己想要的數(shù)據(jù)結(jié)構(gòu),如下便是根據(jù)自己的需求結(jié)合GeoRss定義的一種數(shù)據(jù)結(jié)構(gòu)樣例。

核心原理就是使用WebClient動(dòng)態(tài)的發(fā)起http請(qǐng)求,將返回的GeoRss數(shù)據(jù)通過(guò)Linq To XML的方式解析為對(duì)象結(jié)構(gòu)的數(shù)據(jù)。其實(shí)現(xiàn)非常簡(jiǎn)單,不做具體分析,詳細(xì)代碼如下所示:

  1. usingSystem.Collections.Generic;  
  2. usingSystem;  
  3. usingSystem.Net;  
  4. usingSystem.Xml.Linq;  
  5. usingSystem.Linq;  
  6. usingSystem.Windows;  
  7. usingMicrosoft.Maps.MapControl;  
  8. namespaceGeoRss.Map.GeoRssUtils  
  9. {  
  10. publicdelegatevoidDownloadGeoRssCompletedEventHandler(List<GeoRssItem>items);  
  11. publicdelegatevoidDownloadGeoRssExceptionEventHandler(Exceptione);  
  12. publicclassGeoRssReader  
  13. {  
  14. publicGeoRssReader()  
  15. {  
  16. wc=newWebClient();  
  17. wc.DownloadStringCompleted+=WebClientDownloadGeoRssCompleted;  
  18. }  
  19. publicGeoRssReader(Uriuri)  
  20. :this()  
  21. {  
  22. this.uri=uri;  
  23. }  
  24. publicGeoRssReader(Uriuri,DownloadGeoRssCompletedEventHandlerevh)  
  25. :this(uri)  
  26. {  
  27. DownloadGeoRssCompleted+=evh;  
  28. }  
  29. publicUriuri{get;set;}  
  30. publiceventDownloadGeoRssCompletedEventHandlerDownloadGeoRssCompleted;  
  31. publiceventDownloadGeoRssExceptionEventHandlerDownloadGeoRssException;  
  32. publicvoidReadAsync()  
  33. {  
  34. if(DownloadGeoRssCompleted.Target!=null)  
  35. {  
  36. wc.DownloadStringAsync(uri);  
  37. }  
  38. }  
  39. #region_private  
  40. privatereadonlyWebClientwc;  
  41. privatevoidWebClientDownloadGeoRssCompleted(objectsender,DownloadStringCompletedEventArgse)  
  42. {  
  43. try  
  44. {  
  45. XNamespacensXml="http://www.w3.org/2005/Atom";  
  46. XNamespacensGeorss="http://www.georss.org/georss";  
  47. XNamespacensGeo="http://www.w3.org/2003/01/geo/wgs84_pos#";  
  48. XNamespacensMedia="http://search.yahoo.com/mrss/";  
  49. varitems=fromiteminXElement.Parse(e.Result).Descendants("item")  
  50. selectnewGeoRssItem  
  51. {  
  52. Title=(item.Element("title")!=null)?item.Element("title").Value:null,  
  53. Link=(item.Element("link")!=null)?item.Element("link").Value:null,  
  54. Description=(item.Element("description")!=null)?item.Element("description").Value:null,  
  55. PubData=(item.Element("pubDate")!=null)?item.Element("pubDate").Value:null,  
  56. Locatios=ParserLocations(XElement.Parse(item.LastNode.ToString().Replace(":","X")).Value)  
  57. };  
  58. if(DownloadGeoRssCompleted.Method!=null)  
  59. {  
  60. DownloadGeoRssCompleted.Invoke(items.ToList());  
  61. }  
  62. }  
  63. catch(Exceptionex)  
  64. {  
  65. if(DownloadGeoRssException.Method!=null)  
  66. {  
  67. DownloadGeoRssException.Invoke(ex);  
  68. }  
  69. else  
  70. {  
  71. throw;  
  72. }  
  73. }  
  74. }  
  75. privateLocationCollectionParserLocations(stringpoints)  
  76. {  
  77. LocationCollectionlc=newLocationCollection();  
  78. string[]ps=points.Split('');  
  79. for(inti=0;i<ps.Length;i+=2)  
  80. {  
  81. lc.Add(newLocation(double.Parse(ps[i]),double.Parse(ps[i+1])));  
  82. }  
  83. returnlc;  
  84. }  
  85. #endregion  
  86. }  

基于SLBM呈現(xiàn)GeoRss數(shù)據(jù)

引入Bing Maps Silverlight Control的控件庫(kù),定義一個(gè)專門的MapLayer圖層來(lái)呈現(xiàn)GeoRss數(shù)據(jù),其Silverlight前臺(tái)的代碼如下。

  1. <Gridx:NameGridx:Name="LayoutRoot"Background="White"> 
  2. <map:Mapx:Namemap:Mapx:Name="map"Margin="0,0,0,0"CredentialsProvider="{StaticResourceMyCredentials}" 
  3. ScaleVisibility="Visible" 
  4. CopyrightVisibility="Collapsed"> 
  5. <map:MapLayerNamemap:MapLayerName="mlayer"></map:MapLayer> 
  6. </map:Map> 
  7. </Grid> 

應(yīng)用程序加載的過(guò)程中使用上面所開發(fā)完成的GeoRss閱讀器進(jìn)行數(shù)據(jù)讀取并解析,隨后將結(jié)果呈現(xiàn)在Bing Maps Silverlight Control的應(yīng)用中。代碼如下:

  1. publicMainPage()  
  2. {  
  3. InitializeComponent();  
  4. stringurl="http://localhost:32484/SHBuildingGeoHandler.ashx";  
  5. GeoRssReaderreader=newGeoRssReader(newUri(url,UriKind.RelativeOrAbsolute));  
  6. reader.DownloadGeoRssCompleted+=newDownloadGeoRssCompletedEventHandler(reader_DownloadGeoRssCompleted);  
  7. reader.ReadAsync();  
  8. }  
  9. voidreader_DownloadGeoRssCompleted(List<GeoRssItem>items)  
  10. {  
  11. //System.Diagnostics.Debug.WriteLine(items.Count);  
  12. foreach(variteminitems)  
  13. {  
  14. MapPolygonmp=newMapPolygon();  
  15. mp.Locations=item.Locatios;  
  16. mp.Fill=newSolidColorBrush(Colors.Red);  
  17. this.mlayer.Children.Add(mp);  
  18. }  

SQL Server 2008空間應(yīng)用之呈現(xiàn)GeoRSS訂閱的空間數(shù)據(jù)

關(guān)于SQL Server 2008空間應(yīng)用之Bing Maps中呈現(xiàn)GeoRSS訂閱的空間數(shù)據(jù)的相關(guān)知識(shí)就介紹到這里了,希望本次的介紹能夠?qū)δ兴斋@!

【編輯推薦】

  1. SQL Server 2005導(dǎo)入Oracle 10g的C#源碼
  2. SQL Server 2008快速清理日志文件的代碼
  3. SQL Server 2008數(shù)據(jù)庫(kù)中CDC的功能使用及說(shuō)明
  4. SQL Server 2008阻止保存要求重新創(chuàng)建表的更改的問(wèn)題
  5. SQL Server數(shù)據(jù)庫(kù)row_number() over() 來(lái)自動(dòng)產(chǎn)生行號(hào)
責(zé)任編輯:趙鵬 來(lái)源: 博客園
相關(guān)推薦

2011-02-21 13:06:42

Microsoft S

2011-03-22 15:10:49

Bing MapsSQL Server

2011-03-22 10:20:18

Bing MapsSQL Server

2011-03-22 09:17:12

SQLCRLSQL Server

2011-02-21 13:41:14

SQL Server

2009-04-16 17:55:55

SQL Server 空間數(shù)據(jù).NET

2011-02-21 13:23:54

微軟 SQL Serv

2011-02-21 10:26:53

Microsoft S

2011-02-21 10:47:44

Microsoft S

2011-02-21 13:06:34

SQL Servr 2

2011-03-22 15:36:44

Spatial TooSQL Server

2009-08-28 11:38:15

MapPoint

2009-04-16 17:38:24

SQL Server 空間數(shù)據(jù)智能

2009-01-20 13:39:56

數(shù)據(jù)挖掘空間數(shù)據(jù)方法

2010-09-07 16:28:58

DB2 空間數(shù)據(jù)

2022-09-14 11:27:19

物聯(lián)網(wǎng)大數(shù)據(jù)智慧城市

2022-03-30 09:30:00

數(shù)據(jù)庫(kù)地理空間查詢SQL

2011-08-15 17:55:49

提取MapInfo地圖SQL Server

2024-10-18 17:03:16

Python地理空間數(shù)據(jù)處理

2010-05-07 12:35:05

Oracle spat
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)