<?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: Python geoprocessing performance in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609886#M20259</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jake:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you post the code for the quick tests you did to compare ArcSDESQLExecute function using the arcpy library vs the pyodbc library?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Sep 2013 13:25:41 GMT</pubDate>
    <dc:creator>MichaelVolz</dc:creator>
    <dc:date>2013-09-10T13:25:41Z</dc:date>
    <item>
      <title>Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609882#M20255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a python geoprocessing that takes a lot of time. The geoprocessing calculates geometries using points, polygons, buffers, and cursors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any hint of how to optimize the geoprocessing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Would it be shorter in time if I used the Java API?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 06:31:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609882#M20255</guid>
      <dc:creator>ab1</dc:creator>
      <dc:date>2013-09-10T06:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609883#M20256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you post the python script you are using?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 11:20:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609883#M20256</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-09-10T11:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609884#M20257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's 3000 lines. It won't be easy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd like to know in general if a geoprocessing with Java ArcObjets would be faster than python arcpy?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;m also using sql queries with the SdeExecuteSQL function. This function seems to take time too. Is it possible to optimize this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 11:49:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609884#M20257</guid>
      <dc:creator>ab1</dc:creator>
      <dc:date>2013-09-10T11:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609885#M20258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure what would be faster as I've never really worked with ArcObjects Java API.&amp;nbsp; The easiest way to find out is to perform a quick simple test and compare the two.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for the ArcSDESQLExecute function, you may want to try the &lt;/SPAN&gt;&lt;A href="http://code.google.com/p/pyodbc/"&gt;pyodbc&lt;/A&gt;&lt;SPAN&gt; library.&amp;nbsp; After a quick test, this seems to perform slightly faster.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 12:41:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609885#M20258</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-09-10T12:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609886#M20259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jake:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you post the code for the quick tests you did to compare ArcSDESQLExecute function using the arcpy library vs the pyodbc library?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 13:25:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609886#M20259</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-09-10T13:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609887#M20260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you looked on GIS StackExchange? There are several threads on boosting python performance, here is on &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/31699/ways-to-speed-up-python-scripts-running-as-arcgis-tools/31710#31710"&gt;page&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 13:47:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609887#M20260</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2013-09-10T13:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609888#M20261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Jake:&lt;BR /&gt;&lt;BR /&gt;Can you post the code for the quick tests you did to compare ArcSDESQLExecute function using the arcpy library vs the pyodbc library?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import pyodbc, time, arcpy

startTime = time.clock()

sde_conn = arcpy.ArcSDESQLExecute(r"Database Connections\SQLSERVER.sde")
sql = "select OBJECTID, FEATURE, P_ST_NO, P_ST_NAME, P_ST_TYPE, P_CITY, P_Z_1 from AddressPoints"
sde_return = sde_conn.execute(sql)

endTime = time.clock()
elapsedTime = endTime - startTime
print elapsedTime

startTime = time.clock()

cnxn = pyodbc.connect('Driver={SQL Server Native Client 11.0};UID=gis;PWD=gis;SERVER=sdeserver;DATABASE=db;')
cursor=cnxn.cursor()
cursor.execute("select OBJECTID, FEATURE, P_ST_NO, P_ST_NAME, P_ST_TYPE, P_CITY, P_Z_1 from AddressPoints")
rows = cursor.fetchall()
cursor.close()
cnxn.close()

endTime = time.clock()
elapsedTime = endTime - startTime
print elapsedTime&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:06:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609888#M20261</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T02:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609889#M20262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jake:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3 more questions&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.) Do I need a special driver for an Oracle connection with pyodbc?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) What is the syntax difference for Oracle in the line cnxn = pyodbc.connect('Driver={SQL Server Native Client 11.0};UID=gis;PWD=gis;SERVER=sdeserver;DATABASE=db;')?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;an example would be great&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3.) What is the syntax for getting the number of records counted so I know the python script actually selected records?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 15:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609889#M20262</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-09-10T15:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609890#M20263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Jake:&lt;BR /&gt;&lt;BR /&gt;3 more questions&lt;BR /&gt;&lt;BR /&gt;1.) Do I need a special driver for an Oracle connection with pyodbc?&lt;BR /&gt;&lt;BR /&gt;2.) What is the syntax difference for Oracle in the line cnxn = pyodbc.connect('Driver={SQL Server Native Client 11.0};UID=gis;PWD=gis;SERVER=sdeserver;DATABASE=db;')?&lt;BR /&gt;an example would be great&lt;BR /&gt;&lt;BR /&gt;3.) What is the syntax for getting the number of records counted so I know the python script actually selected records?&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; Yes, you will need an Oracle driver.&amp;nbsp; I believe you can download one from here if you do not have one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.oracle.com/technetwork/topics/winsoft-085727.html"&gt;http://www.oracle.com/technetwork/topics/winsoft-085727.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; Here is an example using DSN that is set up through Microsoft's ODBC Data Source Administrator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://stackoverflow.com/questions/10586361/how-do-i-connect-to-oracle-10-from-pyodbc"&gt;http://stackoverflow.com/questions/10586361/how-do-i-connect-to-oracle-10-from-pyodbc&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3.&amp;nbsp; You can return the record count with the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;SELECT COUNT(*) FROM table_name;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 17:26:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609890#M20263</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-09-10T17:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609891#M20264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jake:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I already have the Oracle Client installed on the computer where I am running the python script, do I also need to set up an Oracle ODBC connection in the ODBC Data Source Administrator tool for the pyodbc.connect code to work?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 18:12:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609891#M20264</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2013-09-10T18:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Python geoprocessing performance</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609892#M20265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have a python geoprocessing that takes a lot of time. The geoprocessing calculates geometries using points, polygons, buffers, and cursors.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Some things to think about...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;If you are at 10.1 or later, use arcpy.da - it's a lot faster&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Use the shortcuts (SHAPE@, etc) to access the geometry -- this is much faster than accessing the shape field directly.&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Remember you can use geoprocessing tools directly on arcpy geometry objects (this may help you design a zippier workflow)&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 03:57:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-geoprocessing-performance/m-p/609892#M20265</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-09-11T03:57:20Z</dc:date>
    </item>
  </channel>
</rss>

