Raster to Polyline Problem

1604
1
Jump to solution
01-12-2017 08:36 AM
BenRufenacht
New Contributor III

I am using raster to polyline in a python script, and it is not generating the results I would expect.  When I run the toolbox raster to polyline with the same parameters, I get the results I expect.  In the attached image, the green shows the input raster cells (cell value of 1), the blue line shows the toolbox results and the black line shows my script results.  Any ideas as to what would be causing the difference in the line output when the input and the parameters are exactly the same?

Here is the raster to polyline command in the script:

arcpy.RasterToPolyline_conversion(Filter3, breaklinesFull, "ZERO", cellSize*1.42, "NO_SIMPLIFY")
0 Kudos
1 Solution

Accepted Solutions
curtvprice
MVP Esteemed Contributor

I would guess the environment settings at runtime in the Python session are different from those that are set in ArcMap when you run the tool interactively.

In Python, make sure the environment extent, cellSize, snapRaster, and outputCoordinateSystem are the same as they were for your ArcMap interactive processing. 

View solution in original post

0 Kudos
1 Reply
curtvprice
MVP Esteemed Contributor

I would guess the environment settings at runtime in the Python session are different from those that are set in ArcMap when you run the tool interactively.

In Python, make sure the environment extent, cellSize, snapRaster, and outputCoordinateSystem are the same as they were for your ArcMap interactive processing. 

0 Kudos