<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Coordinates transformation in ArcGIS Engine in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/coordinates-transformation-in-arcgis-engine/m-p/112353#M2939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm geeting this from my gps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$GPRMC,092313.299,A,2238.8947,N,11355.2253,E,0.00,311.19,010307,0,,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is read this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UTC Time: 09:23 13.299&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(A) Data is valid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Latitude: 22°38.8947???,North&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Longitude: 113°55.2253???,East&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Speed: 0.00 (sea mile) 1mile=1852meter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Course: 311.19&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date: 01032007&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a way to transform the latitude and the longitude directly in ArcGIS Engine so the ArcGIS Desktop read it with no problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greetings...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Sep 2011 20:53:30 GMT</pubDate>
    <dc:creator>RoderickIglesias</dc:creator>
    <dc:date>2011-09-30T20:53:30Z</dc:date>
    <item>
      <title>Coordinates transformation in ArcGIS Engine</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/coordinates-transformation-in-arcgis-engine/m-p/112353#M2939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm geeting this from my gps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;$GPRMC,092313.299,A,2238.8947,N,11355.2253,E,0.00,311.19,010307,0,,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is read this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;UTC Time: 09:23 13.299&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(A) Data is valid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Latitude: 22°38.8947???,North&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Longitude: 113°55.2253???,East&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Speed: 0.00 (sea mile) 1mile=1852meter&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Course: 311.19&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date: 01032007&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a way to transform the latitude and the longitude directly in ArcGIS Engine so the ArcGIS Desktop read it with no problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greetings...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 20:53:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/coordinates-transformation-in-arcgis-engine/m-p/112353#M2939</guid>
      <dc:creator>RoderickIglesias</dc:creator>
      <dc:date>2011-09-30T20:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinates transformation in ArcGIS Engine</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/coordinates-transformation-in-arcgis-engine/m-p/112354#M2940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi there,&lt;BR /&gt; &lt;BR /&gt;I'm geeting this from my gps:&lt;BR /&gt;$GPRMC,092313.299,A,2238.8947,N,11355.2253,E,0.00,311.19,010307,0,,&lt;BR /&gt; &lt;BR /&gt;this is read this way:&lt;BR /&gt;UTC Time: 09:23 13.299&lt;BR /&gt;(A) Data is valid&lt;BR /&gt;Latitude: 22°38.8947�?�,North&lt;BR /&gt;Longitude: 113°55.2253�?�,East&lt;BR /&gt;Speed: 0.00 (sea mile) 1mile=1852meter&lt;BR /&gt;Course: 311.19&lt;BR /&gt;Date: 01032007&lt;BR /&gt; &lt;BR /&gt;There is a way to transform the latitude and the longitude directly in ArcGIS Engine so the ArcGIS Desktop read it with no problem?&lt;BR /&gt; &lt;BR /&gt;Thanks in advance.&lt;BR /&gt; &lt;BR /&gt;Greetings...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use the Strings.Split method to split the $GPRMC sentences into separate words, e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;Private&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;Sub&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt; commEvents_DataReceived(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;ByVal&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt; sender &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;As&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;Object&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;ByVal&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt; e &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;As &lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;System.IO.Ports.SerialDataReceivedEventArgs) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;Handles&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt; commEvents.DataReceived&lt;/SPAN&gt;
Dim strInput as String &lt;SPAN style="font-size:2;"&gt;= comm3.ReadLine&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;
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
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:43:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/coordinates-transformation-in-arcgis-engine/m-p/112354#M2940</guid>
      <dc:creator>JeffMatson</dc:creator>
      <dc:date>2021-12-11T06:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinates transformation in ArcGIS Engine</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/coordinates-transformation-in-arcgis-engine/m-p/112355#M2941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeff, thanks for your post...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I already got the part that make the split when the string&amp;nbsp; gets to the server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The post that I wrote focus on the longitude and latitude that came in this form:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2238.8947,N,11355.2253,E&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and is read in this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Latitude: 22°38.8947�?�,North&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Longitude: 113°55.2253�?�,East&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to transfom the coordinates from DMS to Decimal Degrees.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry if I wasn't specified enough before.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2011 18:35:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/coordinates-transformation-in-arcgis-engine/m-p/112355#M2941</guid>
      <dc:creator>RoderickIglesias</dc:creator>
      <dc:date>2011-10-03T18:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinates transformation in ArcGIS Engine</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/coordinates-transformation-in-arcgis-engine/m-p/112356#M2942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Jeff, thanks for your post...&lt;BR /&gt; &lt;BR /&gt;I already got the part that make the split when the string gets to the server.&lt;BR /&gt; &lt;BR /&gt;The post that I wrote focus on the longitude and latitude that came in this form:&lt;BR /&gt;2238.8947,N,11355.2253,E&lt;BR /&gt; &lt;BR /&gt;and is read in this way:&lt;BR /&gt;Latitude: 22°38.8947�?�,North&lt;BR /&gt;Longitude: 113°55.2253�?�,East&lt;BR /&gt; &lt;BR /&gt;I need to transfom the coordinates from DMS to Decimal Degrees.&lt;BR /&gt; &lt;BR /&gt;Sorry if I wasn't specified enough before.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks like your Lat/Long is in Decimal Minutes, so first split them out into the individual units:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;22 (Degrees)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;38.8947 (Decimal minutes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then divide the decimal minutes by 60 and add it back to the degrees:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(38.8947 / 60) + 22 = 22.648245 decimal degrees&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #008000; font-size: 2;"&gt;
'parse the Lat/Lon input into whole degrees and remainders (decimal minutes in this case)
&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;strLatDeg = Strings.Left(strLat, (Strings.InStr(strLat, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 2;"&gt;"."&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;) - 3))
strLatRem = Strings.Right(strLat, Strings.Len(strLat) - (Strings.InStr(strLat, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 2;"&gt;"."&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;) - 3))
strLonDeg = Strings.Left(strLon, (Strings.InStr(strLon, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 2;"&gt;"."&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;) - 3))
strLonRem = Strings.Right(strLon, Strings.Len(strLon) - (Strings.InStr(strLon, &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 2;"&gt;"."&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;) - 3))
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 2;"&gt;'convert the strings into double and divide the remainder by 60
&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;dblLatDeg = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;CType&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;(strLatDeg, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;Double&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;)
dblLatRem = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;CType&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;(strLatRem, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;Double&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;) / 60
dblLonDeg = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;CType&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;(strLonDeg, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;Double&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;)
dblLonRem = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;CType&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;(strLonRem, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 2;"&gt;Double&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;) / 60
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 2;"&gt;'put into decimal degrees
&lt;/SPAN&gt;&lt;SPAN style="font-size:2;"&gt;Lat = dblLatDeg + dblLatRem
Lon = dblLonDeg + dblLonRem
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:43:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/coordinates-transformation-in-arcgis-engine/m-p/112356#M2942</guid>
      <dc:creator>JeffMatson</dc:creator>
      <dc:date>2021-12-11T06:43:09Z</dc:date>
    </item>
  </channel>
</rss>

