Model Builder Cell Size

3831
3
01-07-2011 10:07 AM
DanielDillard
New Contributor II
Hi All,

I am having a problem with using a variable as the output cell size for the Feature to Raster tool in Model Builder.  I have tried using both a raster layer as the variable, as well as a cell size variable defined as a parameter for the model.  So far the only way I can get my output raster to have the correct cell size is to hard code it into the tool dialogue, which I am trying to avoid.  I have tried about every possible thing I can think of including changing the environment settings and nothing is working.  Please help!

Daniel
0 Kudos
3 Replies
curtvprice
MVP Esteemed Contributor
Hi All,

I am having a problem with using a variable as the output cell size for the Feature to Raster tool in Model Builder.  I have tried using both a raster layer as the variable, as well as a cell size variable defined as a parameter for the model.  So far the only way I can get my output raster to have the correct cell size is to hard code it into the tool dialogue, which I am trying to avoid.  I have tried about every possible thing I can think of including changing the environment settings and nothing is working.  Please help!

Daniel


You should be able to set the cell size in the environment of the model or of the tool in the model. Note that environment settings take priority as follows:

Script > Tool > Model > Application

So, for example, if you set a cell size in the ArcMap environment ("Application") and inside your model you right clicked on the tool and set a different cell size there, that takes priority.

However, if you set the cell size for the feature to raster tool with a variable, that should be the same as typing it into a dialog - and that will take precedence over the environment.

The best way to check this is to look at the dialog while the model runs - this will show you exactly what arguments the tool is recognizing.

BTW, You may want to try the newer tools (polygon to raster etc) as they provide more control over the conversion process.
0 Kudos
NoeLandaverde
New Contributor

I know this is a VERY OLD post, but this solution might be useful for someone coming across this error in the future:

Whenever you use the Calculate Value/Get Field Value Utility in Model Builder, you have to make sure that the output variable type is the same as the one required for the next tool in your model. For example, I am running the Get Field Value tool on a Summary Statistics Table to retrieve the Minimum value of my input data.

Then, I am using this value as the cell size for an output raster. By going to the documentation for a tool, you can find out the data type required for each of the parameter, which for my tool (Point to Raster) is Analysis cell size. 

I set the output type to this (on the Data Type field of the Utility I am using), and now I can connect the tools and choose Cell size as the input parameter.

curtvprice
MVP Esteemed Contributor

The Calculate Value tool is very helpful for not only doing calculations, but casting strings to a data type needed by the tool. Great comment.

0 Kudos