MapX應(yīng)用講義第08章 實(shí)用子程序_第1頁(yè)
MapX應(yīng)用講義第08章 實(shí)用子程序_第2頁(yè)
MapX應(yīng)用講義第08章 實(shí)用子程序_第3頁(yè)
MapX應(yīng)用講義第08章 實(shí)用子程序_第4頁(yè)
MapX應(yīng)用講義第08章 實(shí)用子程序_第5頁(yè)
已閱讀5頁(yè),還剩37頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、8.9 繪矢量圖1.功能繪制圖8-24所示的矢量圖。圖8-24 矢量圖2.子程序語(yǔ)句Private Sub Vector(TheInPath As String, TheInFile As String)3.參數(shù)說(shuō)明l TheInPath:輸入矢量圖數(shù)據(jù)文件路徑。l TheInFile:輸入矢量圖數(shù)據(jù)文件名。4.子程序源程序參見(jiàn)書(shū)附光盤(pán)809VectorMapVectorMapVector.vbp。5.實(shí)例在VB中調(diào)出809Vector繪矢量圖.vbg,運(yùn)行主選單【繪矢量圖】,可繪出如圖8-24所示的矢量圖。本模塊程序識(shí)別的數(shù)據(jù)格式以下5種。l GPS數(shù)據(jù)格式。文件名后綴必須為.GPS,文件末

2、尾不能有空行或非數(shù)據(jù)行,其文件格式如下。經(jīng)度 緯度 EW向速率 NS向速率 EW向誤差 NS向誤差 協(xié)方差 地名光盤(pán)中的709Vector矢量圖數(shù)據(jù)Tibetvel-EURA.GPS即為 GPS處理結(jié)果數(shù)據(jù),下例給出幾個(gè)數(shù)據(jù)供參考。 91.1 29.6 2.152 1.807 0.039 0.031 -0.02971 LHAS(拉薩) 144.8 13.5 -3.508 1.435 0.049 0.034 -0.22121 GUAM 121.2 31.0 1.007 -0.496 0.040 0.031 0.00236 SHAO(上海) 121.5 25.0 1.239 -0.274 0.05

3、0 0.034 -0.04322 TAIW(臺(tái)北)l GRV0格式。文件名后綴必須為.GRV,其文件格式如下。GRV0格式標(biāo)記符號(hào)。N數(shù)據(jù)個(gè)數(shù)。Lat1 Lon1 Lat2 Lon2起點(diǎn)緯度、起點(diǎn)經(jīng)度、終點(diǎn)緯度、終點(diǎn)經(jīng)度。光盤(pán)中的709Vector矢量圖數(shù)據(jù)Vector.GRV即為該格式數(shù)據(jù)。下例給出幾個(gè)數(shù)據(jù)供參考。GRV0510.0000 60.0000 10.3113 59.893310.0000 61.0000 10.2955 60.916510.0000 62.0000 10.2790 61.939710.0000 63.0000 10.2617 62.962910.0000 64.0

4、000 10.2438 63.9861l GRV1格式。文件名后綴必須為.GRV,其文件格式如下。GRV1格式標(biāo)記符號(hào)。N數(shù)據(jù)個(gè)數(shù)。MinNSV MaxNSV南北向數(shù)據(jù)最小值、南北向數(shù)據(jù)最大值。MinEWV MaxEWV東西向數(shù)據(jù)最小值、東西向數(shù)據(jù)最大值。Lat Lon ANS AEW該點(diǎn)緯度、經(jīng)度、南北向振幅、東西向振幅,正南、正東為正。709Vector矢量圖數(shù)據(jù) S1998010100.GRV即為該格式數(shù)據(jù)。下例給出幾個(gè)數(shù)據(jù)供參考。GRV16-20.4355 -18.7573-3.4846 2.224310.0000 60.0000 -20.4355 -3.484610.0000 61.

5、0000 -20.0558 -3.193310.0000 62.0000 -19.6492 -2.885910.0000 63.0000 -19.2162 -2.562810.0000 64.0000 -18.7573 -2.224310.0000 65.0000 -18.6573 -2.3243l GRV2格式。文件名后綴必須為.GRV,其文件格式如下。GRV2格式標(biāo)記符號(hào)。N數(shù)據(jù)個(gè)數(shù)。Lat Lon Ample Angle該點(diǎn)緯度、經(jīng)度、振幅、方位角。方位角以正南為起始,順時(shí)針為正。光盤(pán)中的709Vector矢量圖數(shù)據(jù)S1998010100.GRV即為該格式數(shù)據(jù)。下例給出幾個(gè)數(shù)據(jù)供參考。G

6、RV2510 110.0 5 32.415 112.5 6 90.519 117.3 10 34.623 117.4 13 32.525 114.3 12 175.5l GRV3格式。文件名后綴必須為.GRV,其文件格式如下。GRV3格式標(biāo)記符號(hào)。N數(shù)據(jù)個(gè)數(shù)。Lat Lon Ample1 Ample2 Angle1該點(diǎn)緯度、經(jīng)度、主應(yīng)變1幅度、主應(yīng)變2幅度、主應(yīng)變1方位角。方位以正南為起始,順時(shí)針為正。光盤(pán)中的709Vector矢量圖數(shù)據(jù) 主應(yīng)變.TXT即為該格式數(shù)據(jù)。下例給出幾個(gè)數(shù)據(jù)供參考。GRV3440.23 95.56 20.0 9.0 30.035.82 100.47 10.0 -18

7、.0 95.034.00 105.00 -23.0 -10.0 195.030.00 110.00 -5.0 8.0 290.08.10 繪震源機(jī)制解圖1.功能繪制如圖8-25所示的震源機(jī)制解圖。圖8-25 震源機(jī)制解圖2.子程序語(yǔ)句Public Sub ZYJZDll(MapInfoT As Object, TheInstallPathT As String, TheMapInfoPathT As String)3.參數(shù)說(shuō)明l MapInfoT:輸入?yún)?shù),MapInfo對(duì)象。l TheInstallPathT:輸入?yún)?shù),數(shù)據(jù)存放路徑。l TheMapInfoPathT:輸出參數(shù),震源機(jī)制解結(jié)

8、果存放路徑。.子程序源程序參看書(shū)附光盤(pán)810ZYJZMapSeism MapSeism.vbp。5.實(shí)例在VB中調(diào)出810ZYJZ繪震源機(jī)制解圖.vbg,運(yùn)行主選單【繪震源機(jī)制解圖】,可繪出如圖8-25所示的震源機(jī)制解圖。本模塊程序識(shí)別的數(shù)據(jù)為Access數(shù)據(jù)庫(kù),參見(jiàn)書(shū)附光盤(pán)710ZYJZ目錄下的“世界地應(yīng)力圖.MDB”,“世界震源機(jī)制解.MDB”與“中國(guó)震源機(jī)制解.MDB”文件。8.11 繪地震震中分布圖1.功能讀取地震目錄,繪制地震震中分布圖。2.子程序語(yǔ)句Private Sub MarkEarthQuakeFile(bAll As Boolean, iCheckZZDM As Integ

9、er)3.參數(shù)說(shuō)明l bAll:輸入?yún)?shù),是否繪整個(gè)地震目錄的震中分布圖。l iCheckZZDM:輸入?yún)?shù),數(shù)據(jù)存放路徑。4.子程序源程序參見(jiàn)書(shū)附光盤(pán)811Earthquake MapMark.vbp。5.實(shí)例在VB中調(diào)出811Earthquake 繪震中分布圖.vbg,運(yùn)行主選單【繪震中分布圖】,可繪出如圖8-26所示的全球震中分布圖。圖8-26 全球震中分布圖8.12 給定經(jīng)緯度查找最近地名1.功能輸入經(jīng)緯度,查找距該點(diǎn)最近的地名和該點(diǎn)所處縣級(jí)行政區(qū)域。2.子程序語(yǔ)句Public Sub FindNearestPoint(szTable0 As String, szTable1 As S

10、tring, szTable2 As String, fBaseX As Double, ByVal fBaseY As Double, StrML As String, StrTime As String)3.參數(shù)說(shuō)明l szTable0:輸入?yún)?shù),縣界表名,參見(jiàn)書(shū)附光盤(pán)712SearchDM知識(shí)庫(kù)中國(guó)縣界_首都圈.tab。l szTable1:輸入?yún)?shù),居名點(diǎn)表名,參見(jiàn)書(shū)附光盤(pán)712SearchDM知識(shí)庫(kù)中國(guó)居名點(diǎn)_首都圈.tab。l szTable2:輸入?yún)?shù),縣名表名,參見(jiàn)書(shū)附光盤(pán)712SearchDM知識(shí)庫(kù)中國(guó)縣名_首都圈.tab。4.子程序源程序參見(jiàn)書(shū)附光盤(pán)812SearchDMM

11、apSearchMapSearch.vbp。 查找最近地名的主要程序清單如下。Public Sub FindNearestPoint(szTable0 As String, szTable1 As String, szTable2 As String, fBaseX As Double, ByVal fBaseY As Double, StrML As String, StrTime As String) Dim I As Integer, snPointsFound As Integer Dim fRadius As Double, StrTemp As String, DirFile As

12、 String Dim DoStr As String, MarkStr As String, RowID As Long Dim MLMS As Single, Time As Integer, MlAscii As Integer, MlIndex As Integer, Size As Integer, MlColor As Long Dim StrField As String, szTable As String Dim Temp As String, TheEarthQuakeNameT As String Dim N As Long Dim StrCaption As Strin

13、g Dim HH As String Dim TWName As String, DWName As String, DWNo As Integer, LocName As String, EQNO As Integer Dim LineTemp As String Dim DirMapSearch As String Dim SngML As Single On Error Resume Next MapInfo.Do "Set Distance Units ""km""" MapInfo.Do "Set CoordSys

14、 Earth Projection 1, 0" 'Begin創(chuàng)建地震符號(hào) If (Len(StrTime) > 0) Then Call MarkEQSingle(fBaseX, fBaseY, StrML, StrTime, True) Else MapInfo.Do "Set Map Layer 0 Editable ON" MapInfo.Do "Set Style Symbol MakeSymbol(34,16711680,16)" MapInfo.Do "Insert Into Cosmetic1 (Objec

15、t) values (CreatePoint(" & fBaseX & "," & fBaseY & ")" End If 'End創(chuàng)建地震符號(hào) 'Begin判斷有無(wú)中國(guó)居民點(diǎn)和中國(guó)縣名表 DirFile = "" DirFile = MapInfo.Eval("TableInfo(" & szTable1 & ",5)") If (DirFile = "") Then DirFile = "

16、" DirFile = MapInfo.Eval("TableInfo(" & szTable2 & ",5)") If (DirFile = "") Then MapInfo.Do "Set Map Center (" & fBaseX & "," & fBaseY & ") Zoom 400 Units ""km""" MapInfo.Do "set map red

17、raw on" TheEarthQuakeName = "" MsgBox "無(wú)中國(guó)居民點(diǎn)和中國(guó)縣名表,不能查詢地名", vbOKOnly, "關(guān)于地震查詢" Else szTable = szTable2 End If Else szTable = szTable1 End If 'End判斷有無(wú)中國(guó)居民點(diǎn)和中國(guó)縣名表 'Begin搜索地震所在縣 MapInfo.Do "Set CoordSys Earth Projection 1,0" MapInfo.Do "OBJ_Tem

18、p=CreatePoint(" & fBaseX & "," & fBaseY & ")" MapInfo.Do "Select * From " & szTable0 & " Where OBJ_Temp Within OBJ" N = Val(MapInfo.Eval("SelectionInfo(3)") If (N = 1) Then '省 StrTemp = MapInfo.Eval("Selection.co

19、l1") I = InStr(StrTemp, Chr(0) If (I > 0) Then StrTemp = Left(StrTemp, I - 1) End If LocName = StrTemp '縣市 StrTemp = StrTemp + "-" + MapInfo.Eval("Selection.col2") I = InStr(StrTemp, Chr(0) If (I > 0) Then StrTemp = Left(StrTemp, I - 1) End If LocName = LocName + M

20、apInfo.Eval("Selection.col2") I = InStr(LocName, Chr(0) If (I > 0) Then LocName = Left(LocName, I - 1) End If TheEarthQuakeName = StrTemp TheEarthQuakeNameT = "地震發(fā)生在:" + StrTemp + "境內(nèi)" Else TheEarthQuakeName = "沒(méi)找到地震所在區(qū)域" TheEarthQuakeNameT = "沒(méi)找到地震所在區(qū)

21、域" End If 'End搜索地震所在縣 'Begin選擇最近居民點(diǎn)或縣城 fRadius = 2.5 Do If (fRadius > 500) Then StrTemp = "" Exit Do End If fRadius = fRadius * 2 MapInfo.Do "OBJ_Temp= CreateCircle(" & fBaseX & "," & fBaseY & "," & fRadius & ")&quo

22、t; MapInfo.Do "Select * From " & szTable & " Where (Obj Within OBJ_Temp) Into ""TmpPoints""" snPointsFound = Val(MapInfo.Eval("TableInfo(TmpPoints,8)") Loop Until (snPointsFound > 0) If (fRadius <= 500) Then MapInfo.Do "Select Dist

23、ance(" & fBaseX & "," & fBaseY & ",CentroidX(Obj), CentroidY(Obj), ""km""),TmpPoints.省名,TmpPoints.縣市名,TmpPoints.居民點(diǎn) From ""TmpPoints"" Into ""OrderedPoints"" Order By col1" MapInfo.Do "Fetch Rec

24、 1 From ""OrderedPoints""" '省 StrTemp = "震中最近地名:" + MapInfo.Eval("Selection.col2") I = InStr(StrTemp, Chr(0) If (I > 0) Then StrTemp = Left(StrTemp, I - 1) End If '縣市 StrTemp = StrTemp + "-" + MapInfo.Eval("Selection.col3")

25、I = InStr(StrTemp, Chr(0) If (I > 0) Then StrTemp = Left(StrTemp, I - 1) End If '居民點(diǎn) Temp = MapInfo.Eval("Selection.col4") I = InStr(Temp, Chr(0) If (I > 0) Then Temp = Left(Temp, I - 1) End If If (Len(Temp) > 1) Then If (InStr(StrTemp, Temp) < 1) Then StrTemp = StrTemp + &

26、quot;-" + Temp End If End If End If MapInfo.Do "Close Table ""TmpPoints""" MapInfo.Do "Close Table ""OrderedPoints""" 'End選擇最近居民點(diǎn)或縣城 MapInfo.Do "Close Table Selection" MapInfo.Do "Set CoordSys Earth Projection 1, 0&q

27、uot; MapInfo.Do "Set Map Center (" & fBaseX & "," & fBaseY & ") Zoom 400 Units ""km""" MapInfo.Do "set map redraw on" If (Len(StrTime) > 0) Then TheEarthQuakeName = TheEarthQuakeName + Left(StrTime, 4) + "年" + F

28、ormat(Val(Mid(StrTime, 5, 2), "#0") + "月" + Format(Val(Mid(StrTime, 7, 2), "#0") + "日" End If If (Len(StrML) > 0) Then TheEarthQuakeName = TheEarthQuakeName + StrML + "級(jí)地震" End If StrCaption = "震中經(jīng)度:" + Format(fBaseX, "#0.00度")

29、 + Chr(10) + Chr(13) StrCaption = StrCaption + "震中緯度:" + Format(fBaseY, "#0.00度") + Chr(10) + Chr(13) StrCaption = StrCaption + "震 級(jí):" + StrML + Chr(10) + Chr(13) StrCaption = StrCaption + "發(fā)震時(shí)間:" + Left(StrTime, 4) + "年" + Mid(StrTime, 5, 2) + "

30、;月" + Mid(StrTime, 7, 2) + "日" + Chr(10) + Chr(13) StrCaption = StrCaption + TheEarthQuakeNameT + Chr(10) + Chr(13) StrCaption = StrCaption + StrTemp ShowZZDM.Label1.Caption = StrCaption ShowZZDM.ShowEnd Sub.實(shí)例在VB中調(diào)出712SearchDM搜索地名.vbg,運(yùn)行主選單【搜索震中地名】,輸入經(jīng)緯度,單擊【確定】按鈕,即可查出地名,如圖8-27所示。由于地理

31、數(shù)據(jù)所限,本模塊只能查詢“38.541.5、114120”范圍內(nèi)的地名。圖8-27 搜索震中地名8.13 給定地名查找經(jīng)緯度1.功能輸入地名,查找該地名所在地的經(jīng)緯度,一次可查找多個(gè)點(diǎn)。在查找中如果有多個(gè)地名匹配,則彈出選擇對(duì)話框,供用戶選擇。2.子程序語(yǔ)句Public Sub SearchLocalName(MapInfo As Object, TheInstallPath As String, TableXm As String, TableJMD As String, LocalName() As String, NameSM() As String, NameXM() As Strin

32、g, NameJMD() As String, Lat() As Double, Lon() As Double, N As Integer)3.參數(shù)說(shuō)明l MapInfo:輸入?yún)?shù),MapInfo對(duì)象。l TheInstallPath:輸入?yún)?shù), TableXm和TableJMD表存放路徑。l TableXm:輸入?yún)?shù),縣名表名,參見(jiàn)書(shū)附光盤(pán)813SearchDM知識(shí)庫(kù)中國(guó)縣界_首都圈.tab。l TableJMD:輸入?yún)?shù),居名點(diǎn)表名,參見(jiàn)書(shū)附光盤(pán)813SearchDM知識(shí)庫(kù)中國(guó)居名點(diǎn)_首都圈.tab。l NameSM()、NameXM()、NameJMD():輸出參數(shù),查出的數(shù)據(jù)庫(kù)中的省

33、名、縣名、居名點(diǎn)名。l Lat()、Lon():輸出參數(shù),查出的經(jīng)緯數(shù)據(jù)。l N:輸入?yún)?shù),需要查詢的地名數(shù)。4.子程序源程序參見(jiàn)書(shū)附光盤(pán)813SearchLonLatMapSIS.vbp。 在VB中調(diào)出該程序,運(yùn)行主選單【查找經(jīng)緯度】即可查找給定地名的經(jīng)緯度。查找最近地名的主要程序如下。Public Sub SearchLocalName(MapInfo As Object, TheInstallPath As String, TableXm As String, TableJMD As String, LocalName() As String, NameSM() As String, N

34、ameXM() As String, NameJMD() As String, Lat() As Double, Lon() As Double, N As Integer) Dim I As Integer, J As Integer Dim LocalNameT As String, TableXmt As String, TableJMDt As String Dim EraseXM As Boolean, EraseJMD As String Dim LocalNameOld As String On Error Resume Next TableXmt = Left(TableXm,

35、 Len(TableXm) - 4) TableJMDt = Left(TableJMD, Len(TableJMD) - 4) MapInfo.do "Set Distance Units ""km""" MapInfo.do "Set CoordSys Earth Projection 1, 0" 'Begin判斷有無(wú)中國(guó)縣名表、居民點(diǎn)表 EraseXM = False EraseJMD = False DirFile = "" DirFile = MapInfo.eval(&quo

36、t;TableInfo(" & TableXmt & ",5)") If (DirFile = "") Then MapInfo.do "Open Table """ & TheInstallPath & TableXm & """ Interactive" MapInfo.do "Add Map Auto Layer " & TableXmt EraseXM = True End If DirFi

37、le = "" DirFile = MapInfo.eval("TableInfo(" & TableJMDt & ",5)") If (DirFile = "") Then MapInfo.do "Open Table """ & TheInstallPath & TableJMD & """ Interactive" MapInfo.do "Add Map Auto Layer &q

38、uot; & TableJMDt EraseJMD = True End If 'End判斷有無(wú)中國(guó)縣名表、居民點(diǎn)表 LocalNameOld = "asdasdk2323" For I = 1 To N LocalNameT = Trim(LocalName(I) If (LocalNameT = LocalNameOld) Then NameSM(I) = NameSM(I - 1) NameXM(I) = NameXM(I - 1) NameJMD(I) = NameJMD(I - 1) Lon(I) = Lon(I - 1) Lat(I) = Lat

39、(I - 1) Else LocalNameOld = LocalNameT '搜索縣名 MapInfo.do "Select * From " & TableXmt & " where InStr(1,縣市名,""" & LocalNameT & """)>0 into Selection" MultiN = Val(MapInfo.eval("SelectionInfo(3)") If (MultiN = 1) Then &#

40、39;搜索到縣名 NameSM(I) = MapInfo.eval("Selection.Col1") NameXM(I) = MapInfo.eval("Selection.col2") NameJMD(I) = "" Lon(I) = Val(MapInfo.eval("ObjectGeography(Selection.obj,1)") Lat(I) = Val(MapInfo.eval("ObjectGeography(Selection.obj,2)") ElseIf (MultiN

41、> 1) Then '搜索到多個(gè)縣名 ReDim NameSMt(1 To MultiN), NameXMt(1 To MultiN), NameJMDt(1 To MultiN), NameLatT(1 To MultiN), NameLonT(1 To MultiN) For J = 1 To MultiN MapInfo.do "Fetch Rec " & J & " From Selection" NameSMt(J) = MapInfo.eval("Selection.Col1") NameXM

42、t(J) = MapInfo.eval("Selection.col2") NameJMDt(J) = "" NameLonT(J) = Val(MapInfo.eval("ObjectGeography(Selection.obj,1)") NameLatT(J) = Val(MapInfo.eval("ObjectGeography(Selection.obj,2)") Next J LocalNameMark = LocalNameT Screen.MousePointer = 0 FrmSearchName

43、.Show 1 Screen.MousePointer = 11 If (MultiNo >= 1) Then NameSM(I) = NameSMt(MultiNo) NameXM(I) = NameXMt(MultiNo) NameJMD(I) = NameJMDt(MultiNo) Lon(I) = NameLonT(MultiNo) Lat(I) = NameLatT(MultiNo) Else NameSM(I) = "無(wú)信息" NameXM(I) = "無(wú)信息" NameJMD(I) = "無(wú)信息" Lat(I) =

44、 0# Lon(I) = 0# End If Else '未搜索到縣名,搜索居名點(diǎn) MapInfo.do "Select * From " & TableJMDt & " where InStr(1,居民點(diǎn),""" & LocalNameT & """)>0 into Selection" MultiN = Val(MapInfo.eval("SelectionInfo(3)") If (MultiN = 1) Then Name

45、SM(I) = MapInfo.eval("Selection.Col1") NameXM(I) = MapInfo.eval("Selection.col2") NameJMD(I) = MapInfo.eval("Selection.col3") Lon(I) = Val(MapInfo.eval("ObjectGeography(Selection.obj,1)") Lat(I) = Val(MapInfo.eval("ObjectGeography(Selection.obj,2)")

46、ElseIf (MultiN > 1) Then ReDim NameSMt(1 To MultiN), NameXMt(1 To MultiN), NameJMDt(1 To MultiN), NameLatT(1 To MultiN), NameLonT(1 To MultiN) For J = 1 To MultiN MapInfo.do "Fetch Rec " & J & " From Selection" NameSMt(J) = MapInfo.eval("Selection.Col1") Name

47、XMt(J) = MapInfo.eval("Selection.col2") NameJMDt(J) = MapInfo.eval("Selection.col3") NameLonT(J) = Val(MapInfo.eval("ObjectGeography(Selection.obj,1)") NameLatT(J) = Val(MapInfo.eval("ObjectGeography(Selection.obj,2)") Next J LocalNameMark = LocalNameT Screen.

48、MousePointer = 0 FrmSearchName.Show 1 Screen.MousePointer = 11 If (MultiNo >= 1) Then NameSM(I) = NameSMt(MultiNo) NameXM(I) = NameXMt(MultiNo) NameJMD(I) = NameJMDt(MultiNo) Lon(I) = NameLonT(MultiNo) Lat(I) = NameLatT(MultiNo) Else NameSM(I) = "無(wú)信息" NameXM(I) = "無(wú)信息" NameJMD

49、(I) = "無(wú)信息" Lat(I) = 0# Lon(I) = 0# End If Else NameSM(I) = "無(wú)信息" NameXM(I) = "無(wú)信息" NameJMD(I) = "無(wú)信息" Lat(I) = 0# Lon(I) = 0# End If End If End If Next I Erase NameSMt, NameXMt, NameJMDt, NameLatT, NameLonT If (EraseXM = True) Then MapInfo.do "Close Tabl

50、e " & TableXmt & " Interactive" End If If (EraseJMD = True) Then MapInfo.do "Close Table " & TableJMDt & " Interactive" End If If (N > 1) Then MsgBox "搜索完畢!", vbOKOnly, "關(guān)于搜索地名" End IfEnd Sub8.14 并集、交集、補(bǔ)集及環(huán)形緩沖區(qū)制作8.14.1 環(huán)形緩沖區(qū)、緩

51、沖交匯區(qū)1.功能求選中的多個(gè)線條或區(qū)域的環(huán)形緩沖區(qū)、緩沖交匯區(qū),需要輸入內(nèi)環(huán)半徑、外環(huán)半徑等參數(shù)。2.相關(guān)程序語(yǔ)句源程序參見(jiàn)書(shū)附光盤(pán)814BufferMapBufferMapBuffer.vbp。處理環(huán)形緩沖區(qū)、緩沖交匯區(qū)的主要程序如下。Private Sub CommandOK_Click() Dim N As Integer, N1 As Integer, N2 As Integer, I As Integer, J As Integer, K As Integer, TF As String * 1 On Error Resume Next Me.Visible = False Scre

52、en.MousePointer = 11 If (Val(TextRmin.Text) < Val(TextRmax) Then BufferRmin = Val(TextRmin.Text) BufferRmax = Val(TextRmax.Text) Else BufferRmax = Val(TextRmin.Text) BufferRmin = Val(TextRmax.Text) End If If (BufferRmin <= 0) Then BufferRmin = 10 If (BufferRmax <= 0) Then BufferRmax = 20 Bu

53、fferResolution = Val(TextResolution.Text) If (BufferResolution <= 0) Then BufferResolution = 12 If (OptionBufferType(0).Value = True) Then BufferType = 0 Else BufferType = 1 End If If (InterCaption = "環(huán)形緩沖區(qū)") Then If (BufferRmin = BufferRmax) Then '一般緩沖區(qū) If (BufferType = 0) Then 

54、9;為所有對(duì)象建立一個(gè)緩沖區(qū) MapInfo.Do "Create Object As Buffer From Selection Into Table " & TableName & " Width " & BufferRmin & " Units ""km"" Type Spherical Resolution " & BufferResolution Else '為每個(gè)對(duì)象各建立一個(gè)緩沖區(qū) MapInfo.Do "Create Object As Buffer From Selection Into Table " & TableName & " Width " & BufferRmin & " Unit

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論