ExtractValuesToPoints problem

749
5
06-11-2012 01:00 PM
charlotteGermain-Aubrey
New Contributor
Hello,
I can use the interface friendly version and extract the values but I need to automate things in Python. When I follow the Help example, I get an error message
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 999999: Error executing function. ("esri.SimpleDataConverter") Create output feature class failed ERROR 010024: Error during conversion. Failed to execute (ExtractValuesToPoints)

Anyone can help me with what is going on ? Maybe give me an example of a Python command for this tool ?
Thank you
Charlotte

code:

import arcpy
>>> from arcpy import env
>>> from arcpy.sa import *
>>> env.workspace = "C:/Users/Burleigh Lab/Desktop/2050Maps"
>>> ExtractValuesToPoints ("10000Points_lyr.shp", "forestacumina", "C:\Users\Burleigh Lab\Desktop\2050Maps\trial13.shp","NONE","VALUE_ONLY")
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 999999: Error executing function. ("esri.SimpleDataConverter") Create output feature class failed ERROR 010024: Error during conversion. Failed to execute (ExtractValuesToPoints).
Tags (2)
0 Kudos
5 Replies
MathewCoyle
Frequent Contributor
You have an invalid pathname.

Needs to be
r"C:\Users\Burleigh Lab\Desktop\2050Maps\trial13.shp"
0 Kudos
charlotteGermain-Aubrey
New Contributor
Thank you. I corrected the path name, but I still get a generic error....
Code:

>>> import arcpy
... from arcpy import env
... from arcpy.sa import *
... env.workspace = "C:/Users/cgermain/Desktop/2050Maps"
... ExtractValuesToPoints ("10000Points_lyr.shp", "FORESTacumina", r"C:/Users/cgermain/Desktop/2050Maps/FORESTacumina.shp","NONE","VALUE_ONLY")
...
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 999999: Error executing function. Failed to execute (ExtractValuesToPoints).
0 Kudos
MathewCoyle
Frequent Contributor
Entering valid paths.
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000000r000000

Have you checked out Spatial Analyst?

Since you set your workspace to "C:/Users/cgermain/Desktop/2050Maps" you can just do this.
ExtractValuesToPoints ("10000Points_lyr.shp", "FORESTacumina", "FORESTacumina.shp","NONE","VALUE_ONLY")


If that doesn't work I would try to test arcpy.Exists on each of those datasets in your workspace.
arcpy.Exists("10000Points_lyr.shp")
arcpy.Exists("FORESTacumina")
arcpy.Exists("FORESTacumina.shp")


And have you read the help on parameters for the tool you are using?
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z0000002t000000.htm
0 Kudos
charlotteGermain-Aubrey
New Contributor
still not working... the arcpy.Exists says "true" for the first 2 items but "false" for the last one.But the last one doesn't exists since it is the outfile of the function (which doesn't work...)

code:

>>> arcpy.Exists("10000Points_lyr.shp")
True
>>> arcpy.Exists("FORESTacumina")
True
>>> arcpy.Exists("FORESTacumina.shp")
False
>>> import arcpy
... from arcpy import env
... from arcpy.sa import *
... env.workspace = "C:/Users/cgermain/Desktop/2050Maps"
... ExtractValuesToPoints("10000Points_lyr.shp", "FORESTacumina","FORESTacumina.shp","NONE","VALUE_ONLY")
...
Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 999999: Error executing function. Failed to execute (ExtractValuesToPoints).
0 Kudos
MathewCoyle
Frequent Contributor
If you go into your geoprocessing dropdown menu and click "Results" find the error for the tool you are running and open the Messages tab to see if there is anymore useful information. You can also copy out the python snippet of the tool and paste it somewhere to see what is being passed into the tool.
0 Kudos