<?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 Keeping Empty ShapeFiles? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309132#M13420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a tool in python that can potentially find areas of wind turbines by county. I have the correct process down, but in some counties there are parameters that don't exist. So for example I take into account airports, hydrology, slope, roads, urban areas, and more. But what if an area does not have that parameter ie. no military zones in some counties. But I have a code that requires the military area. Is there a way to use the tool so that it can ignore certain parameters when there is no data? Below is the piece of code that is giving me issues. I would still like to use this code, but I need it to work when there is no data in some of the shape files. I feel there is a way to do this without having to write a ton of if-then blocks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;analysis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Union&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Airports&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Native&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Parks&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufRail&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Urban&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufRoads&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Forests&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Military&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufStreams&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufWaterBodies&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Workings&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Avoid.shp"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GAPS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;-Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 May 2018 05:32:06 GMT</pubDate>
    <dc:creator>AaronChristiansen</dc:creator>
    <dc:date>2018-05-08T05:32:06Z</dc:date>
    <item>
      <title>Keeping Empty ShapeFiles?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309132#M13420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a tool in python that can potentially find areas of wind turbines by county. I have the correct process down, but in some counties there are parameters that don't exist. So for example I take into account airports, hydrology, slope, roads, urban areas, and more. But what if an area does not have that parameter ie. no military zones in some counties. But I have a code that requires the military area. Is there a way to use the tool so that it can ignore certain parameters when there is no data? Below is the piece of code that is giving me issues. I would still like to use this code, but I need it to work when there is no data in some of the shape files. I feel there is a way to do this without having to write a ton of if-then blocks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;analysis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Union&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Airports&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Native&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Parks&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufRail&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Urban&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufRoads&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Forests&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Military&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufStreams&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufWaterBodies&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Workings&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Avoid.shp"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GAPS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;-Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2018 05:32:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309132#M13420</guid>
      <dc:creator>AaronChristiansen</dc:creator>
      <dc:date>2018-05-08T05:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping Empty ShapeFiles?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309133#M13421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aaron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This thread might be best placed in the &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;‌ place.&lt;/P&gt;&lt;P&gt;Would it be acceptable to have null values in your code and/or attributes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2018 06:27:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309133#M13421</guid>
      <dc:creator>AdrianWelsh</dc:creator>
      <dc:date>2018-05-08T06:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping Empty ShapeFiles?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309134#M13422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Adrian,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your feedback. Null values are fine for this analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2018 07:04:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309134#M13422</guid>
      <dc:creator>AaronChristiansen</dc:creator>
      <dc:date>2018-05-08T07:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping Empty ShapeFiles?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309135#M13423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How do you specify the input for the tool? Is each layer a separate parameter or do you let the user select a list of featureclasses with a single control?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2018 12:35:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309135#M13423</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-05-08T12:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping Empty ShapeFiles?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309136#M13424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So each input has been specified in precursor code using a gui and each layer is a separate parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2018 19:07:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309136#M13424</guid>
      <dc:creator>AaronChristiansen</dc:creator>
      <dc:date>2018-05-08T19:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping Empty ShapeFiles?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309137#M13425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If each&amp;nbsp;has it's own variable, you can validate to see if it is empty and exclude it from the list. Look at the snippet below:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;Airports &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'blah 1'&lt;/SPAN&gt;
Native &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'blah 2'&lt;/SPAN&gt;
Parks &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None&amp;nbsp; &lt;SPAN class="comment token"&gt;# not sure if it will be an empty string or null&lt;/SPAN&gt;
BufRail &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'blah 4'&lt;/SPAN&gt;
Urban &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'blah 5'&lt;/SPAN&gt;
BufRoads &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;# not sure if it will be an empty string or null&lt;/SPAN&gt;
Forests &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'blah 6'&lt;/SPAN&gt;
Military &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'blah 7'&lt;/SPAN&gt;
BufStreams &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; None&amp;nbsp; &lt;SPAN class="comment token"&gt;# not sure if it will be an empty string or null&lt;/SPAN&gt;
BufWaterBodies &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'blah 8'&lt;/SPAN&gt;

lst &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Airports&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Native&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Parks&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufRail&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Urban&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufRoads&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Forests&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Military&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufStreams&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; BufWaterBodies&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

new_lst1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;a &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; a &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; lst &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
new_lst2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;a &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; a &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; lst &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
new_lst3 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;a &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; a &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; lst &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; None &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; a &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;''&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; lst
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; new_lst1
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; new_lst2
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; new_lst3
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will yield:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;['blah 1', 'blah 2', None, 'blah 4', 'blah 5', '', 'blah 6', 'blah 7', None, 'blah 8']
['blah 1', 'blah 2', None, 'blah 4', 'blah 5', 'blah 6', 'blah 7', None, 'blah 8']
['blah 1', 'blah 2', 'blah 4', 'blah 5', '', 'blah 6', 'blah 7', 'blah 8']
['blah 1', 'blah 2', 'blah 4', 'blah 5', 'blah 6', 'blah 7', 'blah 8']&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the new list in the Union:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;analysis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Union&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;new_lst3&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Workings&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Avoid.shp"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GAPS"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will probably have to check to see if the list has at least 2 items to avoid problems.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309137#M13425</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T14:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping Empty ShapeFiles?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309138#M13426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;This will definitely help me!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aaron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2018 23:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/keeping-empty-shapefiles/m-p/309138#M13426</guid>
      <dc:creator>AaronChristiansen</dc:creator>
      <dc:date>2018-05-09T23:32:12Z</dc:date>
    </item>
  </channel>
</rss>

