<?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 Extract value to point issues in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/extract-value-to-point-issues/m-p/322453#M25113</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Morning,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having trouble with the extract value to point tool. When my code tries to execute the tool, I&amp;nbsp; am returned the error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"NameError: name ExtractValuesToPoints is not defined"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As this is a python error not, a arcgis error I would assume it is something in my code, but I can not see it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My inputs are a feature class from a personal geodatabase and a raster dataset from the same PGDB. The output is a shapefile. I have isolated the portion of my program that uses the extract values function (below). I also saw on the help page the tool is not called through arcpy."toolname"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, os, gc from arcpy import env&amp;nbsp; #The ingut personal geodatabase env.workspace =r"C:\Users\david\Documents\ValidateChristina\Christina.mdb" #An output folder outLocation= r"C:\Users\david\Documents\ValidateChristina\OutLocation"&amp;nbsp; arcpy.env.overwriteOutput=True&amp;nbsp; #Loop through the feature datasets in the pgdb for dataset in arcpy.ListDatasets():&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #List the point files found in the current dataset &amp;nbsp;&amp;nbsp;&amp;nbsp; ptList = arcpy.ListFeatureClasses("*","POINT",dataset)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #list the rasters found in the pgdb &amp;nbsp;&amp;nbsp;&amp;nbsp; rasterList= arcpy.ListRasters() &amp;nbsp;&amp;nbsp;&amp;nbsp; print rasterList&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #loop through each poinf feature class in the list &amp;nbsp;&amp;nbsp;&amp;nbsp; for pointFC in ptList:&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Extract raster values that correspond with the listed point file &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in rasterList: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #perform the extract &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExtractValuesToPoints(pointFC,raster,outLocation+os.sep+"IntermValue.shp")&amp;nbsp; print "Done"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Apr 2012 13:04:38 GMT</pubDate>
    <dc:creator>DavidBirkigt</dc:creator>
    <dc:date>2012-04-12T13:04:38Z</dc:date>
    <item>
      <title>Extract value to point issues</title>
      <link>https://community.esri.com/t5/python-questions/extract-value-to-point-issues/m-p/322453#M25113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Morning,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having trouble with the extract value to point tool. When my code tries to execute the tool, I&amp;nbsp; am returned the error&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"NameError: name ExtractValuesToPoints is not defined"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As this is a python error not, a arcgis error I would assume it is something in my code, but I can not see it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My inputs are a feature class from a personal geodatabase and a raster dataset from the same PGDB. The output is a shapefile. I have isolated the portion of my program that uses the extract values function (below). I also saw on the help page the tool is not called through arcpy."toolname"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, os, gc from arcpy import env&amp;nbsp; #The ingut personal geodatabase env.workspace =r"C:\Users\david\Documents\ValidateChristina\Christina.mdb" #An output folder outLocation= r"C:\Users\david\Documents\ValidateChristina\OutLocation"&amp;nbsp; arcpy.env.overwriteOutput=True&amp;nbsp; #Loop through the feature datasets in the pgdb for dataset in arcpy.ListDatasets():&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #List the point files found in the current dataset &amp;nbsp;&amp;nbsp;&amp;nbsp; ptList = arcpy.ListFeatureClasses("*","POINT",dataset)&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #list the rasters found in the pgdb &amp;nbsp;&amp;nbsp;&amp;nbsp; rasterList= arcpy.ListRasters() &amp;nbsp;&amp;nbsp;&amp;nbsp; print rasterList&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #loop through each poinf feature class in the list &amp;nbsp;&amp;nbsp;&amp;nbsp; for pointFC in ptList:&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Extract raster values that correspond with the listed point file &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in rasterList: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #perform the extract &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExtractValuesToPoints(pointFC,raster,outLocation+os.sep+"IntermValue.shp")&amp;nbsp; print "Done"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 13:04:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-value-to-point-issues/m-p/322453#M25113</guid>
      <dc:creator>DavidBirkigt</dc:creator>
      <dc:date>2012-04-12T13:04:38Z</dc:date>
    </item>
    <item>
      <title>NameError: &lt;tool&gt; is not defined</title>
      <link>https://community.esri.com/t5/python-questions/extract-value-to-point-issues/m-p/322454#M25114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When my code tries to execute the tool, I&amp;nbsp; am returned the error&lt;BR /&gt;"NameError: name ExtractValuesToPoints is not defined"&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to specify the toolbox one of two ways.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is how they do it in help scripting example for &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z0000002t000000.htm" rel="nofollow" target="_blank"&gt;ExtractValuesToPoints:&lt;/A&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;from arcpy.sa import * ... ExtractValuesToPoints(...)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or you can skip the from/import and do it this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;arcpy.sa.ExtractValuesToPoints(...)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The old toolbox alias suffix syntax ("_sa") from Arc 9 arcgisscripting is not supported in arcpy for Spatial Analyst tools. (This change was to support these tools using the new pythonic Map Algebra.)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 14:57:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-value-to-point-issues/m-p/322454#M25114</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-04-12T14:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extract value to point issues</title>
      <link>https://community.esri.com/t5/python-questions/extract-value-to-point-issues/m-p/322455#M25115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I missed that in the help thread (probably stared at it for too long)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perfect answer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 15:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-value-to-point-issues/m-p/322455#M25115</guid>
      <dc:creator>DavidBirkigt</dc:creator>
      <dc:date>2012-04-12T15:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extract value to point issues</title>
      <link>https://community.esri.com/t5/python-questions/extract-value-to-point-issues/m-p/322456#M25116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Perfect answer.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, thank you. I want to add that one of the really nice advantages of arcpy is it allows use of intellisense using your IDE or the ArcMap python command line to easily solve these kinds of problems at "coding-time" instead of "run-time". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I still have to use arcgisscripting to maintain script tools that support 9.x and 10.x and I really miss the intellisense there!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 15:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/extract-value-to-point-issues/m-p/322456#M25116</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-04-12T15:15:46Z</dc:date>
    </item>
  </channel>
</rss>

