ee.PixelType

  • The ee.PixelType function returns a PixelType object based on specified precision, optional value limits, and dimensionality.

  • The function accepts 'int', 'float', or 'double' for the precision argument.

  • Optional minValue and maxValue arguments can define the range of pixel values.

  • An optional dimensions argument specifies the number of dimensions, defaulting to 0 for a scalar.

Returns a PixelType of the given precision with the given limits per element, and an optional dimensionality.
Usage Returns
ee.PixelType(precision, minValue , maxValue , dimensions ) PixelType
Argument Type Details
precision
Object The pixel precision, one of 'int', 'float', or 'double'.
minValue
Number, default: null The minimum value of pixels of this type. If precision is 'float' or 'double', this can be null, signifying negative infinity.
maxValue
Number, default: null The maximum value of pixels of this type. If precision is 'float' or 'double', this can be null, signifying positive infinity.
dimensions
Integer, default: 0 The number of dimensions in which pixels of this type can vary; 0 is a scalar, 1 is a vector, 2 is a matrix, etc.

Examples

Code Editor (JavaScript)

 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'int' 
 , 
  
 0 
 , 
  
 1 
 )); 
  
 // int ∈ [0, 1] 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'int' 
 , 
  
 - 
 20 
 , 
  
 - 
 10 
 )); 
  
 // int ∈ [-20, -10] 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'float' 
 )); 
  
 // float 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 )); 
  
 // double 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 null 
 )); 
  
 // double 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 null 
 , 
  
 null 
 )); 
  
 // double 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 null 
 , 
  
 null 
 , 
  
 0 
 )); 
  
 // double 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 null 
 , 
  
 null 
 , 
  
 1 
 )); 
  
 // double, 1 dimensions 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 null 
 , 
  
 null 
 , 
  
 2 
 )); 
  
 // double, 2 dimensions 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 null 
 , 
  
 null 
 , 
  
 3 
 )); 
  
 // double, 3 dimensions 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 null 
 , 
  
 null 
 , 
  
 10 
 )); 
  
 // double, 10 dimensions 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 null 
 , 
  
 null 
 , 
  
 1e8 
 )); 
  
 // double, 100000000 dimensions 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 1 
 , 
  
 2 
 , 
  
 0 
 )); 
  
 // double ∈ [1, 2] 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 1 
 , 
  
 3 
 , 
  
 2 
 )); 
  
 // double ∈ [1, 3], 2 dimensions 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 - 
 4 
 , 
  
 - 
 3 
 , 
  
 0 
 )); 
  
 // double ∈ [-4, -3] 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 null 
 , 
  
 2.3 
 , 
  
 0 
 )); 
  
 // double 
 print 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
  
 3.4 
 , 
  
 null 
 , 
  
 0 
 )); 
  
 // double 

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)

 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'int' 
 , 
 0 
 , 
 1 
 )) 
 # int ∈ [0, 1] 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'int' 
 , 
 - 
 20 
 , 
 - 
 10 
 )) 
 # int ∈ [-20, -10] 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'float' 
 )) 
 # float 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 )) 
 # double 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 None 
 )) 
 # double 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 None 
 , 
 None 
 )) 
 # double 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 None 
 , 
 None 
 , 
 0 
 )) 
 # double 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 None 
 , 
 None 
 , 
 1 
 )) 
 # double, 1 dimensions 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 None 
 , 
 None 
 , 
 2 
 )) 
 # double, 2 dimensions 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 None 
 , 
 None 
 , 
 3 
 )) 
 # double, 3 dimensions 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 None 
 , 
 None 
 , 
 10 
 )) 
 # double, 10 dimensions 
 # double, 100000000 dimensions 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 None 
 , 
 None 
 , 
 1e8 
 )) 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 1 
 , 
 2 
 , 
 0 
 )) 
 # double ∈ [1, 2] 
 # double ∈ [1, 3], 2 dimensions 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 1 
 , 
 3 
 , 
 2 
 )) 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 - 
 4 
 , 
 - 
 3 
 , 
 0 
 )) 
 # double ∈ [-4, -3] 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 None 
 , 
 2.3 
 , 
 0 
 )) 
 # double 
 display 
 ( 
 ee 
 . 
 PixelType 
 ( 
 'double' 
 , 
 3.4 
 , 
 None 
 , 
 0 
 )) 
 # double 
Create a Mobile Website
View Site in Mobile | Classic
Share by: