<?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: Projection with cursors in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238426#M18547</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The spatial refernce object is the 3rd parameter in the update &amp;amp; search cursor statments (2nd parameer for the insercursor statment). So it would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rows = arcpy.UpdateCursor(fc, "", inCRS)
#instead of
rows = arcpy.UpdateCursor(fc, inCRS)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:00:34 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2021-12-11T12:00:34Z</dc:date>
    <item>
      <title>Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238424#M18545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to the ArcGIS 10 help, one should be able to re-project using cursors thus:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#update cursor to fc and input lat lon&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.UpdateCursor(fc, inCRS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt = arcpy.Point()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.X = lon_value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.Y = lat_value&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.shape = pnt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.shape = pnt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; del row, rows&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #project to outGEOGCS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(fc, outGEOGCS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coord = feat.getPart()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; longitude = coord.X&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; latitude = coord.Y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; del row, rows&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #project to outPROJCS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = arcpy.SearchCursor(fc, outPROJCS)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.shape&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coord = feat.getPart()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; easting = coord.X&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; northing = coord.Y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; del row, rows&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code attempts to read in a point in one CRS and transform it to a different datum and then to another projection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get no errors but the re-projection simply does not work. Unfortunately I can't use the GDAL/OGR libraries in my corporate environment (I wish I could!!).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone know of a workaround please??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, this is DESPERATELY slow!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Roger&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 08:26:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238424#M18545</guid>
      <dc:creator>RogerLoweth</dc:creator>
      <dc:date>2011-08-09T08:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238425#M18546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What is you initial coordinate system, and which coordinate system are you attempting to re-project to?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 19:09:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238425#M18546</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2011-08-09T19:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238426#M18547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The spatial refernce object is the 3rd parameter in the update &amp;amp; search cursor statments (2nd parameer for the insercursor statment). So it would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rows = arcpy.UpdateCursor(fc, "", inCRS)
#instead of
rows = arcpy.UpdateCursor(fc, inCRS)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:00:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238426#M18547</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-11T12:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238427#M18548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a reason you are using the cursor instead of the Project tool?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 22:30:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238427#M18548</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-08-09T22:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238428#M18549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What is you initial coordinate system, and which coordinate system are you attempting to re-project to?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;From AGD84 to GDA94 and MGA50. Why would that make a difference?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 23:03:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238428#M18549</guid>
      <dc:creator>RogerLoweth</dc:creator>
      <dc:date>2011-08-09T23:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238429#M18550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The spatial refernce object is the 3rd parameter in the update &amp;amp; search cursor statments (2nd parameer for the insercursor statment). So it would be:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;rows = arcpy.UpdateCursor(fc, "", inCRS)
#instead of
rows = arcpy.UpdateCursor(fc, inCRS)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That was it! Many, many thanks Chris.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using cursors instead of the project tool in the hope it will be faster. Both methods seem very slow though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238429#M18550</guid>
      <dc:creator>RogerLoweth</dc:creator>
      <dc:date>2021-12-11T12:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238430#M18551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;That was it! Many, many thanks Chris.&lt;BR /&gt;&lt;BR /&gt;I'm using cursors instead of the project tool in the hope it will be faster. Both methods seem very slow though.&lt;BR /&gt;&lt;BR /&gt;R&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I spoke too soon!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code runs OK and it is now quite fast (using in-memory feature classes). However, the results for latitude, longitude, easting and northing are always the same, no matter what input/output datums and projections I specify. What seems to happen is that the latitude and longitude project in WGS84 and the datum transformation itself does not work. I've tried this using searchcursors and updatecursors with the same result. Any ideas?? Will project_management work on in-memory feature classes?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(I am already specifying arcpy.env.geographicTransformations so ArcGIS knows which one to use).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 03:10:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238430#M18551</guid>
      <dc:creator>RogerLoweth</dc:creator>
      <dc:date>2011-08-10T03:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238431#M18552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hands down, it would be way faster to use the Project tool that do multiple passes with cursors. I could be wrong, but I'm not completely sure that the cursors honor the arcpy.env.geographicTransformations setting...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 14:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238431#M18552</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-08-10T14:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238432#M18553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My understanding is that you can use an in_memory feature layer as an input to a project tool, but not an output.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 15:24:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238432#M18553</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-08-10T15:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238433#M18554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;My understanding is that you can use an in_memory feature layer as an input to a project tool, but not an output.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't see anything in the documentation that indicates you cannot send the results of a arcpy.Project_management operation to an in-memory feature class.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just specify your output as "in_memory\\reprojected" or something similar.&amp;nbsp; When you're done with it, if you want to manually clear it out of memory, just use the arcpy.Delete_management tool, specifying it exactly as in the project tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course, just because the documentation doesn't say anything about requiring a physical storage output doesn't mean it isn't true.&amp;nbsp; You're just gonna have to try it!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Aug 2011 02:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238433#M18554</guid>
      <dc:creator>KentWilliams</dc:creator>
      <dc:date>2011-08-13T02:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Projection with cursors</title>
      <link>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238434#M18555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I don't see anything in the documentation that indicates you cannot send the results of a arcpy.Project_management operation to an in-memory feature class.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Just specify your output as "in_memory\\reprojected" or something similar.&amp;nbsp; When you're done with it, if you want to manually clear it out of memory, just use the arcpy.Delete_management tool, specifying it exactly as in the project tool.&lt;BR /&gt;&lt;BR /&gt;Of course, just because the documentation doesn't say anything about requiring a physical storage output doesn't mean it isn't true.&amp;nbsp; You're just gonna have to try it!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000007m000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000007m000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Point #4 under Usage&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 12:18:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/projection-with-cursors/m-p/238434#M18555</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-08-15T12:18:16Z</dc:date>
    </item>
  </channel>
</rss>

