Hi Jeff, thanks for your post...I already got the part that make the split when the string gets to the server.The post that I wrote focus on the longitude and latitude that came in this form:2238.8947,N,11355.2253,Eand is read in this way:Latitude: 22°38.8947�?�,NorthLongitude: 113°55.2253�?�,EastI need to transfom the coordinates from DMS to Decimal Degrees.Sorry if I wasn't specified enough before.
'parse the Lat/Lon input into whole degrees and remainders (decimal minutes in this case) strLatDeg = Strings.Left(strLat, (Strings.InStr(strLat, ".") - 3)) strLatRem = Strings.Right(strLat, Strings.Len(strLat) - (Strings.InStr(strLat, ".") - 3)) strLonDeg = Strings.Left(strLon, (Strings.InStr(strLon, ".") - 3)) strLonRem = Strings.Right(strLon, Strings.Len(strLon) - (Strings.InStr(strLon, ".") - 3)) 'convert the strings into double and divide the remainder by 60 dblLatDeg = CType(strLatDeg, Double) dblLatRem = CType(strLatRem, Double) / 60 dblLonDeg = CType(strLonDeg, Double) dblLonRem = CType(strLonRem, Double) / 60 'put into decimal degrees Lat = dblLatDeg + dblLatRem Lon = dblLonDeg + dblLonRem
Hi there,I'm geeting this from my gps:$GPRMC,092313.299,A,2238.8947,N,11355.2253,E,0.00,311.19,010307,0,,this is read this way:UTC Time: 09:23 13.299(A) Data is validLatitude: 22°38.8947�?�,NorthLongitude: 113°55.2253�?�,EastSpeed: 0.00 (sea mile) 1mile=1852meterCourse: 311.19Date: 01032007There is a way to transform the latitude and the longitude directly in ArcGIS Engine so the ArcGIS Desktop read it with no problem?Thanks in advance.Greetings...
PrivateSub commEvents_DataReceived(ByVal sender AsObject, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles commEvents.DataReceived Dim strInput as String = comm3.ReadLine Dim words() As String Dim i As Integer 'split the input into words words = Strings.Split(strInput, ",") For i = 0 To 9 Select Case i Case 1 strUTCTime = words(i) Case 2 strValid = words(i) Case 3 strLat = words(i) Case 4 strNS = words(i) Case 5 strLon = words(i) Case 6 strEW = words(i) Case 7 strSpdKnots = words(i) Case 8 strHeading = words(i) Case 9 strUTCDate = words(i) End Select Next i '... 'etc '... End Sub
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.