7

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)
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jul 25, 2013 at 13:55
5
  • 1
    Maybe 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? Commented Jul 25, 2013 at 14:00
  • I've edit my question. Commented Jul 25, 2013 at 14:10
  • 2
    The question is still mystifying because nothing you mention involves rasters at all. More details of your script would be helpful. Commented 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. Commented 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. Commented Jul 25, 2013 at 14:44

1 Answer 1

19

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.

answered Jul 25, 2013 at 16:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.