private void net ( WritableRandomIter hacksIter , WritableRandomIter netIter ) { // calculates the max order of basin (max hackstream value) pm . beginTask ( "Extraction of rivers of chosen order..." , nRows ) ; for ( int r = 0 ; r < nRows ; r ++ ) { for ( int c = 0 ; c < nCols ; c ++ ) { double value = hacksIter . getSampleDouble ( c , r , 0 ) ; if ( ! isNovalue ( value ) ) { /* * if the hack value is in the asked range * => keep it as net */ if ( value <= hackOrder ) { netIter . setSample ( c , r , 0 , 2 ) ; } else { hacksIter . setSample ( c , r , 0 , HMConstants . doubleNovalue ) ; } } } pm . worked ( 1 ) ; } pm . done ( ) ; }
Return the map of the network with only the river of the choosen order .