map algebra expression / raster calculator arcmap10

3442
2
Jump to solution
05-23-2012 03:56 AM
MaximilianSesselmann
New Contributor
hey folks,
i???ve got a problem concerning the raster-calculator-tool in arcmap 10. I hope someone can help me. excuse my poor english skills???
the situation:
- i model drainage-systems based on high-resolution lidar-dgm (1m).
- i want to thin-out the flow-accumulation-tool results
- therefore I want to eliminate all streams that have less then 50 cells and have no upstream connection (last are called 1st-order streams)
- i created a stream-link-raster (it tells the lenght of segment in the attribute-table-field COUNT) and a stream-order-raster (it gives each segment an order-number beginning with 1) [both tools are available in spatial analyst ??? hydrology-toolset]
- now i need a single-output-map-algebra-expression that says:

???if the stream order is 1 and the stream segment has 50 cells or less, then turn the cell into NoData. Otherwise, return the stream link ID.???


i tried to solve this problem using the raster calculator.
first things first: i???m absolutely not a pro in skripting/programming! Not even at this simple level???
i'm sure its only a little mistake, but i can???t find it by myself.
my code looks like this:

SetNull("str_ord_klein"  == 1  &  "StreamLink".COUNT <= 50, "StreamLink")

"str_ord_klein"  is the stream-order-raster
"StreamLink" is the stream-link-raster

the process starts but it is cancelled immediately saying this:

Executing: RasterCalculator SetNull("str_ord_klein"  == 1  &  "StreamLink".COUNT   <  50, "StreamLink") "D:\Daten\Studium\DIPLOMARBEIT\GIS\Hydrologie Modellierung\Rasterdaten\STREAM EDITED\stream_thinned"
Start Time: Wed May 23 13:35:00 2012
SetNull(Raster(r"str_ord_klein")  == 1  &  Raster(r"StreamLink").COUNT   <  50, Raster(r"StreamLink"))
ERROR 000539: Error running expression: rcexec() <type 'exceptions.AttributeError'>: 'Raster' object has no attribute 'COUNT'
Failed to execute (RasterCalculator).
Failed at Wed May 23 13:35:00 2012 (Elapsed Time: 0,00 seconds)


i would be very happy and grateful if someone could help me.
kind regards,
max
0 Kudos
1 Solution

Accepted Solutions
TimothyHales
Esri Notable Contributor
You cannot use dot notation in ArcGIS 10.  You will need to use the Lookup function.  Something like this:

SetNull(("StreamOrder"==1)  & ( Lookup("StreamLink","count") <= 50), "StreamLink")      

Using raster attribute other than 'value' in map algebra

Lookup function in v10.0 Map Algebra: implementing dot notation in v10.0?

What is wrong with this syntax when using the ???raster calculator????

View solution in original post

0 Kudos
2 Replies
TimothyHales
Esri Notable Contributor
You cannot use dot notation in ArcGIS 10.  You will need to use the Lookup function.  Something like this:

SetNull(("StreamOrder"==1)  & ( Lookup("StreamLink","count") <= 50), "StreamLink")      

Using raster attribute other than 'value' in map algebra

Lookup function in v10.0 Map Algebra: implementing dot notation in v10.0?

What is wrong with this syntax when using the ???raster calculator????
0 Kudos
MaximilianSesselmann
New Contributor
this one worked out well! thanks
0 Kudos