<?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 coordinates in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/1008007#M20223</link>
    <description>&lt;P&gt;Good morning everyone! I would like to ask if there is a way to define my coordinates, taking into account that I don't know their coordinates system. Is there a way to determine it? All I have is an xls file. Thank you very much for your collaboration!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Dec 2020 11:32:43 GMT</pubDate>
    <dc:creator>ΣταυρούλαΓιαννακοπούλου</dc:creator>
    <dc:date>2020-12-09T11:32:43Z</dc:date>
    <item>
      <title>Converting coordinates</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666056#M17869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am listening to the OnMouseDown event of my IMapControl4, and the IMapControlEvents2_OnMouseDownEvent provides a mapX and mapY. How do I convert this coordinate to WGS84? I need to interface with another 3rd party library that requires WGS84 coordinates as its input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;George Faraj&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 21:02:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666056#M17869</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-09-24T21:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Converting coordinates</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666057#M17870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need to project the data to that coordinate system.&amp;nbsp; The map x, y passed into the event are in whatever coordinate system the map is in, so just create a new point object, give it the same spatial reference as the map and set the x, y properties.&amp;nbsp; Then call Project and pass in the spatial reference you want to project it to.&amp;nbsp; You can get this spatial reference object from ISpatialReferenceFactory.CreateGeographicCoordinateSystem.&amp;nbsp; After calling Project, the x, y properties will have the updated coordinates.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 12:46:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666057#M17870</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2012-09-25T12:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Converting coordinates</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666058#M17871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Neil. That helped. I wrote the following method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;public static IPoint GetLatLngPointsFromMapPoints(this IActiveView view, IMapControl4 map, double controlX, double controlY)
{
 var mapPoint = new PointClass();
 mapPoint.SpatialReference = map.SpatialReference;
 mapPoint.PutCoords(controlX, controlY);

 if (mapPoint.SpatialReference.Name == "Unknown")
 {
&amp;nbsp; mapPoint.SpatialReference = view.ScreenDisplay.DisplayTransformation.ToMapPoint(0, 0).SpatialReference;
 }
 if (double.IsNaN(mapPoint.Z))
 {
&amp;nbsp; mapPoint.Z = 0;
 }

 if (mapPoint.SpatialReference.Name == "Unknown")
 {
&amp;nbsp; return null;
 }

 var spatialRefFactory = new SpatialReferenceEnvironment();
 var geoCoordSystem = spatialRefFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
 mapPoint.Project(geoCoordSystem);
 return mapPoint;
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I'm getting values like -122.545187727749 and 45.6971389559235. Not sure if these are degrees or if they are just incorrect. Does this sound right to you?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:08:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666058#M17871</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2021-12-12T04:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Converting coordinates</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666059#M17872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Without knowing what your original coordinate system and coordinates are I can't tell you if those values are correct or not.&amp;nbsp; The results you're getting will be in decimal degrees since you are projecting into a geographic coordinate system.&amp;nbsp; Remember that when expressed as x, y coordinates of a point that x = longitude and y = latitude.&amp;nbsp; Longitude values range from 0 to 180 with positive values being measured East and negative values being measured West.&amp;nbsp; Latitude values range from 0 to 90 with positive values being measured North and negative values being measured South.&amp;nbsp; The coordinates you posted are near Vancouver, Canada.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 18:20:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666059#M17872</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2012-09-25T18:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Converting coordinates</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666060#M17873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Alright, so I think I have the correct coordinates in degrees now. Thanks a lot!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 18:31:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/666060#M17873</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-09-25T18:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Converting coordinates</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/1008007#M20223</link>
      <description>&lt;P&gt;Good morning everyone! I would like to ask if there is a way to define my coordinates, taking into account that I don't know their coordinates system. Is there a way to determine it? All I have is an xls file. Thank you very much for your collaboration!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2020 11:32:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/converting-coordinates/m-p/1008007#M20223</guid>
      <dc:creator>ΣταυρούλαΓιαννακοπούλου</dc:creator>
      <dc:date>2020-12-09T11:32:43Z</dc:date>
    </item>
  </channel>
</rss>

