<?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/"
	>

<channel>
	<title>Siliconcreek.net: The Blog of Andrew Rohne &#187; GIS</title>
	<atom:link href="http://www.siliconcreek.net/tag/gis/feed" rel="self" type="application/rss+xml" />
	<link>http://www.siliconcreek.net</link>
	<description>This is the unfiltered personal website of Andrew Rohne, expert Cube Voyager user, transportation planner, engineer, programmer, ham radio operator, and all-around geek.</description>
	<lastBuildDate>Fri, 30 Sep 2011 14:37:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Python and Cube</title>
		<link>http://www.siliconcreek.net/transportation/python-and-cube</link>
		<comments>http://www.siliconcreek.net/transportation/python-and-cube#comments</comments>
		<pubDate>Sun, 19 Dec 2010 13:00:24 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Transportation]]></category>
		<category><![CDATA[cube]]></category>
		<category><![CDATA[GIS]]></category>
		<category><![CDATA[Pilot]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[voyager]]></category>

		<guid isPermaLink="false">http://www.siliconcreek.net/?p=674</guid>
		<description><![CDATA[One of the advantages of the ESRI ArcGIS Framework is that you can write Python scripts that do GIS things and run them from Cube.  Even better, Cube uses the Geodatabase format, so you can store and retrieve things from there. The first thing that is needed is a python script.  The below is an [...]]]></description>
			<content:encoded><![CDATA[<p>One of the advantages of the ESRI ArcGIS Framework is that you can write Python scripts that do GIS things and run them from Cube.  Even better, Cube uses the Geodatabase format, so you can store and retrieve things from there.</p>
<p>The first thing that is needed is a python script.  The below is an example that we&#8217;re not using at the moment, but it merges multiple transit line files together.</p>
<pre class="brush:python">import arcgisscripting, sys, os
gp=arcgisscripting.create()

gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolBox/Toolboxes/Data Management Tools.tbx")

print sys.argv

input1=sys.argv[1]
input2=sys.argv[2]
output=sys.argv[3]

in1=input1+input1[input1.rfind("\\"):]+"_PTLine"
in2=input2+input2[input2.rfind("\\"):]+"_PTLine"

input=in1+';'+in2
input=input.replace("\\","/")
output=output.replace("\\","/")

print input
print output

if gp.Exists(output):
    gp.delete_management(output)

#input=input1+"_PTLine" +';'+input2 +"_PTLine"

gp.Merge_management(input,output)

print gp.GetMessage

del gp</pre>
<p>To call this, we add the following in a Pilot script:</p>
<pre class="brush:plain">*merge.py {CATALOG_DIR}\Inputs\Transit.mdb\Routes1 {CATALOG_DIR}\Inputs\Transit.mdb\Routes2 {CATALOG_DIR}\Inputs\Transit.mdb\RoutesCombined</pre>
<p>This makes it easy to create geoprocessing steps in ArcMap, export them to Python, and call them from the model.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.siliconcreek.net/transportation/python-and-cube/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
