Hello All,
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.
Thanks in advance!
arcpy<SPAN class="punctuation token">.</SPAN>analysis<SPAN class="punctuation token">.</SPAN>Union<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>Airports<SPAN class="punctuation token">,</SPAN> Native<SPAN class="punctuation token">,</SPAN> Parks<SPAN class="punctuation token">,</SPAN> BufRail<SPAN class="punctuation token">,</SPAN> Urban<SPAN class="punctuation token">,</SPAN> BufRoads<SPAN class="punctuation token">,</SPAN> Forests<SPAN class="punctuation token">,</SPAN> Military<SPAN class="punctuation token">,</SPAN> BufStreams<SPAN class="punctuation token">,</SPAN> BufWaterBodies<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN> Workings<SPAN class="operator token">+</SPAN><SPAN class="string token">"Avoid.shp"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"ALL"</SPAN><SPAN class="punctuation token">,</SPAN> None<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"GAPS"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
-Aaron