<?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 Re: Converting Lat/Long to MapPoint in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/converting-lat-long-to-mappoint/m-p/481133#M5918</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting ...&lt;/P&gt;&lt;P&gt;I'll explore it a little further, but on the surface (no pun intended), the only thing that stands out is the fact that GeometryEngine.Project uses a map point with an explicitly defined datum (from WGS 84), while ConvertCoordinate.FromDecimalDegrees does not. I would assume that WGS 84 is used for the conversion, but maybe not (?). Maybe a different datum (surface) is being used for that conversion and that accounts for the difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW - the WKID for NAD 1927 UTM 17N is 26717 (you're missing the middle "7").&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Aug 2016 16:12:36 GMT</pubDate>
    <dc:creator>ThadTilton</dc:creator>
    <dc:date>2016-08-24T16:12:36Z</dc:date>
    <item>
      <title>Converting Lat/Long to MapPoint</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/converting-lat-long-to-mappoint/m-p/481132#M5917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333333; background-color: #f8f8f8;"&gt;When I try to convert a Lat/Long coordinate to a MapPoint (in NAD_1927_UTM_Zone_17N), I am getting two different results.&amp;nbsp; If I use GeometryEngine.Project() from a mapPoint in Wgs84 using lat/long values, I get the location in red.&amp;nbsp; When I use ConvertCoordinate.FromDecimalDegrees(), I get the blue point.&amp;nbsp; Why is there this difference?&amp;nbsp; I tried using ArcMap to locate lat/long, it gives the same location as the ConvertCoordinate class.&amp;nbsp; Funny thing is when I tried it with Google, it matches the red point.&amp;nbsp; So which is correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt; latitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Parse&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LatText&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Text&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt; longitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Parse&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LongText&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Text&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
SpatialReference spref &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;SpatialReference&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2617&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// NAD_1927_UTM_Zone_17N&lt;/SPAN&gt;
MapPoint baseMapPoint &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;MapPoint&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;longitude&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; latitude&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SpatialReferences&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Wgs84&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 MapPoint mapPoint1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GeometryEngine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Project&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;baseMapPoint&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spref&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; MapPoint&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 _graphic1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mapPoint1&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
MapPoint mapPoint2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ConvertCoordinate&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FromDecimalDegrees&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Format&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{0},{1}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; latitude&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; longitude&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spref&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 _graphic2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mapPoint2&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:13:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/converting-lat-long-to-mappoint/m-p/481132#M5917</guid>
      <dc:creator>HuyHo</dc:creator>
      <dc:date>2021-12-11T21:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Lat/Long to MapPoint</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/converting-lat-long-to-mappoint/m-p/481133#M5918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting ...&lt;/P&gt;&lt;P&gt;I'll explore it a little further, but on the surface (no pun intended), the only thing that stands out is the fact that GeometryEngine.Project uses a map point with an explicitly defined datum (from WGS 84), while ConvertCoordinate.FromDecimalDegrees does not. I would assume that WGS 84 is used for the conversion, but maybe not (?). Maybe a different datum (surface) is being used for that conversion and that accounts for the difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW - the WKID for NAD 1927 UTM 17N is 26717 (you're missing the middle "7").&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Aug 2016 16:12:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/converting-lat-long-to-mappoint/m-p/481133#M5918</guid>
      <dc:creator>ThadTilton</dc:creator>
      <dc:date>2016-08-24T16:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Lat/Long to MapPoint</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/converting-lat-long-to-mappoint/m-p/481134#M5919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I geeked out with this for a while. Although I still don't have an answer for you, I've found a pattern that points to different "datums" (models of the Earth's surface) being used in the conversions.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I check the converted and projected values for different input coordinates, they match for latitudes between 19.75 and 50.25 N (longitude doesn't seem to be a factor).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here's the code I tested with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt; latitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Parse&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"50.250000"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// No difference if values are between 19.75N and 50.25N&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt; longitude &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;double&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Parse&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"-81.000000"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// 81.0W is the central meridian for UTM 17N&lt;/SPAN&gt;
SpatialReference spref &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;SpatialReference&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;26717&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// NAD_1927_UTM_Zone_17N&lt;/SPAN&gt;
MapPoint baseMapPoint &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;MapPoint&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;longitude&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; latitude&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SpatialReferences&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Wgs84&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

MapPoint mapPoint1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GeometryEngine&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Project&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;baseMapPoint&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spref&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; MapPoint&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
MapPoint mapPoint2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ConvertCoordinate&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FromDecimalDegrees&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Format&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"{0},{1}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; latitude&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; longitude&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spref&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; xDiff &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Abs&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mapPoint2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; mapPoint1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; yDiff &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Abs&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mapPoint2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; mapPoint1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Check the difference in latitude (Y) and longitude (X)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// It is 0 when initial latitude is south of 19.75N or north of 50.25N&lt;/SPAN&gt;
Debug&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Difference X: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; xDiff&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
Debug&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Difference Y: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; yDiff&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:13:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/converting-lat-long-to-mappoint/m-p/481134#M5919</guid>
      <dc:creator>ThadTilton</dc:creator>
      <dc:date>2021-12-11T21:13:55Z</dc:date>
    </item>
  </channel>
</rss>

