📄 geocode.frm
字号:
VERSION 5.00
Object = "{9BD6A640-CE75-11D1-AF04-204C4F4F5020}#2.0#0"; "mo20.ocx"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form frmGeocode
Caption = "Matching with ZipCodes"
ClientHeight = 7752
ClientLeft = 432
ClientTop = 900
ClientWidth = 7656
Icon = "Geocode.frx":0000
LinkTopic = "Form1"
ScaleHeight = 7752
ScaleWidth = 7656
Begin ComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 336
Left = 0
TabIndex = 14
Top = 0
Width = 7656
_ExtentX = 13504
_ExtentY = 593
ButtonWidth = 508
ButtonHeight = 466
Appearance = 1
ImageList = "ImageList1"
_Version = 327682
BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}
NumButtons = 9
BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "btnFullExtent"
Object.ToolTipText = "Full Extent"
Object.Tag = ""
ImageIndex = 1
EndProperty
BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "btnZoomOut"
Object.ToolTipText = "Zoom Out 2X"
Object.Tag = ""
ImageIndex = 2
EndProperty
BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
Style = 3
MixedState = -1 'True
EndProperty
BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "btnZoomIn"
Object.ToolTipText = "Zoom In"
Object.Tag = ""
ImageIndex = 3
Style = 2
EndProperty
BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "btnPan"
Object.ToolTipText = "Pan"
Object.Tag = ""
ImageIndex = 4
Style = 2
EndProperty
BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
Style = 3
MixedState = -1 'True
EndProperty
BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "btnBatch"
Object.ToolTipText = "Batch Match"
Object.Tag = ""
ImageIndex = 5
EndProperty
BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7}
Object.Tag = ""
Style = 3
MixedState = -1 'True
EndProperty
BeginProperty Button9 {0713F354-850A-101B-AFC0-4210102A8DA7}
Key = "btnStand"
Object.ToolTipText = "Address Standardization"
Object.Tag = ""
ImageIndex = 6
EndProperty
EndProperty
End
Begin VB.Frame Frame5
Caption = "4. Review and locate the candidates"
Height = 4695
Left = 84
TabIndex = 12
Top = 3000
Width = 7455
Begin MapObjects2.Map Map1
Height = 3972
Left = 108
TabIndex = 10
Top = 600
Width = 7212
_Version = 131072
_ExtentX = 12726
_ExtentY = 7011
_StockProps = 225
BackColor = 16777215
BorderStyle = 1
Appearance = 1
Contents = "Geocode.frx":030A
End
Begin VB.ComboBox cboCand
Height = 315
Left = 120
TabIndex = 9
Text = "cboCand"
Top = 240
Width = 7215
End
End
Begin VB.Frame Frame4
Caption = "3. Perform the match"
Height = 960
Left = 84
TabIndex = 5
Top = 1992
Width = 7455
Begin VB.CheckBox chkAmbiguous
Caption = "Ambiguous match?"
Height = 255
Left = 2748
TabIndex = 8
Top = 576
Width = 1815
End
Begin VB.TextBox txtStatus
Enabled = 0 'False
Height = 285
Left = 2784
TabIndex = 7
Top = 264
Width = 3855
End
Begin VB.CommandButton cmdFindCand
Caption = "&Find Candidates"
Height = 375
Left = 216
TabIndex = 6
Top = 348
Width = 1335
End
Begin VB.Label Match
AutoSize = -1 'True
Caption = "Match status:"
Height = 195
Left = 1680
TabIndex = 11
Top = 240
Width = 960
End
End
Begin VB.Frame Frame1
Caption = "1. Enter a zip code"
Height = 615
Left = 120
TabIndex = 0
Top = 480
Width = 7455
Begin VB.TextBox txtAddr
Height = 285
Left = 1464
TabIndex = 1
Text = "92373"
Top = 228
Width = 3960
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "Value to Match:"
Height = 192
Left = 192
TabIndex = 13
Top = 276
Width = 1092
End
End
Begin VB.Frame Frame2
Caption = "2. Specify match options"
Height = 735
Left = 96
TabIndex = 2
Top = 1200
Width = 7455
Begin VB.TextBox txtSpelling
Height = 285
Left = 5364
TabIndex = 15
Text = "50"
Top = 300
Width = 1335
End
Begin VB.TextBox txtMinScore
Height = 285
Left = 2160
TabIndex = 4
Text = "60"
Top = 315
Width = 1215
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Spelling sensitivity:"
Height = 192
Left = 3804
TabIndex = 16
Top = 324
Width = 1320
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Minimum match score:"
Height = 195
Left = 360
TabIndex = 3
Top = 360
Width = 1575
End
End
Begin ComctlLib.ImageList ImageList1
Left = 6816
Top = 3204
_ExtentX = 995
_ExtentY = 995
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 8421376
_Version = 327682
BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7}
NumListImages = 6
BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "Geocode.frx":0324
Key = ""
EndProperty
BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "Geocode.frx":0436
Key = ""
EndProperty
BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "Geocode.frx":0548
Key = ""
EndProperty
BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "Geocode.frx":065A
Key = ""
EndProperty
BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "Geocode.frx":076C
Key = ""
EndProperty
BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7}
Picture = "Geocode.frx":087E
Key = ""
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmGeocode"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'
' frmGeocode - Main form for managing the geocoding of a zip code or place name
'
' Uses zip_usa data off of ESRI CD-rom Data & Maps, originally from GDT's
' 1996 database; 41859 point features in decimal degrees.
'
' Originally part of Geocode.vbp from the MapObjects 2.0 samples.
'
' Author: Andy Bouffard, ESRI(UK) Ltd.; from an original demo by Agatha Tang, ESRI Inc.
' Modified By Victoria Kouyoumjian, ESRI - Redlands, June 1999.
' History: Initial ESRI(UK) version - Nov. 13 1998
'
'
Option Explicit
Private symAddress As New MapObjects2.Symbol
Private gboolPan
Private Sub FillCandList()
'
' The following subroutine fills the candidate list box by looking at the
' Candidate array of the Geocoder object.
'
Dim num As Integer, i As Integer
cboCand.Clear
'
' If there are no candidates found, place a string in the combo box to inform user.
' Otherwise populate the combo with the candidates found in the geocoder's
' candidates array.
'
num = geo.CandidateCount
If num = 0 Then
cboCand.Text = "<no candidates>"
Else
For i = 0 To num - 1
cboCand.AddItem geo.Candidate(i), i
Next i
'
' Select the first candidate (which will always have the highest score)
'
cboCand.ListIndex = 0
End If
End Sub
Private Function IsIndexBuilt()
'
' Checks to see if the geocoder has proper indexing and returns a boolean
'
IsIndexBuilt = geo.IndexStatus = MapObjects2.IndexStatusConstants.mgIndexExists
End Function
Private Sub SetIndexQueries()
'
' Sets the order and precedence of queries on fields that are to be used
' in performing the match.
'
Dim queries As New MapObjects2.Strings
queries.Add "K1?"
Set geo.SearchQueries = queries
If Not geo.Valid Then
MsgBox "The Geocoder is not valid." & vbNewLine & geo.LastError, vbCritical
End
End If
End Sub
Private Sub BuildIndex()
'
' Add index on the zip code field, then build the index
'
Dim queries As New MapObjects2.Strings
If Not IsIndexBuilt Then
'
' Specify the field and index type
'
If Not geo.AddIndex("Zip", "", mgIndexTypeSoundex) Then
MsgBox "Cannot build geocoding index.", vbCritical
End
End If
'
' Build the index (*.gcd)
'
If Not geo.BuildIndices(True) Then
MsgBox "Cannot build geocoding index.", vbCritical
End
Else
MsgBox "Building Index..."
End If
End If
SetIndexQueries
End Sub
Private Sub chkAmbiguous_Click()
'
' Change the MatchWhenAmbiguous property to reflect the current value in the
' corresponding check box
'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -