Greetings, I am trying to read from a txt or a csv the location of an airport with respect to distance to my location, what happens is that the number of airports is 350,000 and it takes too long, the information could be cut or converted, for example, to sql or so. ...thank you
B4X:
Sub CheckNearbyAirports(path As String, Filename As String, mylat As Double,mylon As Double)
Dim lst As List = File.ReadList(path, Filename)
For i = 0 To lst.size -1
Dim line As String = lst.Get(i)
line = line.Trim.Replace(" ", "")
Dim xyz() As String = Regex.Split(",", line)
Dim airportName As String = xyz(0)
Dim airportLat As Double = xyz(5)
Dim airportLon As Double = xyz(6)
Log(i)
If Abs(mylat-airportLat) < 0.001 Then
Dim distance As Double = HaversineDistance(mylat, mylon , airportLat, airportLon)
If distance < 100 Then
Log("Near to : " & airportName)
End If
End If
Next
End Sub