rdf4j-postgis  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
60 {}

Member Function Documentation

◆ getDataBufferType()

static int getDataBufferType ( int  pixelType)
static
84  {
85  switch (pixelType) {
86  case PT_1BB:
87  case PT_2BUI:
88  case PT_4BUI:
89  case PT_8BUI:
90  case PT_8BSI:
91  return DataBuffer.TYPE_BYTE;
92  case PT_16BSI:
93  return DataBuffer.TYPE_SHORT;
94  case PT_16BUI:
95  return DataBuffer.TYPE_USHORT;
96  case PT_32BSI:
97  return DataBuffer.TYPE_INT;
98  case PT_32BUI:
99  return DataBuffer.TYPE_INT;
100  case PT_32BF:
101  return DataBuffer.TYPE_FLOAT;
102  case PT_64BF:
103  return DataBuffer.TYPE_DOUBLE;
104  default:
105  throw new IllegalArgumentException("unknowned pixel type : " + pixelType);
106  }
107  }
static final int PT_16BSI
16-bit signed integer
Definition: WKBRasterConstants.java:40
static final int PT_32BUI
32-bit unsigned integer
Definition: WKBRasterConstants.java:46
static final int PT_2BUI
2-bit unsigned integer
Definition: WKBRasterConstants.java:32
static final int PT_1BB
1-bit boolean
Definition: WKBRasterConstants.java:30
static final int PT_64BF
64-bit float
Definition: WKBRasterConstants.java:50
static final int PT_32BSI
32-bit signed integer
Definition: WKBRasterConstants.java:44
static final int PT_4BUI
4-bit unsigned integer
Definition: WKBRasterConstants.java:34
static final int PT_16BUI
16-bit unsigned integer
Definition: WKBRasterConstants.java:42
static final int PT_8BUI
8-bit unsigned integer
Definition: WKBRasterConstants.java:38
static final int PT_32BF
32-bit float
Definition: WKBRasterConstants.java:48
static final int PT_8BSI
8-bit signed integer
Definition: WKBRasterConstants.java:36

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 WKBRasterBand.getDataBufferType().

◆ getDimensionType()

static SampleDimensionType getDimensionType ( int  type)
static

Mapping to SampleDimentionType.

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

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

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 WKBRasterBand.getNbBytePerPixel(), and WKBRasterWriter.write().

◆ getPixelType() [1/2]

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

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

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