I have a script that calculating vertices angles on Polyline layer and the selecting features in that layer at a specified angle. at the end of the script i'm using select by attribute and getting error 000840 the value is not raster layer, the value is not mosaic layer
SelectLayerByAttribute_management(my_shp_name, 'NEW_SELECTION', myquery)
-
1Maybe you can add some context and additional information? Screenshots are always useful :) Also, I'm not sure what you really are asking about: what do you want to do and what have you tried?Martin– Martin2013年07月25日 14:00:23 +00:00Commented Jul 25, 2013 at 14:00
-
I've edit my question.Dror Har Gil– Dror Har Gil2013年07月25日 14:10:31 +00:00Commented Jul 25, 2013 at 14:10
-
2The question is still mystifying because nothing you mention involves rasters at all. More details of your script would be helpful.whuber– whuber2013年07月25日 14:23:20 +00:00Commented Jul 25, 2013 at 14:23
-
Are you running the select against the .shp file directly, or against a feature layer of the .shp? Select by Attribute won't work when run directly against a feature class or shapefile. You have to run arcpy.MakeFeatureLayer_management first, then select against that.DPierce– DPierce2013年07月25日 14:34:46 +00:00Commented Jul 25, 2013 at 14:34
-
I don't think that the error can come from the line the OP has quoted. As well as more of the script as asked for by @whuber, a more fulsome transcript of the error message would be helpful.MappaGnosis– MappaGnosis2013年07月25日 14:44:20 +00:00Commented Jul 25, 2013 at 14:44
1 Answer 1
This is a common error that I have run across, and I am pretty sure it is related to attempting to run the selection against a raw featureclass/shapefile output, as opposed to the "layer" representation of the featureclass/shapefile.
For example: You cannot select features from a shapefile without using ArcMap, but once you load the shapefile into ArcMap (which makes it a "layer"), you can now select the features from the layer.
Try using the MakeFeatureLayer_management(my_shp_name, my_shp_layer)
function between the previous function's output and the SelectLayerByAttribute_management()
. I think you will find that this resolves your error.
Explore related questions
See similar questions with these tags.