I'm trying to extract only a certain value from a raster and display that as a new layer - I'm working with an Aspect raster derived from a DEM and want to select only Southwest (Class Value = 6) facing cells for display in a new layer.
I'm using the Extract by Attributes tool under the Spatial Analyst set.
Input raster is my aspect raster, for the SQL builder I was trying the following
"CLASS VALUE" = '6' (class value is a field that comes up when using the Identify tool on the layer).
It won't complete the process and gives me error 999999 [error executing function]
The Table was not Found
A column was specified that does not exist
Cannot acquire a lock
No Spatial reference exists,
Error 010213
Error 010325
Error 010067
Any idea why it won't complete/what steps I need to take to provide whatever information is missing? I have used the SQL builder a lot for vector data but not on raster data without an attribute table.
Solved! Go to Solution.
Ahhhh it isn't reclassed...as I had assumed...which is what you have to do. the quickest is to use reclassification and reclass everything < 202.5 to 0 and > 247 to 0 and between to 1, or you could query using 'Aspect_dem14' > 202.5 and 'Aspect_dem14' <247.5 of course not typing and I am pretty sure it is 'and' if it is there or perhaps & but think that may be bit-wise and. Sorry I can't check...on an Arc-less iThingy
did you type any of that expression?
I would check the query in the Raster calculator first
I you are using the raster calculator, select the field, equality sign and value from what is provided ...typing is not preferred
Sadly, there still exists a misnomer in equality checks that aren't standard. In some places = is used, in others ==. the latter is prefered, since = mean 'assignment' in most languages (of consequence)
If you are coding, check Specifying a query in Python—Help | ArcGIS for Desktop
Thanks for the reply!
I did type the expression out (I'm aware of the pitfalls with typing instead of selecting from the lists... grrr) and I was wondering if that was the problem.
I don't fully understand the raster calculator - i can select the raster of consequence (aspect_dem14) but I do not understand what to choose from the right side column. Within the raster, there's a field called Class Value but I don't see where to select it. I've never used this tool before
screen shot of the raster table? what type of raster? esri integer grid perhaps?
If it is an integer grid as described, then you should just be able to query the raster like
'myraster' == 6
since integer grids will contain a Value field and a Count field
here's a screenshot. it's the 32 bit floating point type.
Ahhhh it isn't reclassed...as I had assumed...which is what you have to do. the quickest is to use reclassification and reclass everything < 202.5 to 0 and > 247 to 0 and between to 1, or you could query using 'Aspect_dem14' > 202.5 and 'Aspect_dem14' <247.5 of course not typing and I am pretty sure it is 'and' if it is there or perhaps & but think that may be bit-wise and. Sorry I can't check...on an Arc-less iThingy
The reclassification I think has solved my problem!! I was doing something similar to what you typed out in the Raster Calculator but I keep getting a syntax error. I think I'll stick with the reclassification!
Thanks a bunch!!
I don't fully understand the raster calculator - i can select the raster of consequence (aspect_dem14) but I do not understand what to choose from the right side column.
This is totally a job for Raster Calculator and the Con tool:
Con("Aspect_dem14" > 202.5 & "Aspect_dem14" < 247.5, 1, 0)
If you want to use SQL syntax you can but for continuous data I don't recommend it. (I find doing the straight Python a lot more flexible and easier to understand.)
Con("Aspect_dem14", 1, 0, "VALUE > 202.5 AND VALUE < 247.5")
Thanks for the reply - I will be giving this a try too!