Hi,
I need to calculate some Euclidean Distances out of a list of FCs in a GDB.
I notice that when using an extent (in this case a global extent - see script) it does not work. It does work without specifying an extent but I do need to use one otherwise the resulting raster is a bit cut out at the edges.
When using the tool in ArcMap and specifying the extent in the Environments it does work.
Any help/suggestions will be greatly appreciated.
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="keyword token">from</SPAN> arcpy <SPAN class="keyword token">import</SPAN> env
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>overwriteOutput<SPAN class="operator token">=</SPAN><SPAN class="token boolean">True</SPAN>
<SPAN class="keyword token">from</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>sa <SPAN class="keyword token">import</SPAN><SPAN class="operator token">*</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>CheckOutExtension<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Spatial"</SPAN><SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>extent <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Extent<SPAN class="punctuation token">(</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">180.0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="number token">90.0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">180.0</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">90.0</SPAN><SPAN class="punctuation token">)</SPAN>
env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"H:\OUTPUT.gdb"</SPAN>
fcdist <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListFeatureClasses<SPAN class="punctuation token">(</SPAN><SPAN class="string token">""</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> fc <SPAN class="keyword token">in</SPAN> fcdist<SPAN class="punctuation token">:</SPAN>
output <SPAN class="operator token">=</SPAN> EucDistance<SPAN class="punctuation token">(</SPAN>fc<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">250000</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">10000</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">)</SPAN>
output<SPAN class="punctuation token">.</SPAN>save<SPAN class="punctuation token">(</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\\"</SPAN> <SPAN class="operator token">+</SPAN> fc <SPAN class="operator token">+</SPAN> <SPAN class="string token">"_250km"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>