資源簡介
KML解析庫,直接加載KML,可以獲取KML中各種空間特征信息。

代碼片段和文件信息
using?System;
using?SharpKml.Dom;
using?SharpKml.Engine;
namespace?Examples
{
????///?
????///?Iterates?over?all?the?Features?in?a?Kml?file?and?displays?an?information?balloon
????///?
????public?static?class?BalloonFeatures
????{
????????private?const?string?InputFile?=?“Sample.kml“;
????????public?static?void?Run()
????????{
????????????KmlFile?file?=?Program.OpenFile(“Enter?a?file?to?show?the?features?of:“);
????????????if?((file?!=?null)?&&?(file.Root?!=?null))
????????????{
????????????????EntityMapper?mapper?=?new?EntityMapper(file);
????????????????foreach?(var?element?in?file.Root.Flatten())
????????????????{
????????????????????Feature?feature?=?element?as?Feature;
????????????????????if?(feature?!=?null)
????????????????????{
????????????????????????string?name?=?feature.Name????“Unnamed?feature“;
????????????????????????string?balloon?=?mapper.CreateBalloonText(feature);
????????????????????????Console.WriteLine(“Feature?balloon?text?for?‘{0}‘\n{1}\n“?name?balloon);
????????????????????}
????????????????}
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-05-16?03:47??Examples\
?????文件????????1127??2013-05-16?03:47??Examples\BalloonFeatures.cs
?????文件????????1785??2013-05-16?03:47??Examples\Change.cs
?????文件????????1628??2013-05-16?03:47??Examples\Clone.cs
?????文件????????1565??2013-05-16?03:47??Examples\CreateIconst
?????文件????????1412??2013-05-16?03:47??Examples\CreateKml.cs
?????文件????????1205??2013-05-16?03:47??Examples\CreateKmz.cs
?????目錄???????????0??2013-05-16?03:47??Examples\Data\
?????文件????????1174??2013-05-16?03:47??Examples\Data\camera_mode.png
?????文件?????????919??2013-05-16?03:47??Examples\Data\doc.kml
?????文件????????5310??2013-05-16?03:47??Examples\Data\Sample.kml
?????文件?????1486893??2013-05-16?03:47??Examples\Data\zermatt.jpg
?????文件????????3452??2013-05-16?03:47??Examples\Examples.csproj
?????文件?????????815??2013-05-16?03:47??Examples\Inlinest
?????文件?????????751??2013-05-16?03:47??Examples\ParseKml.cs
?????文件????????5711??2013-05-16?03:47??Examples\Program.cs
?????文件????????1464??2013-05-16?03:47??Examples\Showst
?????文件????????2149??2013-05-16?03:47??Examples\SortPlacemarks.cs
?????文件?????????803??2013-05-16?03:47??Examples\Splitst
?????文件????????1422??2013-05-16?03:47??SharpKml-SL.sln
?????文件????????1872??2013-05-16?03:47??SharpKml.sln
?????目錄???????????0??2013-05-16?03:47??SharpKml\
?????目錄???????????0??2013-05-16?03:47??SharpKml\ba
?????文件????????2891??2013-05-16?03:47??SharpKml\ba
?????文件????????9338??2013-05-16?03:47??SharpKml\ba
?????文件?????????769??2013-05-16?03:47??SharpKml\ba
?????文件????????2486??2013-05-16?03:47??SharpKml\ba
?????文件?????????744??2013-05-16?03:47??SharpKml\ba
?????文件????????2129??2013-05-16?03:47??SharpKml\ba
?????文件????????5170??2013-05-16?03:47??SharpKml\ba
?????文件????????4253??2013-05-16?03:47??SharpKml\ba
............此處省略289個文件信息
- 上一篇:簡單的基于C#的教材管理系統
- 下一篇:基于Visual C#的DirectX開發
評論
共有 條評論