|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectRenderingHints
Hints
public class Hints
A set of hints providing control on factories to be used. They provides a way to control low-level details. When hints are used in conjunction with factory registry (the Geotk service discovery mechanism), we have the complete Geotk plugin system. By using hints to allow application code to effect service discovery, we allow client code to retarget the Geotk library for their needs.
The following example fetch a coordinate operation factory which is tolerant to the lack of Bursa-Wolf parameters:
Hints may be ignored if they do not apply to the object to be instantiated.Hints hints = new Hints(Hints.LENIENT_DATUM_SHIFT, Boolean.TRUE); CoordinateOperationFactory factory = FactoryFinder.getCoordinateOperationFactory(hints);
Factory,
FactoryRegistry
| utility/geotk-utility (download) | View source code for this class |
| Nested Class Summary | |
|---|---|
static class |
Hints.ClassKey
A key for value that may be specified either as instance of T, or as
Class<T>. |
static class |
Hints.FileKey
Key for hints to be specified as a File. |
static class |
Hints.IntegerKey
A hint used to capture a configuration setting as an integer. |
static class |
Hints.Key
The type for keys used to control various aspects of the factory creation. |
static class |
Hints.OptionKey
Key that allows the choice of several options. |
| Nested classes/interfaces inherited from interface Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
Hints()
Constructs a map of hints initialized with the system-wide default values. |
|
Hints(Map<? extends RenderingHints.Key,?> hints)
Constructs a new object with keys and values from the given map (which may be null). |
|
Hints(RenderingHints.Key key,
Object value)
Constructs a new map of hints with the specified key/value pair. |
|
Hints(RenderingHints.Key key1,
Object value1,
RenderingHints.Key key2,
Object value2)
Constructs a new map of hints with two key/value pairs. |
|
Hints(RenderingHints.Key key1,
Object value1,
RenderingHints.Key key2,
Object value2,
Object... pairs)
Constructs a new map of hints from key/value pairs. |
|
Hints(RenderingHints hints)
Constructs a new object with keys and values from the given map (which may be null). |
|
| Method Summary | |
|---|---|
Hints |
clone()
Returns a new map of hints with the same content than this map. |
static Object |
getSystemDefault(RenderingHints.Key key)
Returns the system-wide default value for the given key. |
static Object |
putSystemDefault(RenderingHints.Key key,
Object value)
Adds or modifies a system-wide default value. |
static Object |
removeSystemDefault(RenderingHints.Key key)
Removes the specified hints from the set of system default values. |
String |
toString()
Returns a string representation of the hints. |
| Methods inherited from class RenderingHints |
|---|
add, clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Hints.ClassKey NAME_FACTORY
NameFactory instance to use.
FactoryFinder.getNameFactory(Hints)public static final Hints.ClassKey CITATION_FACTORY
CitationFactory instance to use.
FactoryFinder.getCitationFactory(Hints)public static final Hints.ClassKey CRS_AUTHORITY_FACTORY
CRSAuthorityFactory instance to use.
AuthorityFactoryFinder.getCRSAuthorityFactory(String, Hints)public static final Hints.ClassKey CS_AUTHORITY_FACTORY
CSAuthorityFactory instance to use.
AuthorityFactoryFinder.getCSAuthorityFactory(String, Hints)public static final Hints.ClassKey DATUM_AUTHORITY_FACTORY
DatumAuthorityFactory instance to use.
AuthorityFactoryFinder.getDatumAuthorityFactory(String, Hints)public static final Hints.ClassKey CRS_FACTORY
CRSFactory instance to use.
FactoryFinder.getCRSFactory(Hints)public static final Hints.ClassKey CS_FACTORY
CSFactory instance to use.
FactoryFinder.getCSFactory(Hints)public static final Hints.ClassKey DATUM_FACTORY
DatumFactory instance to use.
FactoryFinder.getDatumFactory(Hints)public static final Hints.ClassKey COORDINATE_OPERATION_FACTORY
CoordinateOperationFactory instance to use.
FactoryFinder.getCoordinateOperationFactory(Hints)public static final Hints.ClassKey COORDINATE_OPERATION_AUTHORITY_FACTORY
CoordinateOperationAuthorityFactory instance
to use.
AuthorityFactoryFinder.getCoordinateOperationAuthorityFactory(String, Hints)public static final Hints.ClassKey MATH_TRANSFORM_FACTORY
MathTransformFactory instance to use.
FactoryFinder.getMathTransformFactory(Hints)public static final Hints.Key DEFAULT_COORDINATE_REFERENCE_SYSTEM
CoordinateReferenceSystem
to use. This is used by some factories capable to provide a default CRS
when no one were explicitly specified by the user.
public static final Hints.FileKey CRS_AUTHORITY_EXTRA_DIRECTORY
File or String refering to
an existing directory.
Filenames in the supplied directory should be of the form
authority.properties where authority
is the authority name space to use. For example the
"epsg.properties"
file contains extra CRS to add as new EPSG codes.
public static final Hints.Key EPSG_DATA_SOURCE
DataSource - used as is.Name - used with JNDI to locate data source. This hint has no
effect if there is no JNDI initial context
setup.String - used with JNDI to locate data source. This hint has no effect if
there is no JNDI initial context setup.
public static final Hints.OptionKey DATUM_SHIFT_METHOD
"Molodensky", "Abridged Molodensky" and "Geocentric".
Other values may be supplied if a math transform exists for that
name, but this is not guaranteed to work.
FactoryFinder.getCoordinateOperationFactory(Hints)public static final Hints.Key LENIENT_DATUM_SHIFT
FALSE, which means
that coordinate operation factory throws an exception if such a case occurs.
If this hint is set to TRUE, then the users are encouraged to check the
coordinate operation accuracy
for every transformation created. If the set of operation accuracy contains
DATUM_SHIFT_OMITTED, this means that an "ellipsoid shift" were applied without real datum
shift method available, and the transformed coordinates may have one kilometer error. The
application should warn the user (e.g. popup a message dialog box) in such case.
FactoryFinder.getCoordinateOperationFactory(Hints)public static final Hints.Key FORCE_LONGITUDE_FIRST_AXIS_ORDER
This hint can be passed to the AuthorityFactoryFinder.getCRSAuthorityFactory(...) method. Whatever this hint is
supported or not is authority dependent. In the default Geotk configuration, this hint
is honored for codes in the "EPSG" namespace but ignored for codes in the
"urn:ogc" namespace. See FORCE_AXIS_ORDER_HONORING for changing this
behavior.
Note: The documentation saids "longitude first" for simplicity, because the axes reordering apply mostly to geographic CRS (in contrast, most projected CRS already have (x, y) axis order, in which case this hint has no effect). However, what Geotk actually does is to force a right-handed coordinate system. This approach works for projected CRS as well as geographic CRS ("longitude first" is an inappropriate expression for projected CRS). It even works in cases like stereographic projections, where the axes names look like (South along 180°, South along 90°E). In such cases, aiming for "longitude first" would not make sense.
AuthorityFactoryFinder.getCSAuthorityFactory(String, Hints),
AuthorityFactoryFinder.getCRSAuthorityFactory(String, Hints),
OrderedAxisAuthorityFactory,
LongitudeFirstEpsgFactorypublic static final Hints.Key FORCE_AXIS_ORDER_HONORING
FORCE_LONGITUDE_FIRST_AXIS_ORDER hint to some factories that usually
ignore it. The axis order issue is of concern mostly to the "EPSG" name
space. Codes in the "http://www.opengis.net/gml/srs/"
or "urn:ogc" name space usually ignore the axis order hint, especially the later
which is clearly defined by international standards and does not allow
the FORCE_LONGITUDE_FIRST_AXIS_ORDER behavior in standard-compliant application.
If nevertheless a user really wants the FORCE_LONGITUDE_FIRST_AXIS_ORDER behavior
despite the violation of standards, then he must explicitly assigns a comma separated list
of authorities to this FORCE_AXIS_ORDER_HONORING hint. For example in order to apply
the (longitude, latitude) axis order to "http://www.opengis.net/"
and "urn:ogc" name spaces in addition of EPSG, use the following hints:
Let stress again that the application of (longitude, latitude) axis order to thehints.put(FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); hints.put(FORCE_AXIS_ORDER_HONORING, "epsg, http, urn");
"urn:ogc" name space is a clear violation of OGC specification, which
is why Geotk wants you to provide this additional hint meaning "I'm really sure". Note
also that "epsg" is implicit and doesn't need to be included in the above list,
but this example does so as a matter of principle.
public static final Hints.Key FORCE_STANDARD_AXIS_DIRECTIONS
true,
then South axis directions are forced to
North, West axis
directions are forced to East, etc.
If false, then the axis directions are left unchanged.
This hint shall be passed to the
AuthorityFactoryFinder.getCRSAuthorityFactory(...)
method. Whatever this hint is supported or not is authority dependent.
FactoryFinder.getCSFactory(Hints),
FactoryFinder.getCRSFactory(Hints),
OrderedAxisAuthorityFactorypublic static final Hints.Key FORCE_STANDARD_AXIS_UNITS
true, then all
angular units are forced to degrees and linear units to meters. If false,
then the axis units are left unchanged.
This hint shall be passed to the
AuthorityFactoryFinder.getCRSAuthorityFactory(...) method. Whatever this hint is
supported or not is authority dependent.
FactoryFinder.getCSFactory(Hints),
FactoryFinder.getCRSFactory(Hints),
OrderedAxisAuthorityFactorypublic static final Hints.Key VERSION
Version.
public static final Hints.Key JAI_INSTANCE
JAI instance to use.
public static final Hints.Key TILE_ENCODING
String value) to use during serialization of image data in
a GridCoverage2D object. This encoding
is given to the SerializableRenderedImage
constructor. Valid values include (but is not limited to) "raw",
"gzip" and "jpeg".
Note:
We recommend to avoid the "jpeg" codec for grid coverages.
CoverageFactoryFinder.getGridCoverageFactory(Hints)public static final Hints.ClassKey GRID_COVERAGE_PROCESSOR
GridCoverageProcessor instance to use.
CoverageFactoryFinder.getCoverageProcessor(Hints)public static final Hints.Key COVERAGE_PROCESSING_VIEW
Some operation when called on a grid coverage tries to converts to geophysics view before to execute. The rationale behind this is that the other views are just the rendered version of a coverage data, and operations like interpolations have a physical meaning only when applied on the geophysics view (e.g. interpolate Sea Surface Temperature (SST) values, not the RGB values that colorize the temperature).
However, in some cases like when doing pure rendering of images, we might want to force operations to work on photographic view directly, even performing color expansions as needed. This can be accomplished by setting this hint to the desired view. Be aware that interpolations after color expansions may produce colors that do not accuratly represent the geophysical value.
public static final Hints.Key SAMPLE_DIMENSION_TYPE
SampleDimensionType to use.
public static final Hints.ClassKey TEMPORAL_FACTORY
TemporalFactory instance to use.
FactoryFinder.getTemporalFactory(Hints)public static final Hints.ClassKey POSITION_FACTORY
PositionFactory instance to use.
FactoryFinder.getPositionFactory(Hints)public static final Hints.ClassKey PRIMITIVE_FACTORY
PrimitiveFactory instance to use.
FactoryFinder.getPrimitiveFactory(Hints)public static final Hints.ClassKey GEOMETRY_FACTORY
GeometryFactory instance to use.
FactoryFinder.getGeometryFactory(Hints)public static final Hints.ClassKey COMPLEX_FACTORY
ComplexFactory instance to use.
FactoryFinder.getComplexFactory(Hints)public static final Hints.ClassKey AGGREGATE_FACTORY
AggregateFactory instance to use.
FactoryFinder.getAggregateFactory(Hints)public static final Hints.ClassKey FEATURE_TYPE_FACTORY
FeatureTypeFactory instance to use.
FactoryFinder.getFeatureTypeFactory(Hints)public static final Hints.ClassKey FEATURE_FACTORY
FeatureFactory instance to use.
FactoryFinder.getFeatureFactory(Hints)public static final Hints.ClassKey FILTER_FACTORY
FilterFactory instance to use.
FactoryFinder.getFilterFactory(Hints)public static final Hints.ClassKey STYLE_FACTORY
StyleFactory instance to use.
FactoryFinder.getStyleFactory(Hints)| Constructor Detail |
|---|
public Hints()
putSystemDefault and not
yet removed with removeSystemDefault.
public Hints(RenderingHints.Key key,
Object value)
key - The key of the particular hint property.value - The value of the hint property specified with key.
public Hints(RenderingHints.Key key1,
Object value1,
RenderingHints.Key key2,
Object value2)
key1 - The key for the first pair.value1 - The value for the first pair.key2 - The key2 for the second pair.value2 - The value2 for the second pair.
public Hints(RenderingHints.Key key1,
Object value1,
RenderingHints.Key key2,
Object value2,
Object... pairs)
key1 - The key for the first pair.value1 - The value for the first pair.key2 - The key2 for the second pair.value2 - The value2 for the second pair.pairs - Additional pairs of keys and values.public Hints(Map<? extends RenderingHints.Key,?> hints)
hints - A map of key/value pairs to initialize the hints, or null if none.public Hints(RenderingHints hints)
hints - A map of key/value pairs to initialize the hints, or null if none.| Method Detail |
|---|
public Hints clone()
clone in class RenderingHintspublic static Object getSystemDefault(RenderingHints.Key key)
getSystemDefault(key) returns
null for all keys. Users can add default values using putSystemDefault.
To get a map of all system defaults, use new Hints().
key - The hints key.
null if the key did not have a mapping.
@Configuration
public static Object putSystemDefault(RenderingHints.Key key,
Object value)
Hints instances created after
this method call will be initialized to the union of all values specified with
putSystemDefault and not yet removed.
If the given value is different than the previous one, then this method notifies
every listeners registered with Factories.addChangeListener(ChangeListener).
key - The hint key.value - The hint value to be used as the system-wide default for the given key.
null if none.
IllegalArgumentException - if Hints.Key.isCompatibleValue(Object)
returns false for the given value.@Configuration public static Object removeSystemDefault(RenderingHints.Key key)
Factories.addChangeListener(ChangeListener).
key - The hints key that needs to be removed.
null if the key did not have a mapping.public String toString()
toString in class RenderingHints
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||