0

I have ~100 rasters I need to clip to an area. All rasters are saved as .bil files, and for use in later processing I was trying to make these have 'no extension for esri grid', but keep the same name. i.e. depth.bil becomes depth, hazard.bil becomes hazard etc. (There are multiple named files in each folder and in this model build example I am calling via %name% on iteration)

I tried to change this in 'calculate value' to take off the extension of the file:

expression = changeName("%Name%")
code block =  def changeName(name): return str(name[:-4])

This worked once, but when I changed folder it put it out of sync so it was naming files incorrectly to the raster it was clipping. If I don't remove this it says as a .bil file given it needs no extension in the clip tool. I can do some python but from what I know I would still be in the same predicament as this in ModelBuilder.

model build example

  • 1
    What's the question? – Iris Nov 23 '15 at 15:05
  • Sorry, it was how can I get all rasters to keep same name but become GRID format – stew Nov 25 '15 at 9:11
  • You can edit your question and add the question by using the "edit" button below your question. – Iris Nov 25 '15 at 9:14
0

AFAIK just removing an extension doesn't make a file a GRID format, what you need is the function Raster To Other Format (multiple)

enter image description here. You can use it in model builder. The tool takes all your images in a folder and save them under the same name but with your chosen data format in a folder you specify.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.