<?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: creating and populating domains in python, short vs longs in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33357#M2610</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Duncan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GREAT! Would not have found that myself for at least a year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit:&lt;/P&gt;&lt;P&gt;Having said that; 8 out of 9 csv's behave as predicted, one still gets converted using a long?? d4fvq?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I threw everything away and rerun my script, now 2 out of 9 domains having a long in stead of a short??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Awkward.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Oct 2014 06:54:22 GMT</pubDate>
    <dc:creator>Gisbert61</dc:creator>
    <dc:date>2014-10-28T06:54:22Z</dc:date>
    <item>
      <title>creating and populating domains in python, short vs longs</title>
      <link>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33354#M2607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to use about ten domains each having between 10-100 coded values. The values may change over time as I receive feedback on the validity. Typing them by hand is not a feasible option&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created CSV's using Excel with the following format:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1;Snake&lt;/P&gt;&lt;P&gt;2;Fish&lt;/P&gt;&lt;P&gt;3;Mammal&lt;/P&gt;&lt;P&gt;4;Critter&lt;/P&gt;&lt;P&gt;and so on&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Using&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;arcpy.CreateDomain_management(WorkSpace, "D_all", "all", "LONG", "CODED", "DEFAULT", "DEFAULT")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can create a domain which I can populate using&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;arcpy.TableToDomain_management(all_csv, "Field1", "Field2", WorkSpace, "D_all", "all", "REPLACE")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;So far, so good. &lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;But I don't seem to be able to use this domain in my featureclass properties/subtypes unless I use a 'SHORT' instead of a 'LONG'. Unfortunately when I create the domain using a 'SHORT' I get an error when using the TableToDomain function (error 000307)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;does anyone has any idea on how to either populate the domain using a 'SHORT' as the coded value or how to get it working in my featureclass properties/subtypes?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Bert&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;By the way, how can I mark code as 'code' in this editor??&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 15:47:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33354#M2607</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2014-10-27T15:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: creating and populating domains in python, short vs longs</title>
      <link>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33355#M2608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To mark code as code you need to click on the use advance editor then &amp;gt;&amp;gt; and choose the language under syntax highlighting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 16:27:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33355#M2608</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2014-10-27T16:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: creating and populating domains in python, short vs longs</title>
      <link>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33356#M2609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The easiest solution to this is use the Table to Table tool and convert your CSV file into a DBF file and explicitly set the field type to SHORT in the Field Map parameter. The DBF will then be read in correctly when you run the &lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;TableToDomain.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 16:44:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33356#M2609</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2014-10-27T16:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: creating and populating domains in python, short vs longs</title>
      <link>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33357#M2610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Duncan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GREAT! Would not have found that myself for at least a year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit:&lt;/P&gt;&lt;P&gt;Having said that; 8 out of 9 csv's behave as predicted, one still gets converted using a long?? d4fvq?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I threw everything away and rerun my script, now 2 out of 9 domains having a long in stead of a short??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Awkward.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 06:54:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33357#M2610</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2014-10-28T06:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: creating and populating domains in python, short vs longs</title>
      <link>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33358#M2611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the biggest number you are using? Data type short covers a range of -32,768 to 32,767 are you exceed this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 16:49:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33358#M2611</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2014-10-28T16:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: creating and populating domains in python, short vs longs</title>
      <link>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33359#M2612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;biggest numbet is 99.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At this stage of development my 'script' if it deserves that name has no loops or variables, just repeating lines of code. I deleted all faulty lines and copied-pasted-and-edited them again from working examples. In the end I had a script which works repeatedly without errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it must have been syntax errors of some sort. Now It's working I'll rewrite it using a loop and variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 19:52:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-and-populating-domains-in-python-short-vs/m-p/33359#M2612</guid>
      <dc:creator>Gisbert61</dc:creator>
      <dc:date>2014-10-28T19:52:30Z</dc:date>
    </item>
  </channel>
</rss>

