資源簡介
自己實(shí)現(xiàn)的一個(gè)WMS服務(wù)器(web map service),實(shí)現(xiàn)了getmap和getcapability兩個(gè)功能,程序運(yùn)行之前用1.xml內(nèi)容替換掉另一個(gè)xml的內(nèi)容,運(yùn)行后有兩個(gè)按鈕,一個(gè)是添加shapefile數(shù)據(jù)的按鈕(添加數(shù)據(jù)后,圖層名為shapefile名),一個(gè)是開啟服務(wù)的按鈕,端口是808。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Drawing;
namespace?webSevice
{
????class?DrawMap
????{
????????public?static?void?SetPoiClor(Bitmap?MapToBeDrawed?Point?PT?Color?ColorForMap)
????????{
????????????try
????????????{
????????????????MapToBeDrawed.SetPixel(PT.X?PT.Y?ColorForMap);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????throw?new?Exception(“像素設(shè)置顏色出錯(cuò)“?ex);
????????????}
????????}
????????public?static?void?SetBack(Bitmap?bmp)
????????{
????????????Bitmap?temp?=?new?Bitmap(bmp);
????????????for?(int?i?=?0;?i?????????????{
????????????????for?(int?j?=?0;?j?????????????????{
????????????????????bmp.SetPixel(i?temp.Height?-?1?-?j?temp.GetPixel(i?j));
????????????????}
????????????}
????????}
????????public?static?void?DrawLine(Bitmap?MapToBeDrawed?Point?ptStart?Point?ptEnd?Color?ColorForMap)
????????{
????????????int?deltX?deltY;
????????????Point?tempPt?=?new?Point();//臨時(shí)的點(diǎn),用于劃線算法中表示當(dāng)前需要涂黑的點(diǎn)
????????????if?(ptStart.X?????????????{
????????????????tempPt?=?new?Point(ptStart.X?ptStart.Y);
????????????????deltX?=?ptEnd.X?-?ptStart.X;
????????????????deltY?=?ptEnd.Y?-?ptStart.Y;
????????????}
????????????else
????????????{
????????????????tempPt?=?new?Point(ptEnd.X?ptEnd.Y);
????????????????deltX?=?-(ptEnd.X?-?ptStart.X);
????????????????deltY?=?-(ptEnd.Y?-?ptStart.Y);
????????????}
????????????if?(Math.Abs(deltX)?>=?Math.Abs(deltY))//x的步長比Y的長
????????????{
????????????????int?flagNum?=?Math.Abs(deltY)?*?2?-?deltX;//初始化判斷符號(hào)
????????????????for?(int?i?=?Math.Min(ptEnd.X?ptStart.X)?+?1;?i?<=?Math.Max(ptEnd.X?ptStart.X);?i++)//通過循環(huán)實(shí)現(xiàn)算法的主要部分
????????????????{
????????????????????if?(flagNum?>?0)//交點(diǎn)的Y需要增加1
????????????????????{
????????????????????????flagNum?-=?2?*?deltX;
????????????????????????if?(deltY?0)
????????????????????????????tempPt.Y?+=?-1;
????????????????????????else
????????????????????????????tempPt.Y?+=?1;
????????????????????}
????????????????????flagNum?+=?2?*?Math.Abs(deltY);
????????????????????tempPt.X?+=?1;
????????????????????SetPoiClor(MapToBeDrawed?tempPt?ColorForMap);
????????????????????//this.DisGra.Refresh();
????????????????}
????????????}
????????????else//Y的步長大于或等于X的步長
????????????{
????????????????if?(ptStart.Y?????????????????{
????????????????????tempPt?=?new?Point(ptStart.X?ptStart.Y);
????????????????????deltX?=?ptEnd.X?-?ptStart.X;
????????????????????deltY?=?ptEnd.Y?-?ptStart.Y;
????????????????}
????????????????else
????????????????{
????????????????????tempPt?=?new?Point(ptEnd.X?ptEnd.Y);
????????????????????deltX?=?-(ptEnd.X?-?ptStart.X);
????????????????????deltY?=?-(ptEnd.Y?-?ptStart.Y);
????????????????}
????????????????int?flagNum?=?Math.Abs(deltX)?*?2?-?deltY;//初始化判斷符號(hào)
????????????????for?(int?i?=?Math.Min(ptEnd.Y?ptStart.Y)?+?1;?i?<=?Math.Max(pt
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-11-27?21:56??webSevice\
?????目錄???????????0??2013-12-01?20:12??webSevice\webSevice\
?????文件???????16536??2013-12-01?21:38??webSevice\webSevice\DrawMap.cs
?????文件????????3367??2013-11-30?12:30??webSevice\webSevice\Form1.Designer.cs
?????文件????????7701??2013-12-02?10:49??webSevice\webSevice\Form1.cs
?????文件????????5817??2013-11-30?12:30??webSevice\webSevice\Form1.resx
?????文件????????1169??2013-11-27?20:15??webSevice\webSevice\Form2.Designer.cs
?????文件?????????359??2013-11-27?20:15??webSevice\webSevice\Form2.cs
?????文件????????5817??2013-11-27?20:16??webSevice\webSevice\Form2.resx
?????文件????????2779??2013-12-01?20:31??webSevice\webSevice\GISservice.cs
?????文件?????????490??2013-11-25?18:44??webSevice\webSevice\Program.cs
?????文件????????2888??2013-11-30?14:00??webSevice\webSevice\Projection.cs
?????目錄???????????0??2013-11-25?18:44??webSevice\webSevice\Properties\
?????文件????????1368??2013-11-25?18:44??webSevice\webSevice\Properties\AssemblyInfo.cs
?????文件????????2870??2013-11-25?18:44??webSevice\webSevice\Properties\Resources.Designer.cs
?????文件????????5612??2013-11-25?18:44??webSevice\webSevice\Properties\Resources.resx
?????文件????????1096??2013-11-25?18:44??webSevice\webSevice\Properties\Settings.Designer.cs
?????文件?????????249??2013-11-25?18:44??webSevice\webSevice\Properties\Settings.settings
?????目錄???????????0??2013-11-25?18:44??webSevice\webSevice\bin\
?????目錄???????????0??2013-12-02?10:48??webSevice\webSevice\bin\Debug\
?????文件?????2087000??2013-11-29?17:48??webSevice\webSevice\bin\Debug\1.gif
?????文件????????3440??2013-11-16?16:14??webSevice\webSevice\bin\Debug\1.png
?????文件????????2638??2013-12-01?22:02??webSevice\webSevice\bin\Debug\1.xm
?????文件????????3543??2013-12-02?10:49??webSevice\webSevice\bin\Debug\initialxm
?????文件????????1034??2013-12-01?21:30??webSevice\webSevice\bin\Debug\initialxm
?????文件????????1032??2013-12-01?20:59??webSevice\webSevice\bin\Debug\initialxm
?????文件???????30208??2013-12-02?10:49??webSevice\webSevice\bin\Debug\webSevice.exe
?????文件???????85504??2013-12-02?10:49??webSevice\webSevice\bin\Debug\webSevice.pdb
?????文件???????11600??2013-12-02?11:05??webSevice\webSevice\bin\Debug\webSevice.vshost.exe
?????文件?????????490??2012-06-06?02:06??webSevice\webSevice\bin\Debug\webSevice.vshost.exe.manifest
?????文件????????3100??2013-12-01?20:37??webSevice\webSevice\la
............此處省略20個(gè)文件信息
評(píng)論
共有 條評(píng)論