Rotate Raster - Model Builder - Name From Variable

4240
5
Jump to solution
04-13-2015 09:02 AM
jamiefinney
New Contributor III

I'm having some problems with a model i'm attempting to make.

I have a folder of jpgs that i need to rotate.
I have also created a shp file that contains the jpg name / path and the angle to rotate by.

I'm hoping to use an iterator to select each row of the table, extract the file path / name and rotate the appropriate raster.

The tool i'm attempting to use is the rotate raster tool
Toolbox > Data Management Tools > Projections and transformations > raster > rotate

however i can't seem to get the rotate tool to accept the input raster (using get field value tool)

Is there any way i can make this work?

Using ArcView 10 sp5

0 Kudos
1 Solution

Accepted Solutions
KishorGhatage
Occasional Contributor III

As per documentation the tool takes raster layer and mosaic layer. Hence, I believe, it is giving the above error.

Set data type to Raster layer and see if it works.

ArcGIS Help 10.1

Also you can create an in_memory raster layer using Make raster layer tool (Data Management) after Get Value  in model builder and provide it to Rotate tool. Here set the data type to Raster dataset in Get Value tool

ArcGIS Desktop

test.png

Hope this helps

Kishor.

View solution in original post

5 Replies
GabrielUpchurch1
Occasional Contributor III

Hi Jamie,

What does the red X report the error is when you click on it?

0 Kudos
jamiefinney
New Contributor III

Thank you both for your answers.

Gabriel Upchurch

i've attached a screenshot of the error. The problem seems to be that the rotate tool doesn't seem to want to accept an in-line variable as its input to the rotate tool.

The file ie. G:\Hotlinking_Images\P1010471.JPG already exists so its not an error because the file doesn't exist / hasn't been created yet.

For the Get Field Value for the "Img_Path" i have tried setting the Data Type to string and raster dataset and it doesn't seem to make any difference.

I've also attached a screenshot of the data type for the FPath column (this is the value collected for the input .jpg)

Chris Donohue

I've changed it to "G:\Hotlinking_Images" and it doesn't make any difference.

0 Kudos
ChrisDonohue__GISP
MVP Alum

Something to try - put an underscore in the folder name if it currently has a space. 

Hotlinking_Images

Chris Donohue, GISP

0 Kudos
KishorGhatage
Occasional Contributor III

As per documentation the tool takes raster layer and mosaic layer. Hence, I believe, it is giving the above error.

Set data type to Raster layer and see if it works.

ArcGIS Help 10.1

Also you can create an in_memory raster layer using Make raster layer tool (Data Management) after Get Value  in model builder and provide it to Rotate tool. Here set the data type to Raster dataset in Get Value tool

ArcGIS Desktop

test.png

Hope this helps

Kishor.

jamiefinney
New Contributor III

Kishor Ghatage

Thank you so much for this, its been driving me nuts.

solution was similar to your suggestion i set Img_path field to "Raster Dataset" type then as you suggested used the make raster tool.

thanks everyone

0 Kudos