org.geotools.factory
Class Hints

java.lang.Object
  extended byjava.awt.RenderingHints
      extended byorg.geotools.factory.Hints
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map

public final class Hints
extends java.awt.RenderingHints

A set of hints providing control on factories to be used.

Those hints are typically used by renderers or grid coverage processors for example. They provides a way to control low-level details. Example:

 CoordinateOperationFactory myFactory = …
 RenderingHints hints = new RenderingHints(Hints.COORDINATE_OPERATION_FACTORY, myFactory);
 AbstractProcessor processor = new DefaultProcessor(hints);
 

Any hint mentioned by this interface is considered to be API, failure to make use of a hint by a geotools factory implementation is considered a bug (as it will prevent the use of this library for application specific tasks).

When hints are used in conjuction with the Factory service discovery mechanism we have the complete geotools plugin system. By using hints to allow application code to effect service discovery we allow client code to retarget the geotools library for their needs.

While this works in practice for services which we control (like Feature creation), we also make use of other services.

Since:
2.1
Version:
$Id: Hints.java 17696 2006-01-22 07:33:19Z desruisseaux $
Author:
Martin Desruisseaux

Nested Class Summary
static class Hints.Key
          The type for keys used to control various aspects of the factory creation.
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
static Hints.Key COORDINATE_OPERATION_AUTHORITY_FACTORY
          Hint for the CoordinateOperationAuthorityFactory instance to use.
static Hints.Key COORDINATE_OPERATION_FACTORY
          Hint for the CoordinateOperationFactory instance to use.
static Hints.Key CRS_AUTHORITY_FACTORY
          Hint for the CRSAuthorityFactory instance to use.
static Hints.Key CRS_FACTORY
          Hint for the CRSFactory instance to use.
static Hints.Key CS_AUTHORITY_FACTORY
          Hint for the CSAuthorityFactory instance to use.
static Hints.Key CS_FACTORY
          Hint for the CSFactory instance to use.
static Hints.Key DATUM_AUTHORITY_FACTORY
          Hint for the DatumAuthorityFactory instance to use.
static Hints.Key DATUM_FACTORY
          Hint for the DatumFactory instance to use.
static Hints.Key DATUM_SHIFT_METHOD
          Hint for the preferred datum shift method to use for coordinate operation.
static Hints.Key DEFAULT_COORDINATE_REFERENCE_SYSTEM
          Hint for the default CoordinateReferenceSystem to use.
static Hints.Key GRID_COVERAGE_PROCESSOR
          Deprecated. The interface is not yet stable. Avoid dependencies if possible.
static Hints.Key JAI_INSTANCE
          Hint for the JAI instance to use.
static Hints.Key JTS_COORDINATE_SEQUENCE_FACTORY
          Hint for the CoordinateSequenceFactory instance to use.
static Hints.Key JTS_GEOMETRY_FACTORY
          Hint for the GeometryFactory instance to use.
static Hints.Key JTS_PRECISION_MODEL
          Hint for the PrecisionModel instance to use.
static Hints.Key JTS_SRID
          The spatial reference ID for GeometryFactory.
static Hints.Key LENIENT_DATUM_SHIFT
          Tells if coordinate operations should be allowed even when a datum shift is required while no method is found applicable.
static Hints.Key MATH_TRANSFORM_FACTORY
          Hint for the MathTransformFactory instance to use.
static Hints.Key SAMPLE_DIMENSION_TYPE
          Hint for the SampleDimensionType to use.
 
Fields inherited from class java.awt.RenderingHints
KEY_ALPHA_INTERPOLATION, KEY_ANTIALIASING, KEY_COLOR_RENDERING, KEY_DITHERING, KEY_FRACTIONALMETRICS, KEY_INTERPOLATION, KEY_RENDERING, KEY_STROKE_CONTROL, KEY_TEXT_ANTIALIASING, VALUE_ALPHA_INTERPOLATION_DEFAULT, VALUE_ALPHA_INTERPOLATION_QUALITY, VALUE_ALPHA_INTERPOLATION_SPEED, VALUE_ANTIALIAS_DEFAULT, VALUE_ANTIALIAS_OFF, VALUE_ANTIALIAS_ON, VALUE_COLOR_RENDER_DEFAULT, VALUE_COLOR_RENDER_QUALITY, VALUE_COLOR_RENDER_SPEED, VALUE_DITHER_DEFAULT, VALUE_DITHER_DISABLE, VALUE_DITHER_ENABLE, VALUE_FRACTIONALMETRICS_DEFAULT, VALUE_FRACTIONALMETRICS_OFF, VALUE_FRACTIONALMETRICS_ON, VALUE_INTERPOLATION_BICUBIC, VALUE_INTERPOLATION_BILINEAR, VALUE_INTERPOLATION_NEAREST_NEIGHBOR, VALUE_RENDER_DEFAULT, VALUE_RENDER_QUALITY, VALUE_RENDER_SPEED, VALUE_STROKE_DEFAULT, VALUE_STROKE_NORMALIZE, VALUE_STROKE_PURE, VALUE_TEXT_ANTIALIAS_DEFAULT, VALUE_TEXT_ANTIALIAS_OFF, VALUE_TEXT_ANTIALIAS_ON
 
Constructor Summary
Hints(java.util.Map hints)
          Constructs a new object with keys and values initialized from the specified map (which may be null).
Hints(java.awt.RenderingHints.Key key, java.lang.Object value)
          Constructs a new object with the specified key/value pair.
 
Methods inherited from class java.awt.RenderingHints
add, clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

JTS_GEOMETRY_FACTORY

public static final Hints.Key JTS_GEOMETRY_FACTORY
Hint for the GeometryFactory instance to use.

See Also:
FactoryFinder.getGeometryFactory(org.geotools.factory.Hints)

JTS_COORDINATE_SEQUENCE_FACTORY

public static final Hints.Key JTS_COORDINATE_SEQUENCE_FACTORY
Hint for the CoordinateSequenceFactory instance to use.

See Also:
FactoryFinder.getCoordinateSequenceFactory(org.geotools.factory.Hints)

JTS_PRECISION_MODEL

public static final Hints.Key JTS_PRECISION_MODEL
Hint for the PrecisionModel instance to use.

See Also:
FactoryFinder.getPrecisionModel(org.geotools.factory.Hints)

JTS_SRID

public static final Hints.Key JTS_SRID
The spatial reference ID for GeometryFactory.

See Also:
FactoryFinder.getGeometryFactory(org.geotools.factory.Hints)

CRS_AUTHORITY_FACTORY

public static final Hints.Key CRS_AUTHORITY_FACTORY
Hint for the CRSAuthorityFactory instance to use.

See Also:
FactoryFinder.getCRSAuthorityFactory(java.lang.String, org.geotools.factory.Hints)

CS_AUTHORITY_FACTORY

public static final Hints.Key CS_AUTHORITY_FACTORY
Hint for the CSAuthorityFactory instance to use.

See Also:
FactoryFinder.getCSAuthorityFactory(java.lang.String, org.geotools.factory.Hints)

DATUM_AUTHORITY_FACTORY

public static final Hints.Key DATUM_AUTHORITY_FACTORY
Hint for the DatumAuthorityFactory instance to use.

See Also:
FactoryFinder.getDatumAuthorityFactory(java.lang.String, org.geotools.factory.Hints)

CRS_FACTORY

public static final Hints.Key CRS_FACTORY
Hint for the CRSFactory instance to use.

See Also:
FactoryFinder.getCRSFactory(org.geotools.factory.Hints)

CS_FACTORY

public static final Hints.Key CS_FACTORY
Hint for the CSFactory instance to use.

See Also:
FactoryFinder.getCSFactory(org.geotools.factory.Hints)

DATUM_FACTORY

public static final Hints.Key DATUM_FACTORY
Hint for the DatumFactory instance to use.

See Also:
FactoryFinder.getDatumFactory(org.geotools.factory.Hints)

COORDINATE_OPERATION_FACTORY

public static final Hints.Key COORDINATE_OPERATION_FACTORY
Hint for the CoordinateOperationFactory instance to use.

See Also:
FactoryFinder.getCoordinateOperationFactory(org.geotools.factory.Hints)

COORDINATE_OPERATION_AUTHORITY_FACTORY

public static final Hints.Key COORDINATE_OPERATION_AUTHORITY_FACTORY
Hint for the CoordinateOperationAuthorityFactory instance to use.

See Also:
FactoryFinder.getCoordinateOperationAuthorityFactory(java.lang.String, org.geotools.factory.Hints)

MATH_TRANSFORM_FACTORY

public static final Hints.Key MATH_TRANSFORM_FACTORY
Hint for the MathTransformFactory instance to use.

See Also:
FactoryFinder.getMathTransformFactory(org.geotools.factory.Hints)

GRID_COVERAGE_PROCESSOR

public static final Hints.Key GRID_COVERAGE_PROCESSOR
Deprecated. The interface is not yet stable. Avoid dependencies if possible.

Hint for the GridCoverageProcessor instance to use.


JAI_INSTANCE

public static final Hints.Key JAI_INSTANCE
Hint for the JAI instance to use.


SAMPLE_DIMENSION_TYPE

public static final Hints.Key SAMPLE_DIMENSION_TYPE
Hint for the SampleDimensionType to use.


DEFAULT_COORDINATE_REFERENCE_SYSTEM

public static final Hints.Key DEFAULT_COORDINATE_REFERENCE_SYSTEM
Hint for the default CoordinateReferenceSystem to use. This is used by some factories capable to provide a default CRS when no one were explicitly specified by the user.

Since:
2.2

DATUM_SHIFT_METHOD

public static final Hints.Key DATUM_SHIFT_METHOD
Hint for the preferred datum shift method to use for coordinate operation. Valid values are , or . Other values may be supplied if a math transform exists for that name, but this is not guaranteed to work.

See Also:
FactoryFinder.getCoordinateOperationFactory(org.geotools.factory.Hints)

LENIENT_DATUM_SHIFT

public static final Hints.Key LENIENT_DATUM_SHIFT
Tells if coordinate operations should be allowed even when a datum shift is required while no method is found applicable. It may be for example that no Bursa Wolf parameters were found for a datum shift. The default value is FALSE, which means that coordinate operation factory throws an exception if such a case occurs. If this hint is set to , then the user is strongly encouraged to check the positional accuracy for every transformation created. If the set of positional 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.

See Also:
FactoryFinder.getCoordinateOperationFactory(org.geotools.factory.Hints)
Constructor Detail

Hints

public Hints(java.util.Map hints)
Constructs a new object with keys and values initialized from the specified map (which may be null).

Parameters:
hints - A map of key/value pairs to initialize the hints, or if the object should be empty.

Hints

public Hints(java.awt.RenderingHints.Key key,
             java.lang.Object value)
Constructs a new object with the specified key/value pair.

Parameters:
key - The key of the particular hint property.
value - The value of the hint property specified with .


Copyright © GeoTools. All Rights Reserved.