semanticwfs  Version 0.1.0.0
WKBRasterConstants Class Reference

WKB raster constants, used in postGIS 2 but can be used elsewhere. More...

Collaboration diagram for WKBRasterConstants:

Static Public Member Functions

static int getNbBytePerPixel (int pixelType)
 
static int getDataBufferType (int pixelType)
 
static int getPixelType (int dataBufferType)
 
static int getPixelType (SampleDimensionType type)
 Mapping from SampleDimensionType to WKBRAsterConstants. More...
 
static SampleDimensionType getDimensionType (int type)
 Mapping to SampleDimentionType. More...
 

Static Public Attributes

static final int PT_1BB = 0
 1-bit boolean
More...
 
static final int PT_2BUI = 1
 2-bit unsigned integer
More...
 
static final int PT_4BUI = 2
 4-bit unsigned integer
More...
 
static final int PT_8BSI = 3
 8-bit signed integer
More...
 
static final int PT_8BUI = 4
 8-bit unsigned integer
More...
 
static final int PT_16BSI = 5
 16-bit signed integer
More...
 
static final int PT_16BUI = 6
 16-bit unsigned integer
More...
 
static final int PT_32BSI = 7
 32-bit signed integer
More...
 
static final int PT_32BUI = 8
 32-bit unsigned integer
More...
 
static final int PT_32BF = 10
 32-bit float
More...
 
static final int PT_64BF = 11
 64-bit float
More...
 
static final int PT_END = 13
 
static final int BANDTYPE_FLAGS_MASK = 0xF0
 
static final int BANDTYPE_PIXTYPE_MASK = 0x0F
 
static final int BANDTYPE_FLAG_OFFDB = 1<<7
 
static final int BANDTYPE_FLAG_HASNODATA = 1<<6
 
static final int BANDTYPE_FLAG_ISNODATA = 1<<5
 
static final int BANDTYPE_FLAG_RESERVED3 =1<<4
 

Private Member Functions

 WKBRasterConstants ()
 

Detailed Description

WKB raster constants, used in postGIS 2 but can be used elsewhere.

Author
Johann Sorel (Geomatys)

Constructor & Destructor Documentation

◆ WKBRasterConstants()

WKBRasterConstants ( )
private
61 {}

Member Function Documentation

◆ getDataBufferType()

static int getDataBufferType ( int  pixelType)
static
85  {
86  switch (pixelType) {
87  case PT_1BB:
88  case PT_2BUI:
89  case PT_4BUI:
90  case PT_8BUI:
91  case PT_8BSI:
92  return DataBuffer.TYPE_BYTE;
93  case PT_16BSI:
94  return DataBuffer.TYPE_SHORT;
95  case PT_16BUI:
96  return DataBuffer.TYPE_USHORT;
97  case PT_32BSI:
98  return DataBuffer.TYPE_INT;
99  case PT_32BUI:
100  return DataBuffer.TYPE_INT;
101  case PT_32BF:
102  return DataBuffer.TYPE_FLOAT;
103  case PT_64BF:
104  return DataBuffer.TYPE_DOUBLE;
105  default:
106  throw new IllegalArgumentException("unknowned pixel type : " + pixelType);
107  }
108  }
static final int PT_16BSI
16-bit signed integer
Definition: WKBRasterConstants.java:41
static final int PT_32BUI
32-bit unsigned integer
Definition: WKBRasterConstants.java:47
static final int PT_2BUI
2-bit unsigned integer
Definition: WKBRasterConstants.java:33
static final int PT_1BB
1-bit boolean
Definition: WKBRasterConstants.java:31
static final int PT_64BF
64-bit float
Definition: WKBRasterConstants.java:51
static final int PT_32BSI
32-bit signed integer
Definition: WKBRasterConstants.java:45
static final int PT_4BUI
4-bit unsigned integer
Definition: WKBRasterConstants.java:35
static final int PT_16BUI
16-bit unsigned integer
Definition: WKBRasterConstants.java:43
static final int PT_8BUI
8-bit unsigned integer
Definition: WKBRasterConstants.java:39
static final int PT_32BF
32-bit float
Definition: WKBRasterConstants.java:49
static final int PT_8BSI
8-bit signed integer
Definition: WKBRasterConstants.java:37

References WKBRasterConstants.PT_16BSI, WKBRasterConstants.PT_16BUI, WKBRasterConstants.PT_1BB, WKBRasterConstants.PT_2BUI, WKBRasterConstants.PT_32BF, WKBRasterConstants.PT_32BSI, WKBRasterConstants.PT_32BUI, WKBRasterConstants.PT_4BUI, WKBRasterConstants.PT_64BF, WKBRasterConstants.PT_8BSI, and WKBRasterConstants.PT_8BUI.

◆ getDimensionType()

static SampleDimensionType getDimensionType ( int  type)
static

Mapping to SampleDimentionType.

Parameters
typeWKBRAsterConstants type
Returns
SampleDimensionType
167  {
168 
169  switch(type) {
170  case PT_1BB :
171  return SampleDimensionType.UNSIGNED_1BIT;
172  case PT_2BUI :
173  return SampleDimensionType.UNSIGNED_2BITS;
174  case PT_4BUI :
175  return SampleDimensionType.UNSIGNED_4BITS;
176  case PT_8BUI :
177  return SampleDimensionType.UNSIGNED_8BITS;
178  case PT_16BUI :
179  return SampleDimensionType.UNSIGNED_16BITS;
180  case PT_32BUI :
181  return SampleDimensionType.UNSIGNED_32BITS;
182  case PT_8BSI :
183  return SampleDimensionType.SIGNED_8BITS;
184  case PT_16BSI :
185  return SampleDimensionType.SIGNED_16BITS;
186  case PT_32BSI :
187  return SampleDimensionType.SIGNED_32BITS;
188  case PT_32BF :
189  return SampleDimensionType.REAL_32BITS;
190  case PT_64BF :
191  return SampleDimensionType.REAL_64BITS;
192  default :
193  return SampleDimensionType.REAL_32BITS;
194  }
195  }

References WKBRasterConstants.PT_16BSI, WKBRasterConstants.PT_16BUI, WKBRasterConstants.PT_1BB, WKBRasterConstants.PT_2BUI, WKBRasterConstants.PT_32BF, WKBRasterConstants.PT_32BSI, WKBRasterConstants.PT_32BUI, WKBRasterConstants.PT_4BUI, WKBRasterConstants.PT_64BF, WKBRasterConstants.PT_8BSI, WKBRasterConstants.PT_8BUI, SampleDimensionType.REAL_32BITS, SampleDimensionType.REAL_64BITS, SampleDimensionType.SIGNED_16BITS, SampleDimensionType.SIGNED_32BITS, SampleDimensionType.SIGNED_8BITS, SampleDimensionType.UNSIGNED_16BITS, SampleDimensionType.UNSIGNED_1BIT, SampleDimensionType.UNSIGNED_2BITS, SampleDimensionType.UNSIGNED_32BITS, SampleDimensionType.UNSIGNED_4BITS, and SampleDimensionType.UNSIGNED_8BITS.

◆ getNbBytePerPixel()

static int getNbBytePerPixel ( int  pixelType)
static
63  {
64  switch (pixelType) {
65  case PT_1BB:
66  case PT_2BUI:
67  case PT_4BUI:
68  case PT_8BUI:
69  case PT_8BSI:
70  return 1;
71  case PT_16BSI:
72  case PT_16BUI:
73  return 2;
74  case PT_32BSI:
75  case PT_32BUI:
76  case PT_32BF:
77  return 4;
78  case PT_64BF:
79  return 8;
80  default:
81  throw new IllegalArgumentException("unknowned pixel type : " + pixelType);
82  }
83  }

References WKBRasterConstants.PT_16BSI, WKBRasterConstants.PT_16BUI, WKBRasterConstants.PT_1BB, WKBRasterConstants.PT_2BUI, WKBRasterConstants.PT_32BF, WKBRasterConstants.PT_32BSI, WKBRasterConstants.PT_32BUI, WKBRasterConstants.PT_4BUI, WKBRasterConstants.PT_64BF, WKBRasterConstants.PT_8BSI, and WKBRasterConstants.PT_8BUI.

Referenced by WKBRasterWriter.write().

◆ getPixelType() [1/2]

static int getPixelType ( int  dataBufferType)
static
110  {
111  switch (dataBufferType) {
112  case DataBuffer.TYPE_BYTE:
113  return PT_8BUI;
114  case DataBuffer.TYPE_SHORT:
115  return PT_16BSI;
116  case DataBuffer.TYPE_USHORT:
117  return PT_16BUI;
118  case DataBuffer.TYPE_INT:
119  return PT_32BSI;
120  case DataBuffer.TYPE_FLOAT:
121  return PT_32BF;
122  case DataBuffer.TYPE_DOUBLE:
123  return PT_64BF;
124  default:
125  throw new IllegalArgumentException("unknowned data buffer type : " + dataBufferType);
126  }
127  }

References WKBRasterConstants.PT_16BSI, WKBRasterConstants.PT_16BUI, WKBRasterConstants.PT_32BF, WKBRasterConstants.PT_32BSI, WKBRasterConstants.PT_64BF, and WKBRasterConstants.PT_8BUI.

Referenced by WKBRasterWriter.write().

◆ getPixelType() [2/2]

static int getPixelType ( SampleDimensionType  type)
static

Mapping from SampleDimensionType to WKBRAsterConstants.

Parameters
typeSampleDimensionType
Returns
WKBRAsterConstants type
134  {
135  if (SampleDimensionType.UNSIGNED_1BIT.equals(type)) {
136  return PT_1BB;
137  } else if (SampleDimensionType.UNSIGNED_2BITS.equals(type)) {
138  return PT_2BUI;
139  } else if (SampleDimensionType.UNSIGNED_4BITS.equals(type)) {
140  return PT_4BUI;
141  } else if (SampleDimensionType.UNSIGNED_8BITS.equals(type)) {
142  return PT_8BUI;
143  } else if (SampleDimensionType.UNSIGNED_16BITS.equals(type)) {
144  return PT_16BUI;
145  } else if (SampleDimensionType.UNSIGNED_32BITS.equals(type)) {
146  return PT_32BUI;
147  } else if (SampleDimensionType.SIGNED_8BITS.equals(type)) {
148  return PT_8BSI;
149  } else if (SampleDimensionType.SIGNED_16BITS.equals(type)) {
150  return PT_16BSI;
151  } else if (SampleDimensionType.SIGNED_32BITS.equals(type)) {
152  return PT_32BSI;
153  } else if (SampleDimensionType.REAL_32BITS.equals(type)) {
154  return PT_32BF;
155  } else if (SampleDimensionType.REAL_64BITS.equals(type)) {
156  return PT_64BF;
157  } else {
158  return PT_32BF;
159  }
160  }

References WKBRasterConstants.PT_16BSI, WKBRasterConstants.PT_16BUI, WKBRasterConstants.PT_1BB, WKBRasterConstants.PT_2BUI, WKBRasterConstants.PT_32BF, WKBRasterConstants.PT_32BSI, WKBRasterConstants.PT_32BUI, WKBRasterConstants.PT_4BUI, WKBRasterConstants.PT_64BF, WKBRasterConstants.PT_8BSI, WKBRasterConstants.PT_8BUI, SampleDimensionType.REAL_32BITS, SampleDimensionType.REAL_64BITS, SampleDimensionType.SIGNED_16BITS, SampleDimensionType.SIGNED_32BITS, SampleDimensionType.SIGNED_8BITS, SampleDimensionType.UNSIGNED_16BITS, SampleDimensionType.UNSIGNED_1BIT, SampleDimensionType.UNSIGNED_2BITS, SampleDimensionType.UNSIGNED_32BITS, SampleDimensionType.UNSIGNED_4BITS, and SampleDimensionType.UNSIGNED_8BITS.

Member Data Documentation

◆ BANDTYPE_FLAG_HASNODATA

final int BANDTYPE_FLAG_HASNODATA = 1<<6
static

◆ BANDTYPE_FLAG_ISNODATA

final int BANDTYPE_FLAG_ISNODATA = 1<<5
static

◆ BANDTYPE_FLAG_OFFDB

final int BANDTYPE_FLAG_OFFDB = 1<<7
static

◆ BANDTYPE_FLAG_RESERVED3

final int BANDTYPE_FLAG_RESERVED3 =1<<4
static

◆ BANDTYPE_FLAGS_MASK

final int BANDTYPE_FLAGS_MASK = 0xF0
static

◆ BANDTYPE_PIXTYPE_MASK

final int BANDTYPE_PIXTYPE_MASK = 0x0F
static

◆ PT_16BSI

◆ PT_16BUI

◆ PT_1BB

◆ PT_2BUI

◆ PT_32BF

◆ PT_32BSI

◆ PT_32BUI

◆ PT_4BUI

◆ PT_64BF

◆ PT_8BSI

◆ PT_8BUI

◆ PT_END

final int PT_END = 13
static