Hi everyone,
I am working on a tree crown delimitation project with lidar data. Everything is going well but at some point, it just seems I can't use the query builder in the con tool. I've used it in steps before this point so I don't know where the trouble might be....
Here are the steps thus far:
- tree peaks become ponds
- branches/crowns become watersheds
- focal flow to extract tree tops (Con tool, VALUE = “255”, if true, return Inverted raster
Any help would be appreciated!
Thanks!
Solved! Go to Solution.
did by chance you type "Value"<-7 ? (it is really hard to read from the screen grabs)
if so, you need spaces between the fields, the operators and the values, ie
"Value" < -7 with a space between "Value" and < and -7
Also, did you click on the error messages to see what they said, to save us some time
Show the exact Con syntax
Here's a screenshot of the query builder in wich I don't have the info of the input conditional raster. Usually we get the the attributes of the raster in this window.
And then, if I enter the query as supposed:
I get this message:
Thanks again!
did by chance you type "Value"<-7 ? (it is really hard to read from the screen grabs)
if so, you need spaces between the fields, the operators and the values, ie
"Value" < -7 with a space between "Value" and < and -7
Also, did you click on the error messages to see what they said, to save us some time
Hi Dan,
I juste tried it by putting spaces where you told me and it worked!
I stil don't get it why I can't build the query in the query builder by clicking on the value??
Thanks for debugging me!
Just to add a little comment to the solution Dan Patterson provided. There is a difference between integer and floating rasters. The integer rasters have an attribute table (so it has attribute fields and allows you to construct a condition) while the floating (decimal point) rasters do not. Hence the empty query builder screen.
Way back in the older versions of ArcGIS, one needed to add the spaces around floating rasters and the operators when composing map algebra. I think this is an example of what has not been corrected (yet).
> Way back in the older versions of ArcGIS, one needed to add the spaces around floating rasters and the operators when composing map algebra
Xander, this isn't it - the deal here is we're trying to use a SQL expression. The SQL syntax requires the spaces.
I would avoid the SQL syntax issue altogether by using the Raster Calculator tool, which allows raster layers to be treated as raster objects so you can use a straight arcpy map algebra expression, for example:
Con("confocalflow" < -7, "confocalflow")
This gets converted by the Raster Calculator tool to the arcpy (python) map algebra expression:
Con(Raster("confocalflow") < -7, Raster("confocalflow"))
The spaces in the expressions above are totally optional -- but I like using them because it makes the expression easier to read.
Patrick, another advantage of using this tool is you can sometimes combine tools (especially local operators like Con) into a complex expressions that will run at lot faster than running each tool one at a time.
Also, Patrick, please consider moving this thread to the Spatial Analyst space.