|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectGDALCreateOptionsHandler
public abstract class GDALCreateOptionsHandler
Abstract class which allows to properly handle the set of "format specific"
create options. Each Image I/O plugin exploiting a GDAL driver which supports
create options, should extend this class and define the proper
GDALCreateOptionsHandler
constructor.
To write the extended GDALCreateOptionsHandler
constructor you
need to instantiate the createOptions
array with the number of
supported create options. Then, you need to set the proper fields of each
GDALCreateOption
using the constructor as shown in the example listed
below.
...
Firstly: set the validityValues for the create option. See
GDALCreateOption
source code for more information about
validityValues
and others fields.
final String nameOfCreateOptionValidityValues[] = new String[N];
nameOfCreateOptionValidityValues[0] = "FIRST VALUE";
nameOfCreateOptionValidityValues[1] = "SECOND VALUE";
...
nameOfCreateOptionValidityValues[N-1] = "LAST VALUE";
Then, create a new GDALCreateOption
setting the
optionName
, the validityCheckType
, the
validityValues
array and the representedType
.
createOptions[i] = new GDALCreateOption( "CREATEOPTIONNAME",
GDALCreateOption.VALIDITYCHECKTYPE_XXXX, nameOfCreateOptionValidityValues, GDALCreateOption.TYPE_XXXX);
PRACTICAL EXAMPLE: Suppose we are setting a Quality Create options which
accepts integer values belonging the range [1,100]
final String qualityValues[] = new String[2];
qualityValues[0] = "1";
qualityValues[1] = "100";
...
createOptions[0]=new GDALCreateOption("Quality",
Available information about create options properties can be found at GDAL Supported formats list.
Look at the proper format page to retrieve names and values.
GDALCreateOption.VALIDITYCHECKTYPE_VALUE_BELONGINGRANGE_EXTREMESINCLUDED,
qualityValues, GDALCreateOption.TYPE_INT);
Constructor Summary | |
---|---|
GDALCreateOptionsHandler()
|
Method Summary | |
---|---|
void |
addCreateOption(GDALCreateOption option)
This method add a create option to this handler. |
void |
addCreateOptions(Collection<GDALCreateOption> options)
This method add a collection of create options to this handler. |
List<String> |
getCreateOptions()
Provides to return a List containing String s
representing all specified create options we need to give to the writer
when it call GDAL's create/createCopy method. |
void |
setCreateOption(String optionName)
Set the create option identified by optionName |
void |
setCreateOption(String optionName,
float optionValue)
Set the value of the create option identified by optionName
to optionValue |
void |
setCreateOption(String optionName,
int optionValue)
Set the value of the create option identified by optionName
to optionValue |
void |
setCreateOption(String optionName,
String optionValue)
Set the value of the create option identified by optionName
to optionValue |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GDALCreateOptionsHandler()
Method Detail |
---|
public List<String> getCreateOptions()
List
containing String
s
representing all specified create options we need to give to the writer
when it call GDAL's create/createCopy method.
public void setCreateOption(String optionName, String optionValue)
optionName
to optionValue
optionName
- name of the create option we want to set.optionValue
- value for the specified create option.public void setCreateOption(String optionName)
optionName
optionName
- name of the create option we want to set.public void addCreateOption(GDALCreateOption option)
option
- to add to this handler.public void addCreateOptions(Collection<GDALCreateOption> options)
Objects that are not of type GDALCreateOption
are not added.
option
- to add to this handler.public void setCreateOption(String optionName, int optionValue)
optionName
to optionValue
optionName
- name of the create option we want to set.optionValue
- value for the specified create option.public void setCreateOption(String optionName, float optionValue)
optionName
to optionValue
optionName
- name of the create option we want to set.optionValue
- value for the specified create option.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |