<?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: Coordinate conversion in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33719#M2630</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So wouldn't your workflow simply be:&lt;BR /&gt;&lt;BR /&gt;1. Make your XY event layer specifying NAD 27 LL as the SR&lt;BR /&gt;2. Project the event layer to web mercator specifying the proper datum transformation - output would be an on-disk featureclass.&lt;BR /&gt;&lt;BR /&gt;?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tried that, but with no luck. Ended up calling ESRI support and the tech I spoke with couldn't get the tool to work they are researching it now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 May 2013 00:41:44 GMT</pubDate>
    <dc:creator>MarkPaulson</dc:creator>
    <dc:date>2013-05-07T00:41:44Z</dc:date>
    <item>
      <title>Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33712#M2623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I manually import a CSV to create a table which I use to make an XY event layer during the creat process I can select the coordinate system of my CSV (NAD 27 LL) and the transformation to use for the conversion to the data frame (Web Mercator). I have been reading about the make xy event functionality, but I am missing the transformation part.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2013 02:31:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33712#M2623</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2013-04-29T02:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33713#M2624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I could be wrong, but I'm 99% sure you need to use the Project tool (using the xy event layer as input) to properly apply datum transformations for xy event layers. Note that for whatever reason you cannot use the in_memory workspace as an output workspace for the Project tool, but you can use the scratch workspace (arcpy.env.scratchGDB).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another option would be to apply the coordinate/datum transformation directly to the coordinates in your .csv file wth the Convert Coordinate Notation tool. See: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000tw000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000tw000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;According to the help, this tool will pick the "correct" datum transformation for you.... Perhaps the Make XY Event Layer tool does this also, but I'm not sure...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2013 16:28:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33713#M2624</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2013-04-29T16:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33714#M2625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Create a geodatabase with a feature dataset in the projection you want it to be.&amp;nbsp; the export your event to that feature dataset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I manually import a CSV to create a table which I use to make an XY event layer during the creat process I can select the coordinate system of my CSV (NAD 27 LL) and the transformation to use for the conversion to the data frame (Web Mercator). I have been reading about the make xy event functionality, but I am missing the transformation part.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Apr 2013 19:07:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33714#M2625</guid>
      <dc:creator>RobertBorchert</dc:creator>
      <dc:date>2013-04-29T19:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33715#M2626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Create a geodatabase with a feature dataset in the projection you want it to be.&amp;nbsp; the export your event to that feature dataset.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; Not sure I follow. I want to import a CSV into and existing data set. Does the MakeXYEventLayer_management spatial reference option take care of this on the fly?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 May 2013 11:54:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33715#M2626</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2013-05-01T11:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33716#M2627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I could be wrong, but I'm 99% sure you need to use the Project tool (using the xy event layer as input) to properly apply datum transformations for xy event layers. Note that for whatever reason you cannot use the in_memory workspace as an output workspace for the Project tool, but you can use the scratch workspace (arcpy.env.scratchGDB).&lt;BR /&gt;&lt;BR /&gt;Another option would be to apply the coordinate/datum transformation directly to the coordinates in your .csv file wth the Convert Coordinate Notation tool. See: &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000tw000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000tw000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;According to the help, this tool will pick the "correct" datum transformation for you.... Perhaps the Make XY Event Layer tool does this also, but I'm not sure...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The convert tool does not support web mercator. I will check on the project tool. I think the MakeXYEventLayer_management spatial reference option will do what I want but I have not had time to check.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 May 2013 11:58:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33716#M2627</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2013-05-01T11:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33717#M2628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I manually import a CSV to create a table which I use to make an XY event layer during the creat process I can select the coordinate system of my CSV (NAD 27 LL) and the transformation to use for the conversion to the data frame (Web Mercator). I have been reading about the make xy event functionality, but I am missing the transformation part. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So wouldn't your workflow simply be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Make your XY event layer specifying NAD 27 LL as the SR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Project the event layer to web mercator specifying the proper datum transformation - output would be an on-disk featureclass.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 May 2013 15:01:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33717#M2628</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2013-05-01T15:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33718#M2629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You might need to project your data 2 times.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;First project it from NAD27 (source) to NAD83(destination) using right transformation for your region (for US excluding Alaska and Hawaii I gues it should be "NAD_1927_To_NAD_1983_NADCON").&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;After that grab new projected dataset and project it again from NAD83 to WebMercator using transformation for your region (again for US states other then Alaska and Hawaii it should be WGS_1984_(ITRF00)_To_NAD_1983).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's all possible using ArcPy Project_Managment function. I am not sure though if event layer can be used with this logic...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 20:47:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33718#M2629</guid>
      <dc:creator>SlavisaCeremidzic</dc:creator>
      <dc:date>2013-05-06T20:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33719#M2630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;So wouldn't your workflow simply be:&lt;BR /&gt;&lt;BR /&gt;1. Make your XY event layer specifying NAD 27 LL as the SR&lt;BR /&gt;2. Project the event layer to web mercator specifying the proper datum transformation - output would be an on-disk featureclass.&lt;BR /&gt;&lt;BR /&gt;?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tried that, but with no luck. Ended up calling ESRI support and the tech I spoke with couldn't get the tool to work they are researching it now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 00:41:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33719#M2630</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2013-05-07T00:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33720#M2631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You might need to project your data 2 times.&lt;BR /&gt;First project it from NAD27 (source) to NAD83(destination) using right transformation for your region (for US excluding Alaska and Hawaii I gues it should be "NAD_1927_To_NAD_1983_NADCON").&lt;BR /&gt;After that grab new projected dataset and project it again from NAD83 to WebMercator using transformation for your region (again for US states other then Alaska and Hawaii it should be WGS_1984_(ITRF00)_To_NAD_1983).&lt;BR /&gt;It's all possible using ArcPy Project_Managment function. I am not sure though if event layer can be used with this logic...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shouldn't have to as it transforms fine in desktop...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 00:45:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33720#M2631</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2013-05-07T00:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33721#M2632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a reason you're using an event layer in desktop?&amp;nbsp; The below code could be modified to simply write the geometries into a new feature class rather than printing the values.&amp;nbsp; It's untested code, but should be pretty close.&amp;nbsp; It reprojects each row of your csv file into the new coordinate system with the transformation and prints it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
infile = open("yourfilename.csv","r")
for line in iter(infile):
 aRow = line.split(',')
 point = arcpy.Point()
 point.X = aRow[5] #array position of X value
 point.Y = aRow[6] #array position of Y value
 inputSR = arcpy.SpatialReference("c:/coordsystems/NAD 1983.prj")
 outputSR = arcpy.SpatialReference("c:/coordsystems/NAD 1927.prj")
 pointGeometry = arcpy.PointGeometry(point,inputSR)
 projectedPointGeometry = pointGeometry.projectAs(outputSR,"Name_Of_The_Transformation")
 outputPoint = projectedPointGeomtry.centroid
 print outputPoint.X,outputPoint.Y
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:19:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33721#M2632</guid>
      <dc:creator>TimDine</dc:creator>
      <dc:date>2021-12-10T21:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33722#M2633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;.projectAs(outputSR,"Name_Of_The_Transformation")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll have to remember that one...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 16:43:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33722#M2633</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2013-05-07T16:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33723#M2634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is there a reason you're using an event layer in desktop?&amp;nbsp; The below code could be modified to simply write the geometries into a new feature class rather than printing the values.&amp;nbsp; It's untested code, but should be pretty close.&amp;nbsp; It reprojects each row of your csv file into the new coordinate system with the transformation and prints it out.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
infile = open("yourfilename.csv","r")
for line in iter(infile):
 aRow = line.split(',')
 point = arcpy.Point()
 point.X = aRow[5] #array position of X value
 point.Y = aRow[6] #array position of Y value
 inputSR = arcpy.SpatialReference("c:/coordsystems/NAD 1983.prj")
 outputSR = arcpy.SpatialReference("c:/coordsystems/NAD 1927.prj")
 pointGeometry = arcpy.PointGeometry(point,inputSR)
 projectedPointGeometry = pointGeometry.projectAs(outputSR,"Name_Of_The_Transformation")
 outputPoint = projectedPointGeomtry.centroid
 print outputPoint.X,outputPoint.Y
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason I am using the XY event layer is that it the manual process that I use and I have a schema.ini file that I use for the field formatting from my CSV. The bigger reason is that I am a beginner at Python and I barely have an idea what you are doing with the above code. I did try to modify it, but that started sending me down some other rabbit holes. For some reason, one of the fields&amp;nbsp; causes the position of the X and Y to move on some lines. Trying to figure this out is not a task I'm ready to tackle. Thank you for your input though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On another note, the project tool will work with the an event layer created with the "Display XY Data" option in desktop, but it will not work with "MakeXYEventLayer_management" in arcpy. I can try and project the feature class in desktop and it always fails.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:19:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33723#M2634</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2021-12-10T21:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate conversion</title>
      <link>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33724#M2635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all, I'm an idiot, I spent hours trying to figure this out and the whole time I had my X &amp;amp; Y reversed. The MakeXYEventLayer_management works perfectly. I'm a dumb a__. Now all I have to do is figure out how to export to the database with the correct coordinate system.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 21:02:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/coordinate-conversion/m-p/33724#M2635</guid>
      <dc:creator>MarkPaulson</dc:creator>
      <dc:date>2013-05-07T21:02:46Z</dc:date>
    </item>
  </channel>
</rss>

