Export to TIFF Script Crashes

320
5
01-07-2018 03:55 PM
AlfredKalyanapu
New Contributor

Hello All,

I am new to ArcGIS Pro and to Python Programming. I recently made a python script intended to iteratively add raster layer to my 3D scene, then generate a TIFF and remove the raster layer and move on to the next iteration. When I run the script, ArcGIS Pro crashes. I have no idea how to proceed further. Any help will be much appreciated. I attached the python script to this message, for your reference.

Sincerely,

Alfred

0 Kudos
5 Replies
DanPatterson_Retired
MVP Esteemed Contributor

what happens when you run through the process once manually and copy the Results window to a script?  Does the process work manually or fail?

0 Kudos
AlfredKalyanapu
New Contributor

Thanks for the response Dan.

I ran through the process using the Python command line prompt within ArcGIS Pro first (without for loop though). It worked without have any issues then. After that I created the script and ran without For loop for just one raster, and it worked. It is when I put the For loop in, when it started crashing.

Regards,

Alfred

EDIT: I was able to isolate the crash trigger to "sc1.removeLayer(layer)". Any thoughts?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

I would make sure that the layer is indeed there prior to removelayer by printing its path.  I am wondering if removelayer is the correct approach if you aren';t actually running this with arcmap open.  It may be delete layer.  In any event, check the sizes of the files and just leave them alone until the process runs then delete later if possible.  If not, try it in Pro

AlfredKalyanapu
New Contributor

Thanks for your suggestion Dan. This issue is solved now. As you suggested, I first created raster layers in the proper symbology and ran the script to add raster layers and iterated through the layer list to export the tiff images.

I appreciate your help!

Regards,

Alfred

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

No problem... glad it worked out

0 Kudos