AnsweredAssumed Answered

Failed to execute (RastertoPolygon) Syntax error at or near symbol SPACE

Question asked by warlubartdu on May 21, 2015
Latest reply on May 21, 2015 by sephefox

I'm converting series of raster to polygon using RastertoPolygon in arcpy.


#import the module
import arcpy
from import *
from arcpy import env
.overwriteOutput = True

#set the workspace
.workspace = r"C:\thesis\for sampling\sampling_outputs\raster_per_biogeoregion"

#Get a list of rasters and convert to shapefile
for raster in arcpy.ListRasters("*Luzon_*.tif", "TIF"):
print raster #check the presence of rasters
.RasterToPolygon_conversion(raster, raster.replace("tif", "shp"), "NO_SIMPLIFY")
print "Finish converting all the rasters to polygon"


After several checks on the syntax, formatting, I've always been stuck with this error:


Traceback (most recent call last):
File "C:\Users\brentiebark\Dropbox\Python Scripts and mxds\", line 14, in <module>
.RasterToPolygon_conversion(raster, raster.replace("tif", "shp"), "NO_SIMPLIFY")
File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\", line 178, in RasterToPolygon
raise e
ExecuteError: ERROR 010328: Syntax error at or near symbol SPACE.
010267: Syntax error in parsing grid expression.
Failed to execute (RasterToPolygon).