Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Skipping over an already existing file during the for loop

$
0
0
Hello All,

I am running a very simple script where I made a list of geo-referenced aerial photos as a text (CSV) file and then using this list in a for statement to re-project the aerial photos.

I am having a problem where there seems to be files with the same name and the script stops when it encounters an already existing file (the aerial photos is re-projected and while attempting to re-project the duplicate) the script stops.

error message:
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000725: Output Raster Dataset: Dataset X:\Archive\1930_1949\MO\JP2_Zone15\1939_03_11_11_310.jp2 already exists.
Failed to execute (ProjectRaster).

I tried to use the pass it simply passes over the existing files but does not run the loop further.

Any & all help is greatly appreciated.

Viewing all articles
Browse latest Browse all 2485

Trending Articles