<?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: Get feature type and print in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56588#M1920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;"print" just does what it says, prints the value to the standard output (console window).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you want to do is test the value of outType against the different possible return values of the Describe object's DataType property. If it's a shapefile the value will be "Shapefile", if it's a CAD or Geodatabase feature class it will be "FeatureClass".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This property is mentioned in the help, but I don't think the return values are documented: &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1005&amp;amp;pid=980&amp;amp;topicname=Describe_Object_property"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1005&amp;amp;pid=980&amp;amp;topicname=Describe_Object_property&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Nov 2010 17:24:39 GMT</pubDate>
    <dc:creator>LoganPugh</dc:creator>
    <dc:date>2010-11-02T17:24:39Z</dc:date>
    <item>
      <title>Python: Get feature type and print</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56586#M1918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to take the output of my intersect and dissolve operations and determine whether it is a shapefile or a geodatabase feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If it is a shapefile, I need to add an "area" field and calculate it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First, if I use this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;desc = gp.Describe(dissolveOutputFC)
outType = desc.FeatureType&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;will FeatureType give me the information I need?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Second, how do I test it?&amp;nbsp; If I type:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;desc = gp.Describe(dissolveOutputFC)
outType = desc.FeatureType
print outType&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;STRONG&gt;where does it get printed to?&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have added the script to a toolbox in arc and specified the parameters that way.&amp;nbsp; I right-click &amp;gt; edit, to make any changes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I run it using pythonwin, how do I input the parameters?&amp;nbsp; Would it just be "path\file, path\file etc..."?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And last but not least, I am asking these simple questions because I can't find any documentation that would help me.&amp;nbsp; When I was learning VBA I would just google "iFeatureClass interface" for example, and that would lead me to the edn documentation that would list all the properties and methods of the interface.&amp;nbsp; Is there something similar for python, or the arcgisscripting module?&amp;nbsp; I am asking the above questions because I wasn't able to find out what gp.Describe is supposed to return.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my full code, for what it's worth:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Import Modules
import arcgisscripting

#Create Geoprocessor object
gp = arcgisscripting.create(9.3)
gp.overwriteoutput = True

# Intersect Catchments and Land Cover
catchmentsFC = gp.GetParameterAsText(0) #in a toolbox GUI, this should be Type = FeatureLayer
landCoverFC = gp.GetParameterAsText(1) #in a toolbox GUI, this should be Type = FeatureLayer
intersectOutputFC = gp.GetParameterAsText(2) #in a toolbox GUI, this should Type = FeatureClass
gp.Intersect_Analysis (catchmentsFC + ";" + landCoverFC, intersectOutputFC, "ALL", "", "INPUT")

# Dissolve output based on catchment and land cover IDs
# Field UCID (or other catchment ID) needs to be passed from the VBA code
dissolveOutputFC = gp.GetParameterAsText(3) #in a toolbox GUI, this should Type = FeatureClass
gp.Dissolve_management (intersectOutputFC, dissolveOutputFC, "UCID; GRIDCODE", "", "MULTI_PART", "")

# If the output is not a geodatabase feature class, then an area field must be calculated and added...
# And the necessary fields exported to dbf
# If the output is a geodatabase feature class, then the necessary fields are exported to dbf as is
desc = gp.Describe(dissolveOutputFC)
outType = desc.FeatureType
print outType&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 16:49:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56586#M1918</guid>
      <dc:creator>LornaMurison</dc:creator>
      <dc:date>2010-11-02T16:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Get feature type and print</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56587#M1919</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;You want desc.DataType&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will give you this kind of output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.shp = ShapeFile&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.dbf = DbaseTable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;temp.gdb/Business = FeatureClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;________________________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sounds like you're running your script from a ArcToolBox.&amp;nbsp; You need to use gp.AddMessage("Hi Mom.") instead of print.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"print" works if you're running your scripts from command line or pythonwin, to name a few.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;________________________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You input parameters in pythonwin by separating with a space.&amp;nbsp; e.g.&amp;nbsp; myscript.py apple banana pear&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;________________________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use the search here, lots of info to be had:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=About_batch_processing_with_scripts"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=About_batch_processing_with_scripts&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;________________________________________________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Describe outputs used to be listed in the help (like way back in 8.x maybe) but I haven't seen them in years.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;________________________________________________&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 17:12:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56587#M1919</guid>
      <dc:creator>RDHarles</dc:creator>
      <dc:date>2010-11-02T17:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Get feature type and print</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56588#M1920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;"print" just does what it says, prints the value to the standard output (console window).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What you want to do is test the value of outType against the different possible return values of the Describe object's DataType property. If it's a shapefile the value will be "Shapefile", if it's a CAD or Geodatabase feature class it will be "FeatureClass".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This property is mentioned in the help, but I don't think the return values are documented: &lt;/SPAN&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1005&amp;amp;pid=980&amp;amp;topicname=Describe_Object_property"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1005&amp;amp;pid=980&amp;amp;topicname=Describe_Object_property&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 17:24:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56588#M1920</guid>
      <dc:creator>LoganPugh</dc:creator>
      <dc:date>2010-11-02T17:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Get feature type and print</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56589#M1921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I usually debug my scripts in PythonWin using hardcoded gp.getparameterastext() values. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;##inputFC = gp.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;inputFC = r"C:\temp\test.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once it's working well I "un-hard code" the parameters and attach it to a toolbox.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 17:30:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56589#M1921</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-02T17:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Get feature type and print</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56590#M1922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank-you so much everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is all making a lot more sense now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this case:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;##inputFC = gp.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;inputFC = r"C:\temp\test.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What does the r mean?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 17:38:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56590#M1922</guid>
      <dc:creator>LornaMurison</dc:creator>
      <dc:date>2010-11-02T17:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Get feature type and print</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56591#M1923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It means to take the string between the quotes literally, a "string literal". Otherwise you would have to escape each backslash (a special character in Python) with another backslash. More specifically, the r stands for "raw string": &lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/String_literal#Raw_strings"&gt;http://en.wikipedia.org/wiki/String_literal#Raw_strings&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 17:50:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56591#M1923</guid>
      <dc:creator>LoganPugh</dc:creator>
      <dc:date>2010-11-02T17:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Get feature type and print</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56592#M1924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also: Here's the object model cheat sheet for the geoprocessing methods like gp.listfields() or gp.describe() - not for the tools though like gp.Clip_managment(). The help has more details, but it's nice to just have a single page reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://webhelp.esri.com/arcgisdesktop/9.3/pdf/Geoprocessor_93.pdf"&gt;http://webhelp.esri.com/arcgisdesktop/9.3/pdf/Geoprocessor_93.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Too bad ESRI didn't (yet!) make one of these bad boys for v10...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 18:22:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56592#M1924</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-02T18:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python: Get feature type and print</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56593#M1925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Help on Describe is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Describe/000v00000026000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Describe/000v00000026000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once on this page you can click on the link to the data element you will be describing to find out what the output type of the describe will be. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, this is what is returned when describing a feature class:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/FeatureClass_properties/000v0000002p000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/FeatureClass_properties/000v0000002p000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also notice in the summary in the help topic for feature classes that there is access to &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/000v/000v00000033000000.htm"&gt;Table Properties&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/000v/000v0000002m000000.htm"&gt;Dataset Properties&lt;/A&gt;&lt;SPAN&gt; as well. Most if not all data elements that you describe will inherit properties.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 14:01:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/python-get-feature-type-and-print/m-p/56593#M1925</guid>
      <dc:creator>RussellBrennan</dc:creator>
      <dc:date>2010-11-03T14:01:23Z</dc:date>
    </item>
  </channel>
</rss>

