ee.Array.floor

  • Array.floor() computes the largest integer less than or equal to the input on an element-wise basis.

  • The usage is Array.floor() and it returns an Array.

  • The single argument is the input array itself.

On an element-wise basis, computes the largest integer less than or equal to the input.
Usage Returns
Array. floor () Array
Argument Type Details
this: input
Array The input array.

Examples

Code Editor (JavaScript)

 // Positive numbers. 
 print 
 ( 
 'Floor for 2.1' 
 , 
  
 ee 
 . 
 Array 
 ([ 
 2.1 
 ]). 
 floor 
 ()); 
  
 // 2 
 print 
 ( 
 'Floor for 2.5' 
 , 
  
 ee 
 . 
 Array 
 ([ 
 2.5 
 ]). 
 floor 
 ()); 
  
 // 2 
 print 
 ( 
 'Floor for 2.9' 
 , 
  
 ee 
 . 
 Array 
 ([ 
 2.9 
 ]). 
 floor 
 ()); 
  
 // 2 
 // Negative numbers. 
 print 
 ( 
 'Floor for -2.1' 
 , 
  
 ee 
 . 
 Array 
 ([ 
 - 
 2.1 
 ]). 
 floor 
 ()); 
  
 // -3 
 print 
 ( 
 'Floor for -2.5' 
 , 
  
 ee 
 . 
 Array 
 ([ 
 - 
 2.5 
 ]). 
 floor 
 ()); 
  
 // -3 
 print 
 ( 
 'Floor for -2.9' 
 , 
  
 ee 
 . 
 Array 
 ([ 
 - 
 2.9 
 ]). 
 floor 
 ()); 
  
 // -3 
 // Example with more than one number in the input array. 
 print 
 ( 
 'Floor for [2.1, -2.1]' 
 , 
  
 ee 
 . 
 Array 
 ([ 
 2.1 
 , 
  
 - 
 2.1 
 ]). 
 floor 
 ()); 
  
 // [2, -3] 

Python setup

See the Python Environment page for information on the Python API and using geemap for interactive development.

 import 
  
 ee 
 import 
  
 geemap.core 
  
 as 
  
 geemap 

Colab (Python)

 # Positive numbers. 
 display 
 ( 
 'Floor for 2.1:' 
 , 
 ee 
 . 
 Array 
 ([ 
 2.1 
 ]) 
 . 
 floor 
 ()) 
 # 2 
 display 
 ( 
 'Floor for 2.5:' 
 , 
 ee 
 . 
 Array 
 ([ 
 2.5 
 ]) 
 . 
 floor 
 ()) 
 # 2 
 display 
 ( 
 'Floor for 2.9:' 
 , 
 ee 
 . 
 Array 
 ([ 
 2.9 
 ]) 
 . 
 floor 
 ()) 
 # 2 
 # Negative numbers. 
 display 
 ( 
 'Floor for -2.1:' 
 , 
 ee 
 . 
 Array 
 ([ 
 - 
 2.1 
 ]) 
 . 
 floor 
 ()) 
 # -3 
 display 
 ( 
 'Floor for -2.5:' 
 , 
 ee 
 . 
 Array 
 ([ 
 - 
 2.5 
 ]) 
 . 
 floor 
 ()) 
 # -3 
 display 
 ( 
 'Floor for -2.9:' 
 , 
 ee 
 . 
 Array 
 ([ 
 - 
 2.9 
 ]) 
 . 
 floor 
 ()) 
 # -3 
 # Example with more than one number in the input array. 
 display 
 ( 
 'Floor for [2.1, -2.1]:' 
 , 
 ee 
 . 
 Array 
 ([ 
 2.1 
 , 
 - 
 2.1 
 ]) 
 . 
 floor 
 ()) 
 # [2, -3] 
Design a Mobile Site
View Site in Mobile | Classic
Share by: