select = arcpy.Select_analysis HELP!!

1734
3
06-26-2013 09:38 AM
ShikoNjuno
Occasional Contributor
select = arcpy.Select_analysis

After this script is correctly carried out, is there supposed to be a new layer created on ArcMap? or does it just show you the results?
I'm having issues with an erase script not being able to read the data that has been defined in the Selection.
Below is the error message I'm getting:


>>> erase = arcpy.Erase_analysis(select, buffer, "in_memory/erase")
Runtime error  Traceback (most recent call last):   File "<string>", line 1, in <module>   File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\analysis.py", line 205, in Erase     raise e ExecuteError: ERROR 000732: Input Features: Dataset in_memory\select does not exist or is not supported
Tags (2)
0 Kudos
3 Replies
JamesCrandall
MVP Frequent Contributor
Maybe write your in_memory feature class somewhere on disk: CopyFeatures_management would work.

http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000035000000

Also, your error message is telling you that your input features, "select" are not found or supported.  Better double check this to validate it exists and or has features.
0 Kudos
ShikoNjuno
Occasional Contributor
Thanks James....
I did go back and check that the Input Feature is valid but I think what's happening is that the Input data is from Arc GIS 9.0 whereas the ArcMap that I'm processing the the script in is ArcGIS 10.1.
Doesn't that seem like a reason for the Error Message: "Input Feature Class in not supported"?
I'm not sure though!
Any thoughts anyone?
0 Kudos
RhettZufelt
MVP Frequent Contributor
Hard to say without seeing the previous code.  not sure if you don't have a dataset named select in your workspace.  or, what dataset have you defined to the variable select?  what about buffer?

Also, I'd look into the help documentation on both erase and select to see how to code them.

I see no examples of actually setting it equal to something.

SelectLayerByAttribute_management (in_layer_or_view, {selection_type}, {where_clause})
http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000071000000

will create the selection on the in_layer_or_view, and this would be the input for your other tool(s)


Erase_analysis (in_features, erase_features, out_feature_class, {cluster_tolerance})
http://resources.arcgis.com/en/help/main/10.1/index.html#/Erase/00080000000m000000/

Erase creates a new out feature class, not sure what erase = would do ....

R_

PS  10.1 has no problem consuming older feature classes, just doesn't work the other way.
0 Kudos