GIS_meister

Iterator for raster to polygon

Discussion created by GIS_meister on Nov 24, 2017
Latest reply on Nov 27, 2017 by GIS_meister

Hi everyone,

 

I am trying to convert my raster (.tif) into simple polygon feature classes. I am fairly new to Python and this is the script I though of (which returns no error, but simply no results come from it):

import os
import arcpy
from arcpy.sa import *
from arcpy import env
arcpy.CheckOutExtension("spatial")
env.overwriteOutput=True

rootfolder="r'Z:\bda_7unzip\bda\LANDSAT 5\63_12'"
for root, dirs, files in os.walk(rootfolder):
    for d in dirs:
         NDSI = Raster(rootfolder+os.sep+d+os.sep+d+"_NDSI_tresh0.33.tif")
         arcpy.RasterToPolygon_conversion("NDSI",'rootfolder+os.sep+d+os.sep+d+"_NDSI_tresh0.33"',"SIMPLIFY","Value")

 

any thought on how I could modify this or new scripting ideas?

Outcomes