<?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: Problem: Feature to Raster converstion using python scipt in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405697#M31916</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After changing to feature class, it shows similar error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;hzhu is correct.&amp;nbsp; You are specifying a shapefile rather than a feature class.&amp;nbsp; Change:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;inFeature = "soilmu_in.shp"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;to&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;inFeature = "soilmu_in"&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2011 13:48:14 GMT</pubDate>
    <dc:creator>ZiaAhmed</dc:creator>
    <dc:date>2011-08-17T13:48:14Z</dc:date>
    <item>
      <title>Problem: Feature to Raster converstion using python scipt</title>
      <link>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405693#M31912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to convert a shape file to raster by a python script. But it did not work. However,&amp;nbsp; this conversion was done successfully by&amp;nbsp; ArcToolBox. I used similar parmeters for raster conversion in the script - but I have got following errors. Any idea? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# print arcpy.GetMessages&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Traceback (most recent call last):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "K:\SCRIPT\Python_Script\ShapeToRaster.py", line 22, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.FeatureToRaster_conversion(inFeatures, field, outRaster, cellSize)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1686, in FeatureToRaster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000860: Input features: is not the type of Composite Geodataset, or does not exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 001000: Field: Field MUKEY does not exist&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (FeatureToRaster).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;---------------------------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Import system modules&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, os,sys&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Set environment settings&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace = "K:/STATE_MUKEY/AREA.gdb"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Set local variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;inFeature = "soilmu_in.shp"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;field = "MUKEY"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outRaster = "K:/STATE_MUKEY/RASTER.gdb/soilmu_in"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#assignmentType = "CELL_CENTER"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#priorityField = "NONE"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cellSize = 90&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Execute FeatureToRaster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.FeatureToRaster_conversion(inFeature, field, outRaster, cellSize)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print arcpy.GetMessages&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 06:46:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405693#M31912</guid>
      <dc:creator>ZiaAhmed</dc:creator>
      <dc:date>2011-08-17T06:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: Feature to Raster converstion using python scipt</title>
      <link>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405694#M31913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am trying to convert a shape file to raster by a python script. But it did not work. However,&amp;nbsp; this conversion was done successfully by&amp;nbsp; ArcToolBox. I used similar parmeters for raster conversion in the script - but I have got following errors. Any idea? &lt;BR /&gt;&lt;BR /&gt;# print arcpy.GetMessages&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;&amp;nbsp; File "K:\SCRIPT\Python_Script\ShapeToRaster.py", line 22, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.FeatureToRaster_conversion(inFeatures, field, outRaster, cellSize)&lt;BR /&gt;&amp;nbsp; File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1686, in FeatureToRaster&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;BR /&gt;ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000860: Input features: is not the type of Composite Geodataset, or does not exist.&lt;BR /&gt;ERROR 001000: Field: Field MUKEY does not exist&lt;BR /&gt;Failed to execute (FeatureToRaster).&lt;BR /&gt;&lt;BR /&gt;---------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;# Import system modules&lt;BR /&gt;import arcpy, os,sys&lt;BR /&gt;#&lt;BR /&gt;# Set environment settings&lt;BR /&gt;arcpy.env.workspace = "K:/STATE_MUKEY/AREA.gdb"&lt;BR /&gt;#&lt;BR /&gt;# Set local variables&lt;BR /&gt;inFeature = "soilmu_in.shp"&lt;BR /&gt;field = "MUKEY"&lt;BR /&gt;outRaster = "K:/STATE_MUKEY/RASTER.gdb/soilmu_in"&lt;BR /&gt;#assignmentType = "CELL_CENTER"&lt;BR /&gt;#priorityField = "NONE"&lt;BR /&gt;cellSize = 90&lt;BR /&gt;&lt;BR /&gt;# Execute FeatureToRaster&lt;BR /&gt;arcpy.FeatureToRaster_conversion(inFeature, field, outRaster, cellSize)&lt;BR /&gt;&lt;BR /&gt;print arcpy.GetMessages&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You set up arcpy.env.workspace = "K:/STATE_MUKEY/AREA.gdb" and inFeature = "soilmu_in.shp".&amp;nbsp; Basically you are telling arcpy to find soilmu_in.shp in K:/STATE_MUKEY/AREA.gdb, which does not exist.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 11:49:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405694#M31913</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2011-08-17T11:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: Feature to Raster converstion using python scipt</title>
      <link>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405695#M31914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks your reply. These is exist! Please see the attachment.&amp;nbsp; I mentioned before, I converted this file to raster using ArcTool box. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You set up arcpy.env.workspace = "K:/STATE_MUKEY/AREA.gdb" and inFeature = "soilmu_in.shp".&amp;nbsp; Basically you are telling arcpy to find soilmu_in.shp in K:/STATE_MUKEY/AREA.gdb, which does not exist.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 12:25:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405695#M31914</guid>
      <dc:creator>ZiaAhmed</dc:creator>
      <dc:date>2011-08-17T12:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: Feature to Raster converstion using python scipt</title>
      <link>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405696#M31915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hzhu is correct.&amp;nbsp; You are specifying a shapefile rather than a feature class.&amp;nbsp; Change:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;inFeature = "soilmu_in.shp"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;inFeature = "soilmu_in"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 13:02:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405696#M31915</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2011-08-17T13:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: Feature to Raster converstion using python scipt</title>
      <link>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405697#M31916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After changing to feature class, it shows similar error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;hzhu is correct.&amp;nbsp; You are specifying a shapefile rather than a feature class.&amp;nbsp; Change:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;inFeature = "soilmu_in.shp"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;to&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;inFeature = "soilmu_in"&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 13:48:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405697#M31916</guid>
      <dc:creator>ZiaAhmed</dc:creator>
      <dc:date>2011-08-17T13:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: Feature to Raster converstion using python scipt</title>
      <link>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405698#M31917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks your reply. These is exist! Please see the attachment.&amp;nbsp; I mentioned before, I converted this file to raster using ArcTool box.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Your code specified you shape file in "K:/STATE_MUKEY/AREA.gdb", which is obviously wrong.&amp;nbsp; You should specify the full path of your shape file (wherever that is). like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
inFeature = "K:/STATE_MUKEY/soilmu_in.shp"

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:27:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405698#M31917</guid>
      <dc:creator>HemingZhu</dc:creator>
      <dc:date>2021-12-11T18:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: Feature to Raster converstion using python scipt</title>
      <link>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405699#M31918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Following script works well for this example (Indiana) and as well for other States. This&amp;nbsp; script was imported&amp;nbsp; from Model Builder. Thanks Zia&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Import arcpy module&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Local variables:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;soilmu_in= "K:\\STATE_ MUKEY\\AREA.gdb\\soilmu_in"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;soilmu_in__2_ = "K:\\STATE_ MUKEY\\RASTER.gdb\\soilmu_in"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Polygon to Raster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.PolygonToRaster_conversion(soilmu_in, "MUKEY", soilmu_in__2_, "CELL_CENTER", "NONE", "90")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;print arcpy.GetMessages&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Your code specified you shape file in "K:/STATE_MUKEY/AREA.gdb", which is obviously wrong.&amp;nbsp; You should specify the full path of your shape file (wherever that is). like this&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
inFeature = "K:/STATE_MUKEY/soilmu_in.shp"

&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:27:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405699#M31918</guid>
      <dc:creator>ZiaAhmed</dc:creator>
      <dc:date>2021-12-11T18:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem: Feature to Raster converstion using python scipt</title>
      <link>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405700#M31919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, I got the same Error recently. But my problem is some about raster not shapefile.And&amp;nbsp; finally I work it out by the key of datatype. For example I want to use "GreaterThanEqual" in my model, so I create a variable with the default datatype "Raster Dataset" and when I use my tool in code, I got the error like this,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000860: Input raster or constant value 1: is not the type of Composite Geodataset, or does not exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000860: Input raster or constant value 1: is not the type of Composite Geodataset, or does not exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Model3).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And while I change the datatype from "Raster Dataset" into "Raster Layer" , my code ,the same code, works well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I think we can do something by the Datatype.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Further, to my surprise, when I change the datatype from "Raster Layer" back to "Raster Dataset", my code still work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am confused. I am not sure,but my code could work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;May you succeed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Jul 2012 09:36:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-feature-to-raster-converstion-using-python/m-p/405700#M31919</guid>
      <dc:creator>__4</dc:creator>
      <dc:date>2012-07-22T09:36:09Z</dc:date>
    </item>
  </channel>
</rss>

