<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: raster to polygon conversion in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-to-polygon-conversion/m-p/90854#M1264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The above code worked. Except I had to replace inraster by i in&lt;/P&gt;&lt;P&gt;"arcpy.RasterToPolygon_conversion(inraster, outPolygons, "NO_SIMPLIFY", field)"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jul 2014 18:24:37 GMT</pubDate>
    <dc:creator>InceptionWoznicki</dc:creator>
    <dc:date>2014-07-28T18:24:37Z</dc:date>
    <item>
      <title>raster to polygon conversion</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-to-polygon-conversion/m-p/90851#M1261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I 'm trying to automate the conversion raster to polygon and the rasters files are in "TIF" format. I have the code below. However, I 'm getting an error while executing it. Could you have some suggestion please? Thank you very much for your time and help!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subhasis&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy, os&lt;/P&gt;&lt;P&gt;from arcpy import env&lt;/P&gt;&lt;P&gt;from arcpy.sa import *&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#To overwrite output&lt;/P&gt;&lt;P&gt;arcpy.env.overwriteOutput = True&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Set environment settings&lt;/P&gt;&lt;P&gt;env.workspace = "C:/Subhasis/Test/Neshanic_Python/extract"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;outws="C:/Subhasis/Test/Neshanic_Python/extract/clip/"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#checkout ArcGIS spatial analyst extension license&lt;/P&gt;&lt;P&gt;arcpy.CheckOutExtension("Spatial")&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;inraster = arcpy.ListRasters("*", "TIF")&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for i in inraster:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filename=os.path.splitext(i)[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; outPolygons= outws + str(filename) + '.shape'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; field = "VALUE"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.RasterToPolygon_conversion(inraster, outPolygons, "NO_SIMPLIFY", field)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 17:14:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-to-polygon-conversion/m-p/90851#M1261</guid>
      <dc:creator>InceptionWoznicki</dc:creator>
      <dc:date>2014-07-28T17:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: raster to polygon conversion</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-to-polygon-conversion/m-p/90852#M1262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is always a good thing to include the actual error message, since it helps us to determine the reason for which the error occurs. Another thing that would increase readability of the code, would be to use syntax highlighting. You can read more about this here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migration-blogpost/1070"&gt;Posting Code blocks in the new GeoNet&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You do not have to import the sa module, nor is it necessary to check out a sa license. All the tools you are using are available at each license level without the need for any extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice that you define the outPolygons by using ".shape"&amp;nbsp; as extension. If you want to create a shapefile, you should specify ".shp" as extension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 17:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-to-polygon-conversion/m-p/90852#M1262</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-07-28T17:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: raster to polygon conversion</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-to-polygon-conversion/m-p/90853#M1263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much Xander again! Yes, I should have posted the error message and would&amp;nbsp; read about code blocks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subhasis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 18:05:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-to-polygon-conversion/m-p/90853#M1263</guid>
      <dc:creator>InceptionWoznicki</dc:creator>
      <dc:date>2014-07-28T18:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: raster to polygon conversion</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-to-polygon-conversion/m-p/90854#M1264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The above code worked. Except I had to replace inraster by i in&lt;/P&gt;&lt;P&gt;"arcpy.RasterToPolygon_conversion(inraster, outPolygons, "NO_SIMPLIFY", field)"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 18:24:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/raster-to-polygon-conversion/m-p/90854#M1264</guid>
      <dc:creator>InceptionWoznicki</dc:creator>
      <dc:date>2014-07-28T18:24:37Z</dc:date>
    </item>
  </channel>
</rss>

