Select to view content in your preferred language

Issue with TIN to Raster Conversion in ArcPy – Cannot Set Cell Size Below 1

154
3
3 weeks ago
Luis761
New Contributor

 

Hi everyone,

I'm working with ArcPy and using the TIN to Raster tool in my current workflow. The raster cell size is a parameter that can be set via a GUI input. However, whenever I try to set the raster size to a value smaller than 1, I receive the following error:

ERROR 000323: The parameter value must be greater than 0.
Failed to execute (TinRaster).

Here’s the relevant code snippet:

# 4.2) TIN to raster
out_tif = os.path.join(workspace_raster, "raster_1")
arcpy.ddd.TinRaster(tin_raster, out_tif, "FLOAT", "LINEAR", "CELLSIZE", raster_size)

  • The code works as long as raster_size is greater than or equal to 1.

  • Setting a value below 1, either by passing the parameter or hardcoding it (e.g., raster_size = 0.5), always results in the error above.

  • Attempting to use the "CELLSIZE 0.5" syntax for sample_distance doesn’t resolve the issue either.

What's strange:
When I use the TIN to Raster tool directly in the ArcGIS Pro GUI, I can set cell sizes smaller than 1 with no problems on the same data.

Has anyone else experienced this?
Is there a workaround or a way to bypass this limitation in ArcPy, without having to resort to the manual tool in ArcGIS Pro?

Thanks in advance for any advice or ideas!

Kind regards, Luis

 

 

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

Have a look at specifying the z-factor and the last parameter explicitly

arcpy.ddd.TinRaster(in_tin, out_raster, {data_type}, {method}, {sample_distance}, {z_factor}, sample_value)

....  "FLOAT", "LINEAR", "CELLSIZE", 1.0, 0.5)

data_type  Float 

method  linear 

sample_distance cellsize      cellsize needs a value from the last parameter, the tool

z_factor  1.0   optional, but specify as a float

sample value    0.5   The cell size to use 

 

 


... sort of retired...
0 Kudos
Luis761
New Contributor

Hey thanks a lot for your answer. Unfortunately I get the same error with this approach..

0 Kudos
DanPatterson
MVP Esteemed Contributor

Tech support would be your best bet now


... sort of retired...
0 Kudos