<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Node Dangles</title>
	<atom:link href="http://nodedangles.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nodedangles.wordpress.com</link>
	<description>got topology?</description>
	<lastBuildDate>Fri, 10 Feb 2012 17:45:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nodedangles.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/4fef3370dde3d7a39b864018de28de7c?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Node Dangles</title>
		<link>http://nodedangles.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nodedangles.wordpress.com/osd.xml" title="Node Dangles" />
	<atom:link rel='hub' href='http://nodedangles.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Field Calculator: ArcPy Date to Decimal Function</title>
		<link>http://nodedangles.wordpress.com/2011/10/06/field-calculator-arcpy-date-to-decimal-function/</link>
		<comments>http://nodedangles.wordpress.com/2011/10/06/field-calculator-arcpy-date-to-decimal-function/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 03:08:35 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[ArcGIS 10]]></category>
		<category><![CDATA[ArcMap]]></category>
		<category><![CDATA[arcpy]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[arcgis 10]]></category>
		<category><![CDATA[date]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=639</guid>
		<description><![CDATA[arcpy function to convert a date to decimal value<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=639&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the standards in our databases is to store dates as 8-digit integer values in the format of yyyymmdd.  This requires us to occasionally convert values from date fields into this format.</p>
<p>We can do this in the ArcMap Field Calculator using this arcpy function:</p>
<pre>
def datetodouble(inNum):
     splitList = str(inNum).split("/")
     return  splitList [2]  +("0"+ splitList [0])[-2:]  +("0"+ splitList [1])[-2:]
</pre>
<p><a href="http://nodedangles.files.wordpress.com/2011/10/datetodouble.png"><img class="aligncenter size-full wp-image-640" title="Date To Double" src="http://nodedangles.files.wordpress.com/2011/10/datetodouble.png?w=614" alt=""   /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/639/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/639/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/639/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=639&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/10/06/field-calculator-arcpy-date-to-decimal-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/10/datetodouble.png" medium="image">
			<media:title type="html">Date To Double</media:title>
		</media:content>
	</item>
		<item>
		<title>Data Extration Failed &#8212; Reverse Proxy Time-out</title>
		<link>http://nodedangles.wordpress.com/2011/08/18/data-extration-failed/</link>
		<comments>http://nodedangles.wordpress.com/2011/08/18/data-extration-failed/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 01:55:47 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[ArcGIS]]></category>
		<category><![CDATA[ArcGIS 10]]></category>
		<category><![CDATA[ArcGIS Server]]></category>
		<category><![CDATA[ArcSDE]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[arc gis server]]></category>
		<category><![CDATA[arcforum]]></category>
		<category><![CDATA[data extraction]]></category>
		<category><![CDATA[distributed geodatabases]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=628</guid>
		<description><![CDATA[Testing one of our geodata services, we discovered that it allowed us to extract a portion of our feature class but when we tried to extract the entire data set, we received this Data Extraction error: Data extraction failed. Proxy or Gateway Server did not allow the URL. Check with your LAN administrator that Proxy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=628&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Testing one of our geodata services, we discovered that it allowed us to extract a portion of our feature class but when we tried to extract the entire data set, we received this Data Extraction error: Data extraction failed. Proxy or Gateway Server did not allow the URL. Check with your LAN administrator that Proxy or Gateway server is configured to allow the URL.</p>
<p>The fact that I was able to extract a portion of the data and I could see the entire geodatabase get made and zipped led me to believe it was more of time-out issue.</p>
<p style="text-align:center;"><img class="size-full wp-image-629 aligncenter" title="Data Extraction Failed" src="http://nodedangles.files.wordpress.com/2011/08/dataextractionfailed.png?w=614" alt=""   /></p>
<p>Reading through this thread at <a href="http://forums.esri.com/thread.asp?c=158&amp;f=1696&amp;t=273750">ArcForum</a> led to some good information.  But Thomas&#8217; comment that he was using &#8220;IIS7 for my reverse proxy server&#8221; and had to change one more setting led me to the solution.  In Server Manager, the default Proxy Time-Out is set at 30 seconds by default.  I bumped that up, 60 seconds shown below but I ended up going to 300 seconds and the problem was resolved.</p>
<p style="text-align:center;"><a href="http://nodedangles.files.wordpress.com/2011/08/servermanager.jpg"><img class="size-full wp-image-630 aligncenter" title="Server Manager" src="http://nodedangles.files.wordpress.com/2011/08/servermanager.jpg?w=614&#038;h=339" alt="" width="614" height="339" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/628/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=628&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/08/18/data-extration-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>44.852994 -93.550730</georss:point>
		<geo:lat>44.852994</geo:lat>
		<geo:long>-93.550730</geo:long>
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/08/dataextractionfailed.png" medium="image">
			<media:title type="html">Data Extraction Failed</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/08/servermanager.jpg" medium="image">
			<media:title type="html">Server Manager</media:title>
		</media:content>
	</item>
		<item>
		<title>Using arcpy in ArcGIS 10 Field Calculater to Create a Unique ID</title>
		<link>http://nodedangles.wordpress.com/2011/07/28/using-arcpy-in-arcgis-10-field-calculater-to-create-a-unique-id/</link>
		<comments>http://nodedangles.wordpress.com/2011/07/28/using-arcpy-in-arcgis-10-field-calculater-to-create-a-unique-id/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 02:08:13 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[ArcGIS]]></category>
		<category><![CDATA[ArcGIS 10]]></category>
		<category><![CDATA[ArcMap]]></category>
		<category><![CDATA[arcpy]]></category>
		<category><![CDATA[ArcScripts]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[arcgis 10]]></category>
		<category><![CDATA[ArcView 3.x]]></category>
		<category><![CDATA[Field Calculator]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=620</guid>
		<description><![CDATA[How to calculate a sequential unique ID in ArcGIS 10 using an arcpy module in the ArcMap Field Calculator.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=620&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the common functions I have to do is assign each record in a feature class with a unique identifier&#8211;normally just a sequential number from 1 to N.  In ArcView 3.x, the formula was simply &#8220;rec + 1&#8243; if I wanted to start with the number 1.</p>
<p>In ArcGIS, the process got a little more complex&#8211;you had to write a little VBA in Field Calculator as <a href="http://support.esri.com/en/knowledgebase/techarticles/detail/27427">described by ESRI</a>.</p>
<p>While this option still exists in ArcGIS 10, I believe it will disappear when 10.1 comes out and VBA support is completely eliminated.  But it is doable using Python which will continue to be supported.</p>
<p>Googling around, I did not find an exact answer but Dave Verbyla, Professor of GIS/Remote Sensing at the University of Alaska has a <a href="http://nrm.salrm.uaf.edu/~dverbyla/nrm638/lectures/Python_field_calculator.pdf">posted some samples</a> that served as a good starting point.</p>
<p>In the Pre-Logic Script Code box, I declare a variable (counter) and a function. Then in the formula, I call the function.</p>
<pre>counter = 0
def uniqueID():
  global counter
  counter += 1
  return counter</pre>
<p><a href="http://nodedangles.files.wordpress.com/2011/07/fc-arcpy.png"><img class="alignleft size-full wp-image-621" title="Field Calculator" src="http://nodedangles.files.wordpress.com/2011/07/fc-arcpy.png?w=614&#038;h=525" alt="" width="614" height="525" /></a></p>
<p>While composing this post, I actually wanted a concatenated value; &#8220;OP&#8221; plus an 8 character numeric sequential number starting at OP00000001 so the actual code is shown below:</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/07/fc-arcpy2.png"><img class="alignright size-full wp-image-623" title="Field Calculator" src="http://nodedangles.files.wordpress.com/2011/07/fc-arcpy2.png?w=614" alt=""   /></a></p>
<p>H</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/620/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/620/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/620/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/620/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/620/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/620/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/620/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/620/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/620/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/620/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/620/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/620/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/620/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/620/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=620&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/07/28/using-arcpy-in-arcgis-10-field-calculater-to-create-a-unique-id/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<georss:point>44.852994 -93.550730</georss:point>
		<geo:lat>44.852994</geo:lat>
		<geo:long>-93.550730</geo:long>
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/07/fc-arcpy.png" medium="image">
			<media:title type="html">Field Calculator</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/07/fc-arcpy2.png" medium="image">
			<media:title type="html">Field Calculator</media:title>
		</media:content>
	</item>
		<item>
		<title>ArcGIS Add-In Custom Mouse Cursor</title>
		<link>http://nodedangles.wordpress.com/2011/07/19/arcgis-add-in-custom-mouse-cursor/</link>
		<comments>http://nodedangles.wordpress.com/2011/07/19/arcgis-add-in-custom-mouse-cursor/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 02:47:03 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[ArcGIS]]></category>
		<category><![CDATA[ArcGIS 10]]></category>
		<category><![CDATA[ArcObjects]]></category>
		<category><![CDATA[ArcScripts]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[arcgis 10]]></category>
		<category><![CDATA[ArcMap]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=599</guid>
		<description><![CDATA[I was working on a project and wanted my own custom mouse cursor and did not easily find a way to make your own in ESRI&#8217;s instructions.  But, once you know how to do it, it is pretty easy.  In Visual Studio, Add a New Item: Add a Cursor File: You can edit your cursor [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=599&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was working on a project and wanted my own custom mouse cursor and did not easily find a way to make your own in ESRI&#8217;s instructions.  But, once you know how to do it, it is pretty easy.  In Visual Studio, Add a New Item:</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/07/addresource.png"><img class="aligncenter size-full wp-image-600" title="Add Resource" src="http://nodedangles.files.wordpress.com/2011/07/addresource.png?w=614" alt=""   /></a></p>
<p>Add a Cursor File:</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/07/selectcursor.png"><img class="aligncenter size-full wp-image-602" title="SelectCursor" src="http://nodedangles.files.wordpress.com/2011/07/selectcursor.png?w=614&#038;h=372" alt="" width="614" height="372" /></a></p>
<p>You can edit your cursor with the editor program in Visual Studio.  Once you satisfied with how it looks, make sure that the Build Action on the cursor is &#8220;Embedded Resource&#8221;.</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/07/embedded.png"><img class="aligncenter size-full wp-image-601" title="Embedded" src="http://nodedangles.files.wordpress.com/2011/07/embedded.png?w=614" alt=""   /></a></p>
<p>Then you can set your cursor with two lines of code. Not that my cursor is in my QDI.QdiAddIn Namespace:</p>
<pre>
Dim pCursorStream As System.IO.Stream = Me.GetType.Assembly.GetManifestResourceStream("QDI.QdiAddIn.NewCursor.cur")
MyBase.Cursor = New System.Windows.Forms.Cursor(pCursorStream)</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/599/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/599/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/599/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=599&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/07/19/arcgis-add-in-custom-mouse-cursor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>44.852994 -93.550730</georss:point>
		<geo:lat>44.852994</geo:lat>
		<geo:long>-93.550730</geo:long>
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/07/addresource.png" medium="image">
			<media:title type="html">Add Resource</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/07/selectcursor.png" medium="image">
			<media:title type="html">SelectCursor</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/07/embedded.png" medium="image">
			<media:title type="html">Embedded</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging a Python Scheduled Task</title>
		<link>http://nodedangles.wordpress.com/2011/07/11/debugging-a-python-scheduled-task/</link>
		<comments>http://nodedangles.wordpress.com/2011/07/11/debugging-a-python-scheduled-task/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 00:11:13 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[arcpy]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[arcgis]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Windows Task Scheduler]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=583</guid>
		<description><![CDATA[I have been working on a python script that I want (NEED) to run as a scheduled task on a remote machine.  I got to the point that the script did exactly what I needed when I was interactively running it in a Windows session but had problems when running it as a scheduled task.  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=583&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been working on a python script that I want (NEED) to run as a scheduled task on a remote machine.  I got to the point that the script did exactly what I needed when I was interactively running it in a Windows session but had problems when running it as a scheduled task.  The debugging process was cumbersome&#8211;make a change, schedule a task to run it, log out of the machine, and wait.  The log back in and repeat the process.</p>
<p>That got old.</p>
<p>So I wrote<a href="http://dl.dropbox.com/u/22241283/NodeDangles/20110711_tester.zip"> a script  (tester.py)</a> that calls any other python scripts in the same directory that (1) start with &#8220;test_&#8221; and (2) there is not a corresponding file with the same base name and &#8220;.start&#8221; extension.  It would launch &#8220;test_BaBing.py&#8221; as long as there is not a &#8220;test_BaBing.start&#8221; in the same directory.  Tester.py continued to run, looping every 60 seconds, until tester.stop exists.</p>
<p>This made the process easier because I could work on my local machine, editing the problematic script, saving changes and within 60 seconds it would be launched on the remote machine.  I could view the results, make additional edits, delete the .start file and it would launch again within 60 seconds.</p>
<p>Within a couple minutes I was able to determine the problem (path related) and fix it.</p>
<p>Happy programmer.</p>
<p>&lt;disclaimer&gt;I would recommend using this only while debugging a script&#8211;routinely running it could be a security risk since someone could copy a destructive python script into the directory and this would run it.&lt;/disclaimer&gt;</p>
<p>Download: <a href="http://dl.dropbox.com/u/22241283/NodeDangles/20110711_tester.zip">tester.py</a></p>
<pre>import sys, string, os
import glob
import datetime, shutil
import time, inspect
import getpass

totalstarttime = datetime.datetime.now()

dateString = datetime.date.today().strftime("%Y%m%d_")+datetime.datetime.now().strftime("%H%M%S") #datetime.date.today().strftime("%Y%m%d")
debugfile = inspect.getfile(inspect.currentframe()).replace(".py","_"+dateString+"_Debug.txt")
stopfile = inspect.getfile(inspect.currentframe()).replace(".py",".stop")
newdebugfile = False

codeDir = os.path.dirname(inspect.getfile(inspect.currentframe())).replace("\\","/")

def printit(inText):
    global newdebugfile

    print inText

    if os.path.exists(debugfile):
        if (newdebugfile == False):
            tmpfile = open(debugfile,"w")
            newdebugfile = True
        else:
            tmpfile = open(debugfile,"a")
    else:
        tmpfile = open(debugfile,"w")

    tmpfile.write(inText)
    tmpfile.write("\n")
    tmpfile.close()
    newdebugfile = True

stopFileExists = False
printit("Code Directory: "+codeDir)
printit("Starting at: "+datetime.date.today().strftime("%Y-%m-%d_")+datetime.datetime.now().strftime("%H:%M:%S"))
printit("Stopfile : "+stopfile+"/n")
while (stopFileExists == False):
    for iFile in glob.glob(codeDir+"/test_*.py"):

        thisStartfile = iFile.replace(".py",".start")

        if not (os.path.exists(thisStartfile)):
            printit ("Launching: "+iFile)
            iTmpfile = open(thisStartfile,"w")
            iTmpfile.write("started")
            iTmpfile.close()
            os.system("Start "+iFile)

    if (os.path.exists(stopfile)):
        stopFileExists = True
    else:
        time.sleep(60)

    printit("\nEnd of Loop: "+datetime.date.today().strftime("%Y-%m-%d_")+datetime.datetime.now().strftime("%H:%M:%S")+"\n")    

printit("Done!")</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/583/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=583&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/07/11/debugging-a-python-scheduled-task/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>44.852994 -93.550730</georss:point>
		<geo:lat>44.852994</geo:lat>
		<geo:long>-93.550730</geo:long>
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>
	</item>
		<item>
		<title>Checking to see if a Field Index Exists Using Arcpy (ArGIS 10.0) redux</title>
		<link>http://nodedangles.wordpress.com/2011/07/05/checking-to-see-if-a-field-index-exists-using-arcpy-argis-10-0-redux/</link>
		<comments>http://nodedangles.wordpress.com/2011/07/05/checking-to-see-if-a-field-index-exists-using-arcpy-argis-10-0-redux/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 18:53:34 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[ArcGIS 10]]></category>
		<category><![CDATA[arcpy]]></category>
		<category><![CDATA[ArcScripts]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[geoprocessing]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[arcgisscripting]]></category>
		<category><![CDATA[argis 10]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=581</guid>
		<description><![CDATA[I&#8217;ve previously posted python code to check if a field index exists for both ArcGIs 9.3 and ArcGIS 10.0. Recently I have been working on a process that was using this code but it was not working because it looks for an index with a specific name.  It was not working in this case because [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=581&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve previously posted python code to check if a field index exists for both <a href="http://nodedangles.wordpress.com/2011/01/27/checking-to-see-if-a-field-index-exists-using-python/">ArcGIs 9.3</a> and <a href="http://nodedangles.wordpress.com/2011/02/21/checking-to-see-if-a-field-index-exists-using-arcpy-argis-10-0/">ArcGIS 10.0</a>.</p>
<p>Recently I have been working on a process that was using this code but it was not working because it looks for an index with a specific name.  It was not working in this case because the name of the indexes was getting incremented as they were being created.  For example, I was building an index on the table C5ST, field RelateId ([C5IX].[Relateid]) named I_C5IX_RelateId.  That worked fine until we switched our process so now we keep multiple versions of some tables, each with a date-based suffix.</p>
<p>We now have tables name C5St_20110625 and C5St_20110626&#8211;the Index-name scheme, however was still creating I_C5IX_RelateId and it worked great on the first one.  But when it created the second one, even on a different table, it was automatically name I_C5IX_RelateId_2 even though the name I_C5IX_RelateId was used when trying to create the index.</p>
<p>Before generating relates, our code checks to see if the key fields are indexed, and if they are not, builds  an index.  Because of the naming situation, multiple, duplicate indexes were being created.  Probably not too harmful but it is a little messy.</p>
<p>So I re-wrote the code so that you pass the function the table name and field name that you want to check and it checks to see if there is an index existing for that field and return a Boolean.  The one little wrinkle I put in is to account for indexes that span multiple fields&#8211;the &#8221; if (iIndex.fields[0].Name.upper() == fieldname.upper()):&#8221; statement is checking the index to see if it is on a single field or multiple fields.</p>
<p>&nbsp;</p>
<blockquote><p>def fieldHasIndex(tablename,fieldname):<br />
if not arcpy.Exists(tablename):<br />
return False</p>
<p>tabledescription = arcpy.Describe(tablename)</p>
<p>for iIndex in tabledescription.indexes:<br />
if (len(iIndex.fields)==1):<br />
if (iIndex.fields[0].Name.upper() == fieldname.upper()):<br />
return True</p>
<p>return False</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/581/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/581/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=581&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/07/05/checking-to-see-if-a-field-index-exists-using-arcpy-argis-10-0-redux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>44.852994 -93.550730</georss:point>
		<geo:lat>44.852994</geo:lat>
		<geo:long>-93.550730</geo:long>
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>
	</item>
		<item>
		<title>Feature classes and Tables with names starting with &#8220;nd_&#8221;.</title>
		<link>http://nodedangles.wordpress.com/2011/05/23/feature-classes-and-tables-with-names-starting-with-nd_/</link>
		<comments>http://nodedangles.wordpress.com/2011/05/23/feature-classes-and-tables-with-names-starting-with-nd_/#comments</comments>
		<pubDate>Mon, 23 May 2011 21:55:24 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[ArcGIS 10]]></category>
		<category><![CDATA[arcpy]]></category>
		<category><![CDATA[ArcSDE]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[ArcCatalog]]></category>
		<category><![CDATA[arcgis]]></category>
		<category><![CDATA[geodatabase]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=564</guid>
		<description><![CDATA[Random luck me to discovering a bug related to feature classes whose names start with &#8220;nd_&#8221;.  It appears that you are allowed to create feature classes starting with &#8220;nd_&#8221; but ArcCatalog will not display them.  Further research shows this behavior also occurs for table and for ArcSDE (PostGres) geodatabases,  personal geodatabase, and file geodatabases&#8211;I am [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=564&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Random luck me to discovering a bug related to feature classes whose names start with &#8220;nd_&#8221;.  It appears that you are allowed to create feature classes starting with &#8220;nd_&#8221; but ArcCatalog will not display them.  Further research shows this behavior also occurs for table and for ArcSDE (PostGres) geodatabases,  personal geodatabase, and file geodatabases&#8211;I am using ArcCatalog 10.0.</p>
<p>I first noticed something odd was occurring while importing a series of shapefiles into a geodatabases.  After importing 15 shapefiles, I only had thirteen feature classes despite receiving no errors during the process.  The two shapefiles that failed to import were named ND_oil_and_gas.shp and ND_Bendix_Study.shp.  Subsequent attempts to import them individually returned an error &#8220;Invalid Target Name&#8221;.</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/05/invalidtargetname.png"><img class="aligncenter size-full wp-image-565" title="Invalid Target Name" src="http://nodedangles.files.wordpress.com/2011/05/invalidtargetname.png?w=614" alt=""   /></a></p>
<p>I discovered in pgAdmin III (Postgres SDE Geodatabase) that the table existed and there was an entry in sde.sde_layers for the feature class but ArcCatalog refused to show it.</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/05/nd_2.png"><img class="aligncenter size-full wp-image-570" title="nd_" src="http://nodedangles.files.wordpress.com/2011/05/nd_2.png?w=614" alt=""   /></a></p>
<p>I used some un-supported methods to try to resolve the problem and despite some sweating, I failed to find a way to get ArcCatalog to display these feature classes.  I did, however, at least found a way to delete them&#8211;arcpy can detect that the feature classes exists so it is able to delete them.</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/05/arcpy_delete.png"><img class="aligncenter size-full wp-image-571" title="arcpy.delete_management" src="http://nodedangles.files.wordpress.com/2011/05/arcpy_delete.png?w=614" alt=""   /></a></p>
<p>At least by deleting them, I can prevent leaving &#8220;invisible&#8221; feature classes from hanging out in my geodatabase.</p>
<p>I suspect the problems stems from how ESRI has implemented the <a href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002p0000007m000000.htm">Network dataset table-naming structure</a> &#8211;dirty areas are stored in tables named <em>nd_&lt;itemid&gt;_dirtyareas </em> and <em>nd_&lt;itemid&gt;_dirtyobjects</em>.  Possibly the developer  working on the ArcCatalog GUI ended up suppressing showing feature classes and tables whose names start with &#8220;nd_&#8221;.</p>
<p>And, just for posterity&#8217;s sake, here is a python code snippet listing the feature classes in a workspace:</p>
<blockquote><p>import arcpy</p>
<p>arcpy.env.workspace = &#8220;c:/temp/_nd/F.gdb&#8221;</p>
<p>print arcpy.env.workspace<br />
for fc in arcpy.ListFeatureClasses():<br />
print fc</p>
<p>print &#8220;Done!&#8221;</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/564/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=564&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/05/23/feature-classes-and-tables-with-names-starting-with-nd_/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>44.852994 -93.550730</georss:point>
		<geo:lat>44.852994</geo:lat>
		<geo:long>-93.550730</geo:long>
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/05/invalidtargetname.png" medium="image">
			<media:title type="html">Invalid Target Name</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/05/nd_2.png" medium="image">
			<media:title type="html">nd_</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/05/arcpy_delete.png" medium="image">
			<media:title type="html">arcpy.delete_management</media:title>
		</media:content>
	</item>
		<item>
		<title>Renaming Raster Dataset and arcpy.Exists()</title>
		<link>http://nodedangles.wordpress.com/2011/05/03/renaming-raster-dataset-and-arcpy-exists/</link>
		<comments>http://nodedangles.wordpress.com/2011/05/03/renaming-raster-dataset-and-arcpy-exists/#comments</comments>
		<pubDate>Tue, 03 May 2011 15:33:48 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[ArcGIS 10]]></category>
		<category><![CDATA[ArcMap]]></category>
		<category><![CDATA[ArcObjects]]></category>
		<category><![CDATA[arcpy]]></category>
		<category><![CDATA[ArcScripts]]></category>
		<category><![CDATA[ArcSDE]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[geoprocessing]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[arcgis]]></category>
		<category><![CDATA[arcgis 10]]></category>
		<category><![CDATA[GIS]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=546</guid>
		<description><![CDATA[Discovered something today. I was working on an arcpy script that copies a raster dataset from a file geodatabase into a Postgres SDE geodatabase and then does some boring routine tasks&#8211;building stats, creating a mosaic dataset, adding the raster to the mosaic dataset and making a couple referenced mosaic datasets. It sometimes has trouble with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=546&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Discovered something today. I was working on an arcpy script that copies a raster dataset from a file geodatabase into a Postgres SDE geodatabase and then does some boring routine tasks&#8211;building stats, creating a mosaic dataset, adding the raster to the mosaic dataset and making a couple referenced mosaic datasets.</p>
<p>It sometimes has trouble with the initial step of uploading the raster because of the sheer size of if (1m elevation raster for counties) and it failed today on one. It failed today so I used the ArcCatalog GUI to copy the raster and renamed it.</p>
<p>I then proceeded to run launch my script. Before each step, I use <a href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Exists/000v00000021000000/">arcpy.Exists</a>() extensively to check to see if various items exist before I attempt to create them. It was continuously reporting that my raster set did not exist even though I could see it in ArcCatalog.</p>
<p>Finally, I realized that I needed to close ArcCatalog before arcpy recognized the fact I had renamed something. To note, I was running arcpy from a separate PythonWin window, not from the ArcCatalog session I had renamed the raster dataset with.</p>
<p>Once I closed ArcCatalog, arcpy recognized the renaming and life was good.</p>
<p>I&#8217;m also suspicious now about a problem I often have running statistics on my rasters.  The ArcTool reports no errors when I create them but for some reason the raster does not show that it has statistics afterwards.  I normally have multiple ArcApplication sessions open and now suspect that perhaps this problem is due to sessions not letting go of the connection.  Stay tuned for further developments on this.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/546/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=546&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/05/03/renaming-raster-dataset-and-arcpy-exists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>44.852994 -93.550730</georss:point>
		<geo:lat>44.852994</geo:lat>
		<geo:long>-93.550730</geo:long>
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>
	</item>
		<item>
		<title>Sorting a Coded-Value Domain Add-In (ArcGIS 10)</title>
		<link>http://nodedangles.wordpress.com/2011/05/03/sorting-a-coded-value-domain-add-in-arcgis-10/</link>
		<comments>http://nodedangles.wordpress.com/2011/05/03/sorting-a-coded-value-domain-add-in-arcgis-10/#comments</comments>
		<pubDate>Tue, 03 May 2011 09:33:01 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[ArcGIS]]></category>
		<category><![CDATA[ArcObjects]]></category>
		<category><![CDATA[ArcScripts]]></category>
		<category><![CDATA[ArcSDE]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[arcgis]]></category>
		<category><![CDATA[arcgis 10]]></category>
		<category><![CDATA[coded-value domain]]></category>
		<category><![CDATA[GIS]]></category>
		<category><![CDATA[VB 6]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=522</guid>
		<description><![CDATA[An ArcGIS 10 version of a tool to sort your Coded-Value Domains.  Includes source code and a ready-to-install esriaddin.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=522&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am working on an data-entry application to edit feature classes that contain several coded-value-domains. The problem with some of the domains, however, is that some entries have been added after the initial creation.&nbsp; So the first 25 entries are in alphabetical order and there are some stragglers at the end that are in the order they were appended.</p>
<p>This can be confusing for users&#8211;they go to select &#8220;Milli Vanilli&#8221; and look between &#8220;Madonna&#8221; and &#8220;Motley Crue&#8221; but can not find their favorite band there&#8211;they have to go to the end of the list to find their selection.</p>
<p>In the past, I have gone through the tedious process of exporting the domain to a table, sorting the table, removing the domain from the necessary field(s), deleting the domian, re-importing the table back in a new domain and finally re-applying the domain to the necessary field(s). Let&#8217;s just say I didn&#8217;t do this until someone asked a few times and I didn&#8217;t have anything more exciting&#8211;like a root canal&#8211;I could busy myself with.</p>
<p>But this new application contains more domains than any of other datasets so it was time to find a better solution. ESRI does have a <a href="http://edndoc.esri.com/arcobjects/9.2/CPP_VB6_VBA_VCPP_Doc/COM_Samples_Docs/Geodatabase/Schema_Creation_and_Management/Sort_a_domain/e826c5a8-9740-4f0b-86b6-d3b834735574.htm">Domain Sort</a> Developer Sample.&nbsp; It, however, did<a href="http://edndoc.esri.com/arcobjects/9.2/CPP_VB6_VBA_VCPP_Doc/COM_Samples_Docs/Geodatabase/Schema_Creation_and_Management/Sort_a_domain/e826c5a8-9740-4f0b-86b6-d3b834735574.htm"> not play nice </a>with ArcGIS 10.</p>
<p>So I went ahead and update it from VB 6 to VB.Net/ArcObjects 10.&nbsp; I made an <a href="http://dl.dropbox.com/u/22241283/NodeDangles/DomainSorter.esriAddIn">Add-In</a> that can be installed by downloading the .esriaddin file and double-clicking on it.&nbsp; The <a href="http://dl.dropbox.com/u/22241283/NodeDangles/20110422_DomainSorter.zip">source code</a> is also available.</p>
<p>This will add an ArcCatalog Toolbar that can be added by going to Customize-Toolbars-Domain Sorter Toolbar.</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/04/ds_1.png"><img class="aligncenter size-full wp-image-540" title="Sort Domain-Add Toolbar" src="http://nodedangles.files.wordpress.com/2011/04/ds_1.png?w=614" alt=""   /></a></p>
<p>This will add a toolbar with one button.&nbsp; The button enables whenever you select a geodatabase with at least one coded-value domain.</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/04/ds_2.png"><img class="aligncenter size-full wp-image-539" title="Domain Sorter Button" src="http://nodedangles.files.wordpress.com/2011/04/ds_2.png?w=614" alt=""   /></a></p>
<p>This brings up a Windows form that lets you sort any domain by either the code or description, ascending or descending.&nbsp; Once you hit &#8220;OK&#8221; it re-sorts your domain.</p>
<p><a href="http://nodedangles.files.wordpress.com/2011/04/ds_3.png"><img class="aligncenter size-full wp-image-538" title="Domain Sorter Dialog" src="http://nodedangles.files.wordpress.com/2011/04/ds_3.png?w=614" alt=""   /></a></p>
<p>The only problem I have had is that only the owner of a domain is allowed to edit it on an SDE geodatabase.</p>
<p>But other than that, the button allows you to easily keep your domains sorted.</p>
<p><small>http://edndoc.esri.com/arcobjects/9.2/CPP_VB6_VBA_VCPP_Doc/COM_Samples_Docs/Geodatabase/Schema_Creation_and_Management/Sort_a_domain/e826c5a8-9740-4f0b-86b6-d3b834735574.htm</small></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/522/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=522&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/05/03/sorting-a-coded-value-domain-add-in-arcgis-10/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<georss:point>44.852994 -93.550730</georss:point>
		<geo:lat>44.852994</geo:lat>
		<geo:long>-93.550730</geo:long>
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/04/ds_1.png" medium="image">
			<media:title type="html">Sort Domain-Add Toolbar</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/04/ds_2.png" medium="image">
			<media:title type="html">Domain Sorter Button</media:title>
		</media:content>

		<media:content url="http://nodedangles.files.wordpress.com/2011/04/ds_3.png" medium="image">
			<media:title type="html">Domain Sorter Dialog</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick &amp; Dirty arcpy: Batch Splitting Polylines to a Specific Length.</title>
		<link>http://nodedangles.wordpress.com/2011/05/01/quick-dirty-arcpy-batch-splitting-polylines-to-a-specific-length/</link>
		<comments>http://nodedangles.wordpress.com/2011/05/01/quick-dirty-arcpy-batch-splitting-polylines-to-a-specific-length/#comments</comments>
		<pubDate>Sun, 01 May 2011 11:01:50 +0000</pubDate>
		<dc:creator>Map Ranter</dc:creator>
				<category><![CDATA[ArcGIS]]></category>
		<category><![CDATA[ArcGIS 10]]></category>
		<category><![CDATA[arcpy]]></category>
		<category><![CDATA[ESRI]]></category>
		<category><![CDATA[geoprocessing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[arcgis]]></category>
		<category><![CDATA[arcgis 10]]></category>
		<category><![CDATA[ArcObjects]]></category>
		<category><![CDATA[ArcScripts]]></category>
		<category><![CDATA[arctoolbox]]></category>
		<category><![CDATA[polylines]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://nodedangles.wordpress.com/?p=528</guid>
		<description><![CDATA[For some odd reason, I wanted to split all the arcs in a polyline feature class to a specific length&#8211;if a specific feature was longer than the target length, it would become two or more separate polyline records. Here is the bare-bones script that copies an existing feature class into a new feature class then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=528&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For some odd reason, I wanted to split all the arcs in a polyline feature class to a specific length&#8211;if a specific feature was longer than the target length, it would become two or more separate polyline records.</p>
<p>Here is the <a href="http://dl.dropbox.com/u/22241283/NodeDangles/20110429_Polyline%20Dicer.zip">bare-bones script</a> that copies an existing feature class into a new feature class then processes each record, splitting it into multiple records if the polyline is longer than the user-specified tolerance.  Some cautionary notes:</p>
<ul>
<li>This is Quick &amp; Dirty code&#8211;minimal error catching or documentation.</li>
<li>I basically tested this against one feature class (the one I wanted to split) once I got it to work, I quit.</li>
<li>There is some rounding error&#8211;features may be a tad bit off (a few ten-thousandths of a unit).</li>
<li>I did not test against multi-part features.</li>
<li>The tolerance is the native units of the data&#8211;if your data is in meters but you want to split the polylines every mile, enter 1,609.344.<strong><strong> </strong></strong></li>
</ul>
<p>I have included both a toolbox file (.tbx) and python script (.py).  After loading the toolbox, you&#8217;ll have to change the Source of the script by right-clicking on it, selecting the Source tab, and then navigating to the .py file.</p>
<p>Here is the code for the Googlebots, but you are better off <a href="http://dl.dropbox.com/u/22241283/NodeDangles/20110316_ListFieldCounts-arcpy.zip">just downloading</a> it.</p>
<pre>import arcpy
import sys, math

def printit(inMessage):
    print inMessage
    arcpy.AddMessage(inMessage)

if len(sys.argv) &gt; 1:
    inFC = sys.argv[1]
    outFC = sys.argv[2]
    alongDistin = sys.argv[3]
    alongDist = float(alongDistin)
else:
    inFC = "C:/temp/asdfasdf.mdb/jkl"
    OutDir = "C:/temp/asdfasdf.mdb"
    outFCName = "jkl2d"
    outFC = OutDir+"/"+outFCName
    alongDist = 1000

if (arcpy.Exists(inFC)):
    print(inFC+" does exist")
else:
    print("Cancelling, "+inFC+" does not exist")
    sys.exit(0)

def distPoint(p1, p2):
    calc1 = p1.X - p2.X
    calc2 = p1.Y - p2.Y

    return math.sqrt((calc1**2)+(calc2**2))

def midpoint(prevpoint,nextpoint,targetDist,totalDist):
    newX = prevpoint.X + ((nextpoint.X - prevpoint.X) * (targetDist/totalDist))
    newY = prevpoint.Y + ((nextpoint.Y - prevpoint.Y) * (targetDist/totalDist))
    return arcpy.Point(newX, newY)

def splitShape(feat,splitDist):
    # Count the number of points in the current multipart feature
    #
    partcount = feat.partCount
    partnum = 0
    # Enter while loop for each part in the feature (if a singlepart feature
    # this will occur only once)
    #
    lineArray = arcpy.Array()

    while partnum &lt; partcount:
        # Print the part number
        #
        #print "Part " + str(partnum) + ":"
        part = feat.getPart(partnum)
        #print part.count

        totalDist = 0

        pnt = part.next()
        pntcount = 0

        prevpoint = None
        shapelist = []

        # Enter while loop for each vertex
        #
        while pnt:

            if not (prevpoint is None):
                thisDist = distPoint(prevpoint,pnt)
                maxAdditionalDist = splitDist - totalDist

                print thisDist, totalDist, maxAdditionalDist

                if (totalDist+thisDist)&gt; splitDist:
                    while(totalDist+thisDist) &gt; splitDist:
                        maxAdditionalDist = splitDist - totalDist
                        #print thisDist, totalDist, maxAdditionalDist
                        newpoint = midpoint(prevpoint,pnt,maxAdditionalDist,thisDist)
                        lineArray.add(newpoint)
                        shapelist.append(lineArray)

                        lineArray = arcpy.Array()
                        lineArray.add(newpoint)
                        prevpoint = newpoint
                        thisDist = distPoint(prevpoint,pnt)
                        totalDist = 0

                    lineArray.add(pnt)
                    totalDist+=thisDist
                else:
                    totalDist+=thisDist
                    lineArray.add(pnt)
                    #shapelist.append(lineArray)
            else:
                lineArray.add(pnt)
                totalDist = 0

            prevpoint = pnt                
            pntcount += 1

            pnt = part.next()

            # If pnt is null, either the part is finished or there is an
            #   interior ring
            #
            if not pnt:
                pnt = part.next()
                if pnt:
                    print "Interior Ring:"
        partnum += 1

    if (lineArray.count &gt; 1):
        shapelist.append(lineArray)

    return shapelist

if arcpy.Exists(outFC):
    arcpy.Delete_management(outFC)

arcpy.Copy_management(inFC,outFC)

#origDesc = arcpy.Describe(inFC)
#sR = origDesc.spatialReference

#revDesc = arcpy.Describe(outFC)
#revDesc.ShapeFieldName

deleterows = arcpy.UpdateCursor(outFC)
for iDRow in deleterows:       
     deleterows.deleteRow(iDRow)

del iDRow
del deleterows

inputRows = arcpy.SearchCursor(inFC)
outputRows = arcpy.InsertCursor(outFC)
fields = arcpy.ListFields(inFC)

numRecords = int(arcpy.GetCount_management(inFC).getOutput(0))
OnePercentThreshold = numRecords // 100

printit(numRecords)

iCounter = 0
iCounter2 = 0

for iInRow in inputRows:
    inGeom = iInRow.shape
    iCounter+=1
    iCounter2+=1    
    if (iCounter2 &gt; (OnePercentThreshold+0)):
        printit("Processing Record "+str(iCounter) + " of "+ str(numRecords))
        iCounter2=0

    if (inGeom.length &gt; alongDist):
        shapeList = splitShape(iInRow.shape,alongDist)

        for itmp in shapeList:
            newRow = outputRows.newRow()
            for ifield in fields:
                if (ifield.editable):
                    newRow.setValue(ifield.name,iInRow.getValue(ifield.name))
            newRow.shape = itmp
            outputRows.insertRow(newRow)
    else:
        outputRows.insertRow(iInRow)

del inputRows
del outputRows

printit("Done!")</pre>
</blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nodedangles.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nodedangles.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nodedangles.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nodedangles.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nodedangles.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nodedangles.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nodedangles.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nodedangles.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nodedangles.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nodedangles.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nodedangles.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nodedangles.wordpress.com/528/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nodedangles.wordpress.com/528/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nodedangles.wordpress.com/528/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nodedangles.wordpress.com&amp;blog=13690265&amp;post=528&amp;subd=nodedangles&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nodedangles.wordpress.com/2011/05/01/quick-dirty-arcpy-batch-splitting-polylines-to-a-specific-length/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<georss:point>44.852994 -93.550730</georss:point>
		<geo:lat>44.852994</geo:lat>
		<geo:long>-93.550730</geo:long>
		<media:content url="http://1.gravatar.com/avatar/31381fd01a52a50d45d881050418ab4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maprantala</media:title>
		</media:content>
	</item>
	</channel>
</rss>
