ERROR 000878: Output raster: The length of the grid base name is longer than 13

4140
6
02-17-2017 04:26 AM
by Anonymous User
Not applicable

I have created a model in ModelBuilder that outputs a number of .img raster datasets. It runs through the first iteration withtout any problems but then on the second loop it stops and gives this message: ERROR-000878: Output raster: The length of the grid base name in %scratchFolder%\%SpeciesName%_AMT_Suitability2.img is longer than 13.

I dont output any native GRID files anywhere in the model so I dont understand why I get this error.

I use an inline-variable for placing the temporary files in a scratch folder (%scratchfolder%) and I use inline variables for file-names. The file names are all longer than 13 characters (also for the successfull loop).

Can anyone help or at least explain so I understand? #grid-base-name

0 Kudos
6 Replies
DanPatterson_Retired
MVP Emeritus

can you print the actual path so it can be examined, there is also a total length issue

0 Kudos
by Anonymous User
Not applicable

This is the actual proces that went wrong:

Executing (Plus (2)): Plus "C:\Teaching\GISMOD2017\Exercise4\Scratch\Clethrionomys glareolus_AMT_min-max.img" "C:\Teaching\GISMOD2017\Exercise4\Scratch\Clethrionomys glareolus_AMT_2.5_Perc.img" "C:\Teaching\GISMOD2017\Exercise4\Scratch\Clethrionomys glareolus_AMT_Suitability2.img"

But this one was successful (previous iteration):

Executing (Plus (2)): Plus "C:\Teaching\GISMOD2017\Exercise4\Scratch\Apodemus sylvaticus_AMT_min-max.img" "C:\Teaching\GISMOD2017\Exercise4\Scratch\Apodemus sylvaticus_AMT_2.5_Perc.img" "C:\Teaching\GISMOD2017\Exercise4\Scratch\Apodemus sylvaticus_AMT_Suitability2.img"

0 Kudos
DanPatterson_Retired
MVP Emeritus

wow... spaces are iffy, but apparently you got one to work.  Do the file names have to be that long? and have you tried a different destination folder to rule out folder issues

0 Kudos
by Anonymous User
Not applicable

Thanks - I didnt notice the spaces issue. I will try to change the model accordingly and see if I can get it to run all iterations.

0 Kudos
curtvprice
MVP Esteemed Contributor

The raster processes sometimes require an intermediate dataset to be created in grid format. For this reason it's best to use short names for intermediate datasets you are throwing away anyway, and if you really require a long raster name for output, use Copy Raster to create it. This way you can even get away with spaces in your raster file name (though I still don't recommend it). It is also best to avoid any sort of special characters except _ in raster (or _any_) filenames. It may work, but may not work the next time you try.

For ModelBuilder you may want to use a folder and grids for intermediate datasets, for example %scratchFolder%\xxcostpath1 - using grids for intermediate rasters may be best for both performance and stability.

0 Kudos
curtvprice
MVP Esteemed Contributor

Just something to look out for, "\a"  in Python is a control character.

0 Kudos