Hi,
Im trying to learn to make geoprocessing tools.
Making a simple one to clip a raster but getting an error I cant decipher, from googling it looks like some kind of access violation.
heres my code
<SPAN class="keyword token">import</SPAN> arcpy
<SPAN class="comment token"># Set geoprocessing environments</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\Jim\BathySelect\BSelect.gdb"</SPAN>
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="comment token">#set params</SPAN>
inTif <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\Jim\BathySelect\Data\Bathy\Whole UK Mosaic.tif"</SPAN>
desc <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Describe<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"SelectPoly"</SPAN><SPAN class="punctuation token">)</SPAN>
outTif <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"C:\Jim\output.tif"</SPAN>
extent <SPAN class="operator token">=</SPAN> desc<SPAN class="punctuation token">.</SPAN>extent
rectangle <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>Polygon<SPAN class="punctuation token">(</SPAN>arcpy<SPAN class="punctuation token">.</SPAN>Array<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">[</SPAN>extent<SPAN class="punctuation token">.</SPAN>lowerLeft<SPAN class="punctuation token">,</SPAN> extent<SPAN class="punctuation token">.</SPAN>upperLeft<SPAN class="punctuation token">,</SPAN> extent<SPAN class="punctuation token">.</SPAN>upperRight<SPAN class="punctuation token">,</SPAN> extent<SPAN class="punctuation token">.</SPAN>lowerRight<SPAN class="punctuation token">,</SPAN> extent<SPAN class="punctuation token">.</SPAN>lowerLeft<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> desc<SPAN class="punctuation token">.</SPAN>spatialReference<SPAN class="punctuation token">)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>Clip_management<SPAN class="punctuation token">(</SPAN>inTif<SPAN class="punctuation token">,</SPAN> rectangle<SPAN class="punctuation token">,</SPAN> outTif<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>
heres my error
C:\Python27\ArcGIS10.6\python.exe C:/Jim/BathySelect/BathySelect.py
Process finished with exit code -1073741819 (0xC0000005)
I eventually want this to fire from a widget in a WAB app and return a zip file of multiple clipped images.