Developing on a 64 bit box using Visual Studios 2008.
Attempting to Geocode data from a sql server database instead of a flat file.
The error message shown below is thrown when I reach the "usaGeoCoder.Open" line in the sub BatchGeoCode below.
Error on BatchGeoCode - Error Message: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "ThinkGeo.MapSuite.MapSuiteGeocoder.Properties.ExceptionDescription.resources" was correctly embedded or linked into assembly "MapSuiteGeocoder" at compile time, or that all the satellite assemblies required are loadable and fully signed.
The sub was converted to VB.Net from the C# example. I haven't been able to get past this error to debug the rest of the code.
Public Shared Sub BatchGeoCode()
' Define a Stopwatch to measure the batch duration
Dim stopWatch As Stopwatch = New Stopwatch()
stopWatch.Start()
' Define a int to record the success count of batching Geocoding
Dim successCount As Int32 = 0
Dim addressCount As Int32 = 0
Dim usaGeoCoder As UsaGeocoder = New UsaGeocoder()
'Open the geocoder and call the match method then close it
Dim db As VerondiGeocodeLinq2SQLDataContext = New VerondiGeocodeLinq2SQLDataContext(ConnectionStrings.ConnectionStringsInstance.ConnectionString)
Try
Dim Addresses2Geocode = db.csp_Geocode_GetAddresses2Geocode
'addressCount = Addresses2Geocode.Count
usaGeoCoder.Open()
For Each address In Addresses2Geocode
Dim address2Geocode As String = SelectAddressLine2Geocode(address.ADDRESS_1, address.ADDRESS_2)
Dim zip As String = GetFiveDigitZip(address.ZIP)
Dim result As MatchResult = usaGeoCoder.Match(address2Geocode, zip)
If (result.MatchItems.Count > 0) Then
' If the MatchPairs contains the key Street it means we found match on street,
' then we add it to the result DataGrid.
If (result.MatchItems(0).MatchPairs.ContainsKey("Street")) Then
successCount += 1
Dim listItem As String = result.MatchItems(0).MatchPairs("CentroidPoint")
End If 'if (result.MatchItems(0).MatchPairs.ContainsKey("Street"))
successCount += 1
End If 'If (result.MatchItems.Count > 0)
Next
Catch ex As Exception
EventsRecord.ProcedureName = MethodBase.GetCurrentMethod().Name
EventsRecord.SqlExceptionMessage(ex)
Finally
usaGeoCoder.Close()
End Try
stopWatch.Stop()
PopulateBatchResults(addressCount, successCount, stopWatch.ElapsedMilliseconds)
End Sub