Class Hints
- Object
-
- RenderingHints
-
- Hints
-
public class Hints extends 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 = &hellip Hints hints = new Hints(Hints.COORDINATE_OPERATION_FACTORY, myFactory); AbstractProcessor processor = new DefaultProcessor(hints);
Any hint mentioned by this class 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 conjunction 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.
- Since:
- 2.1
- Author:
- Martin Desruisseaux, Jody Garnett
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Hints.ClassKey
A key for value that may be specified either as instance ofT
, or asClass<T>
.static class
Hints.ConfigurationMetadataKey
Keys for extra configuration options that are passed from the overhead application into queries.static class
Hints.DoubleKey
A hint used to capture a configuration setting as double.static class
Hints.FileKey
Key for hints to be specified as aFile
.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.
-
Field Summary
Fields Modifier and Type Field Description static Hints.Key
ASSOCIATION_PROPERTY
The name of a property to traverse in a datastore query.static Hints.Key
ASSOCIATION_TRAVERSAL_DEPTH
The maximum number of associations traversed in a datastore query.static Hints.ClassKey
ATTRIBUTE_TYPE_FACTORY
Theorg.geotools.feature.AttributeTypeFactory
instance to use.static Hints.IntegerKey
AUTHORITY_MAX_ACTIVE
The maximum number of active authority factories.static Hints.IntegerKey
AUTHORITY_MAX_IDLE
The number of idle AuthorityFactories.static Hints.IntegerKey
AUTHORITY_MIN_EVICT_IDLETIME
When the evictor is run, if more time (in milliseconds) than the value inAUTHORITY_MIN_EVICT_IDLETIME
has passed, then the worker is destroyed.static Hints.IntegerKey
AUTHORITY_MIN_IDLE
Minimum number of objects required before the evictor will begin removing objects.static Hints.IntegerKey
AUTHORITY_SOFTMIN_EVICT_IDLETIME
When the evictor is run, workers which have been idle for more than this value will be destroyed if and only if the number of idle workers exceeds AUTHORITY_MIN_IDLE.static Hints.IntegerKey
AUTHORITY_TIME_BETWEEN_EVICTION_RUNS
Time in milliseconds to wait between eviction runs.static Hints.IntegerKey
CACHE_LIMIT
The recommended maximum number of referencing objects to hold in a authority factory.static Hints.OptionKey
CACHE_POLICY
Policy to use for caching referencing objects.static Hints.OptionKey
COLOR_DEFINITION
The color definition to use when converting from String to Color.static Hints.DoubleKey
COMPARISON_TOLERANCE
Tolerance used in comparisons between floating point values.static Hints.Key
COORDINATE_DIMENSION
The actual coordinate dimensions of the geometry (to be used in the GeometryDescriptor user map)static Hints.ClassKey
COORDINATE_OPERATION_AUTHORITY_FACTORY
TheCoordinateOperationAuthorityFactory
instance to use.static Hints.ClassKey
COORDINATE_OPERATION_FACTORY
TheCoordinateOperationFactory
instance to use.static Hints.Key
CRS
TheCoordinateReferenceSystem
to use in ISO geometry factories.static Hints.FileKey
CRS_AUTHORITY_EXTRA_DIRECTORY
Used to direct WKT CRS Authority to a directory containing extra definitions.static Hints.ClassKey
CRS_AUTHORITY_FACTORY
TheCRSAuthorityFactory
instance to use.static Hints.ClassKey
CRS_FACTORY
TheCRSFactory
instance to use.static Hints.ClassKey
CS_AUTHORITY_FACTORY
TheCSAuthorityFactory
instance to use.static Hints.ClassKey
CS_FACTORY
TheCSFactory
instance to use.static Hints.Key
DATE_TIME_FORMAT_HANDLING
Controls date time formatting output for GML 2.static Hints.ClassKey
DATUM_AUTHORITY_FACTORY
TheDatumAuthorityFactory
instance to use.static Hints.ClassKey
DATUM_FACTORY
TheDatumFactory
instance to use.static Hints.OptionKey
DATUM_SHIFT_METHOD
The preferred datum shift method to use for coordinate operations.static Hints.Key
DECIMATION_POLICY
Decimation choosing policy.static Hints.Key
DEFAULT_COORDINATE_REFERENCE_SYSTEM
The defaultCoordinateReferenceSystem
to use.static double
DEFAULT_RESAMPLE_TOLERANCE
Default resample tolerance value, if not specified via theRESAMPLE_TOLERANCE
hintstatic Hints.Key
ENCODE_EWKT
A flag to enabled/disable EWKT geometry encoding in ECQLstatic Hints.Key
ENTITY_RESOLVER
TheEntityResolver
instance to use when configuring SAXParsers.static Hints.Key
EPSG_DATA_SOURCE
The data source name to lookup from JNDI when initializing the EPSG factory.static Hints.ClassKey
EXECUTOR_SERVICE
TheExecutorService
to use.static Hints.Key
FEATURE_2D
Request that the features returned by the feature collections should be 2D only.static Hints.ClassKey
FEATURE_COLLECTIONS
Theorg.geotools.feature.FeatureCollections
instance to use.static Hints.Key
FEATURE_DETACHED
Indicates the features returned by the feature collections should be considered detached from the datastore.static Hints.ClassKey
FEATURE_FACTORY
TheFeatureFactory
instance to use.static Hints.ClassKey
FEATURE_TYPE_FACTORY
TheFeatureTypeFactory
instance to use.static Hints.ClassKey
FILTER_FACTORY
TheFilterFactory
instance to use.static Hints.Key
FORCE_AXIS_ORDER_HONORING
Applies theFORCE_LONGITUDE_FIRST_AXIS_ORDER
hint to some factories that usually ignore it.static Hints.Key
FORCE_LONGITUDE_FIRST_AXIS_ORDER
Tells if the coordinate systems created by an authority factory should be forced to (longitude,latitude) axis order.static Hints.Key
FORCE_SRS_STYLE
Forces encoding all CRS with the srs stylestatic Hints.Key
FORCE_STANDARD_AXIS_DIRECTIONS
Tells if the coordinate systems created by an authority factory should be forced to standard axis directions.static Hints.Key
FORCE_STANDARD_AXIS_UNITS
Tells if the coordinate systems created by an authority factory should be forced to standard axis units.static Hints.ClassKey
GEOMETRY_CLIP
Used along with vector tile geometries, includes the clip mask to be used when rendering the geometry (geometries in vector tiles can span across tiles, in that case, they have a gutter that should be removed when rendering them)static Hints.Key
GEOMETRY_DISTANCE
Asks a datastore having a vector pyramid (pre-generalized geometries) to return the geometry version whose points have been generalized less than the specified distance (further generalization might be performed by the client in memory).static Hints.Key
GEOMETRY_GENERALIZATION
Asks a datastore to perform a topology preserving on the fly generalization of the geometries.static Hints.Key
GEOMETRY_SIMPLIFICATION
Asks a datastore to perform a non topology preserving on the fly generalization of the geometries (e.g., returning self crossing polygons as a result of the geoneralization is considered valid).static Hints.Key
GEOMETRY_VALIDATE
Iftrue
, geometry will be validated on creation.static Hints.Key
GRANULE_REMOVAL_POLICY
Granule removachoosing policy.static Hints.ClassKey
GRID_COVERAGE_FACTORY
The GridCoverageFactory to be used.static Hints.ClassKey
HTTP_CLIENT
Which Http client should be created.static Hints.ClassKey
HTTP_CLIENT_FACTORY
Which Http client factory should be usedstatic Hints.Key
HTTP_LOGGING
Should we log each http request FALSE/TRUE/charsetstatic Hints.Key
JAI_INSTANCE
TheJAI
instance to use.static Hints.ClassKey
JTS_COORDINATE_SEQUENCE_FACTORY
TheCoordinateSequenceFactory
instance to use.static Hints.ClassKey
JTS_GEOMETRY_FACTORY
TheGeometryFactory
instance to use.static Hints.Key
JTS_PRECISION_MODEL
ThePrecisionModel
instance to use.static Hints.Key
JTS_SRID
The spatial reference ID forGeometryFactory
.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
LINEARIZATION_TOLERANCE
The default linearization tolerance for curved geometriesstatic Hints.Key
LOCAL_DATE_TIME_HANDLING
Controls date field handling.static Hints.ClassKey
MATH_TRANSFORM_FACTORY
TheMathTransformFactory
instance to use.static Hints.Key
MAX_ALLOWED_TILES
Key to control the maximum allowed number of tiles that we will load.static Hints.Key
MAX_MEMORY_SORT
Key to control the maximum number of features that will be kept in memory when performing a fallback merge-sort (used when the datastore does not have native means to handle feature sorting)static Hints.Key
MOSAIC_LOCATION_ATTRIBUTE
Key to control the name of the attribute that contains the location for the tiles in the mosaic index.static Hints.Key
OVERVIEW_POLICY
Overview choosing policy.static Hints.Key
PRIMITIVE_FACTORY
Theorg.geotools.api.geometry.primitive.PrimitiveFactory
instance to use.static Hints.Key
PROVIDED_FID
Optional Hint used in conjunction with USE_POVIDED_FID above.static Hints.ClassKey
REPOSITORY
TheRepository
to use to fetch DataAccess and DataStorestatic Hints.Key
RESAMPLE_TOLERANCE
Resample tolerance (defaults toDEFAULT_RESAMPLE_TOLERANCE
)static Hints.Key
RESOLVE
Resolve setting for resolving resources.static Hints.Key
RESOLVE_TIMEOUT
The maximum time-out for resolving resources.static Hints.Key
SAMPLE_DIMENSION_TYPE
TheSampleDimensionType
to use.static Hints.Key
SCREENMAP
The rendering aid used to avoid painting tiny features over and over in the same pixelstatic Hints.Key
SKIP_EXTERNAL_OVERVIEWS
Indicates whether to skip external overview files when loading a Coverage (on by default in most raster readers).static Hints.ClassKey
STYLE_FACTORY
TheStyleFactory
instance to use.static Hints.Key
TILE_ENCODING
The tile encoder name (as aString
value) to use during serialization of image data in aGridCoverage2D
object.static Hints.Key
USE_JAI_IMAGEREAD
Tells to theGridCoverageReader
instances to read the image using the JAI ImageRead operation (leveraging on Deferred Execution Model, Tile Caching,...) or the directImageReader
's read methods.static Hints.Key
USE_PROVIDED_FID
When this key is used in the user data section of a feature and the feature store query capabilities reports being able to use provided feature ids the store will try to use the user provided feature id during insertion, and will fail if the FID cannot be parsed into a valid storage identifierstatic Hints.Key
VERSION
Version number of the requested service.static Hints.ClassKey
VIRTUAL_TABLE_PARAMETERS
Provides the parameter values to a JDBC parametrized SQL view.-
Fields inherited from class RenderingHints
KEY_ALPHA_INTERPOLATION, KEY_ANTIALIASING, KEY_COLOR_RENDERING, KEY_DITHERING, KEY_FRACTIONALMETRICS, KEY_INTERPOLATION, KEY_RENDERING, KEY_RESOLUTION_VARIANT, KEY_STROKE_CONTROL, KEY_TEXT_ANTIALIASING, KEY_TEXT_LCD_CONTRAST, 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_RESOLUTION_VARIANT_BASE, VALUE_RESOLUTION_VARIANT_DEFAULT, VALUE_RESOLUTION_VARIANT_DPI_FIT, VALUE_RESOLUTION_VARIANT_SIZE_FIT, VALUE_STROKE_DEFAULT, VALUE_STROKE_NORMALIZE, VALUE_STROKE_PURE, VALUE_TEXT_ANTIALIAS_DEFAULT, VALUE_TEXT_ANTIALIAS_GASP, VALUE_TEXT_ANTIALIAS_LCD_HBGR, VALUE_TEXT_ANTIALIAS_LCD_HRGB, VALUE_TEXT_ANTIALIAS_LCD_VBGR, VALUE_TEXT_ANTIALIAS_LCD_VRGB, VALUE_TEXT_ANTIALIAS_OFF, VALUE_TEXT_ANTIALIAS_ON
-
-
Constructor Summary
Constructors Constructor Description Hints()
Constructs an initially empty set of hints.Hints(RenderingHints hints)
Constructs a new object with keys and values initialized from the specified hints (which may be null).Hints(RenderingHints.Key key, Object value)
Constructs a new object with the specified key/value pair.Hints(RenderingHints.Key key1, Object value1, RenderingHints.Key key2, Object value2)
Constructs a new object with two key/value pair.Hints(RenderingHints.Key key1, Object value1, RenderingHints.Key key2, Object value2, Object... pairs)
Constructs a new object from key/value pair.Hints(Map<? extends RenderingHints.Key,?> hints)
Constructs a new object with keys and values initialized from the specified map (which may be null).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Hints
clone()
Returns a new map of hints with the same content than this map.static Object
getSystemDefault(RenderingHints.Key key)
Returns the hint default value for the specified key.static Object
putSystemDefault(RenderingHints.Key key, Object value)
Adds a hint value to the set of default hints.static Object
removeSystemDefault(RenderingHints.Key key)
Removes the specified hints from the set of default hints.static void
scanSystemProperties()
Notifies that system properties will need to be scanned for any property keys defined in theGeoTools
class.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 interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
CRS_AUTHORITY_FACTORY
public static final Hints.ClassKey CRS_AUTHORITY_FACTORY
TheCRSAuthorityFactory
instance to use.- See Also:
org.geotools.referencing.FactoryFinder#getCRSAuthorityFactory
-
CS_AUTHORITY_FACTORY
public static final Hints.ClassKey CS_AUTHORITY_FACTORY
TheCSAuthorityFactory
instance to use.- See Also:
org.geotools.referencing.FactoryFinder#getCSAuthorityFactory
-
DATUM_AUTHORITY_FACTORY
public static final Hints.ClassKey DATUM_AUTHORITY_FACTORY
TheDatumAuthorityFactory
instance to use.- See Also:
org.geotools.referencing.FactoryFinder#getDatumAuthorityFactory
-
CRS_FACTORY
public static final Hints.ClassKey CRS_FACTORY
TheCRSFactory
instance to use.- See Also:
org.geotools.referencing.FactoryFinder#getCRSFactory
-
CS_FACTORY
public static final Hints.ClassKey CS_FACTORY
TheCSFactory
instance to use.- See Also:
org.geotools.referencing.FactoryFinder#getCSFactory
-
DATUM_FACTORY
public static final Hints.ClassKey DATUM_FACTORY
TheDatumFactory
instance to use.- See Also:
org.geotools.referencing.FactoryFinder#getDatumFactory
-
COORDINATE_OPERATION_FACTORY
public static final Hints.ClassKey COORDINATE_OPERATION_FACTORY
TheCoordinateOperationFactory
instance to use.- See Also:
org.geotools.referencing.FactoryFinder#getCoordinateOperationFactory
-
COORDINATE_OPERATION_AUTHORITY_FACTORY
public static final Hints.ClassKey COORDINATE_OPERATION_AUTHORITY_FACTORY
TheCoordinateOperationAuthorityFactory
instance to use.- See Also:
org.geotools.referencing.FactoryFinder#getCoordinateOperationAuthorityFactory
-
MATH_TRANSFORM_FACTORY
public static final Hints.ClassKey MATH_TRANSFORM_FACTORY
TheMathTransformFactory
instance to use.- See Also:
org.geotools.referencing.FactoryFinder#getMathTransformFactory
-
DEFAULT_COORDINATE_REFERENCE_SYSTEM
public static final Hints.Key DEFAULT_COORDINATE_REFERENCE_SYSTEM
The defaultCoordinateReferenceSystem
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
-
CRS_AUTHORITY_EXTRA_DIRECTORY
public static final Hints.FileKey CRS_AUTHORITY_EXTRA_DIRECTORY
Used to direct WKT CRS Authority to a directory containing extra definitions. The value should be an instance ofFile
orString
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.To set the directory on the command line:
-D"org.geotools.referencing.crs-directory"=path
- Since:
- 2.4
-
EPSG_DATA_SOURCE
public static final Hints.Key EPSG_DATA_SOURCE
The data source name to lookup from JNDI when initializing the EPSG factory. Possible values:String
- used with JNDI to locate datasource. This hint has no effect if there is no JNDI initial context setup.- DataSource - used as is.
- missing - default to "java:comp/env/jdbc/EPSG".
To set on the command line:
-D"org.geotools.referencing.epsg-datasource"=jndiReference
- Since:
- 2.4
-
DATUM_SHIFT_METHOD
public static final Hints.OptionKey DATUM_SHIFT_METHOD
The preferred datum shift method to use for coordinate operations. Valid values are"Molodenski"
,"Abridged_Molodenski"
or"Geocentric"
. Other values may be supplied if a math transform exists for that name, but this is not guaranteed to work.- See Also:
org.geotools.referencing.FactoryFinder#getCoordinateOperationFactory
-
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 isFALSE
, which means that coordinate operation factory throws an exception if such a case occurs. If this hint is set toTRUE
, then the user is strongly encouraged to check the positional accuracy for every transformation created. If the set of positional accuracy containsDATUM_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:
org.geotools.referencing.FactoryFinder#getCoordinateOperationFactory
-
FORCE_LONGITUDE_FIRST_AXIS_ORDER
public static final Hints.Key FORCE_LONGITUDE_FIRST_AXIS_ORDER
Tells if the coordinate systems created by an authority factory should be forced to (longitude,latitude) axis order. This hint is especially useful for creating objects from EPSG codes. Most defined in the EPSG database use (latitude,longitude) axis order. Unfortunatly, many data sources available in the world uses the opposite axis order and still claim to use a CRS described by an EPSG code. This hint allows to handle such data.This hint shall be passed to the
FactoryFinder.getCRSAuthorityFactory(...)
method. Whatever this hint is supported or not is authority dependent. In the default Geotools configuration, this hint is supported for the"EPSG"
authority.If this hint is not provided, then the default value depends on many factors including system properties and plugins available in the classpath. In Geotools implementation, the default value is usually
FALSE
with one exception: If thesystem property is set to
true
, then the default value istrue
at least for the default EPSG factory.If both the above-cited system property and this hint are provided, then this hint has precedence. This allow axis order control on a data store basis, and keep the system-wide property as the default value only for cases where axis order is unspecified.
To set on the command line:
-D"org.geotools.referencing.forceXY"=longitudeFirst
- Since:
- 2.3
- See Also:
org.geotools.referencing.FactoryFinder#getCSFactory
,org.geotools.referencing.FactoryFinder#getCRSFactory
,OrderedAxisAuthorityFactory
,LongitudeFirstFactory
-
FORCE_SRS_STYLE
public static final Hints.Key FORCE_SRS_STYLE
Forces encoding all CRS with the srs style
-
FORCE_AXIS_ORDER_HONORING
public static final Hints.Key FORCE_AXIS_ORDER_HONORING
Applies theFORCE_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 OGC - in theory users are not allowed to change its behavior. If nevertheless a user really need to change its behavior, then he must provides explicitly a comma separated list of authorities with thisFORCE_AXIS_ORDER_HONORING
hint in addition to setting theFORCE_LONGITUDE_FIRST_AXIS_ORDER
hint.Example: In order to apply the (longitude,latitude) axis order to
"http://www.opengis.net/"
and"urn:ogc"
name spaces in addition to EPSG, use the following hints:hints.put(FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); hints.put(FORCE_AXIS_ORDER_HONORING, "http, urn");
Note that the application of (longitude,latitude) axis order to the"urn:ogc"
name space is a clear violation of OGC specification.- Since:
- 2.4
-
FORCE_STANDARD_AXIS_DIRECTIONS
public static final Hints.Key FORCE_STANDARD_AXIS_DIRECTIONS
Tells if the coordinate systems created by an authority factory should be forced to standard axis directions. Iftrue
, then South axis directions are forced to North, West axis directions are forced to East, etc. Iffalse
, then the axis directions are left unchanged.This hint shall be passed to the
FactoryFinder.getCRSAuthorityFactory(...)
method. Whatever this hint is supported or not is authority dependent.- Since:
- 2.3
- See Also:
org.geotools.referencing.FactoryFinder#getCSFactory
,org.geotools.referencing.FactoryFinder#getCRSFactory
,OrderedAxisAuthorityFactory
-
FORCE_STANDARD_AXIS_UNITS
public static final Hints.Key FORCE_STANDARD_AXIS_UNITS
Tells if the coordinate systems created by an authority factory should be forced to standard axis units. Iftrue
, then all angular units are forced to degrees and linear units to meters. Iffalse
, then the axis units are left unchanged.This hint shall be passed to the
FactoryFinder.getCRSAuthorityFactory(...)
method. Whatever this hint is supported or not is authority dependent.- Since:
- 2.3
- See Also:
org.geotools.referencing.FactoryFinder#getCSFactory
,org.geotools.referencing.FactoryFinder#getCRSFactory
,OrderedAxisAuthorityFactory
-
VERSION
public static final Hints.Key VERSION
Version number of the requested service. This hint is used for example in order to get a CRS authority factory backed by a particular version of EPSG database. The value should be an instance ofVersion
.- Since:
- 2.4
-
ENTITY_RESOLVER
public static final Hints.Key ENTITY_RESOLVER
TheEntityResolver
instance to use when configuring SAXParsers.- Since:
- 15
-
USE_PROVIDED_FID
public static final Hints.Key USE_PROVIDED_FID
When this key is used in the user data section of a feature and the feature store query capabilities reports being able to use provided feature ids the store will try to use the user provided feature id during insertion, and will fail if the FID cannot be parsed into a valid storage identifierExample use with Feature.getUserData():
feature.getUserData().put( Hints.USE_PROVIDED_FID, true );
- Since:
- 2.7
-
PROVIDED_FID
public static final Hints.Key PROVIDED_FID
Optional Hint used in conjunction with USE_POVIDED_FID above.This is used when adding Features to the end of a FeatureWriter, allowing you to override the generated feature ID when write() is called. Example use with Feature.getUserData():
feature.getUserData().put( Hints.USE_PROVIDED_FID, true ); feature.getUserData().put( Hints.PROVIDED_FID, "fid5" );
- Since:
- 8.0
-
CRS
public static final Hints.Key CRS
TheCoordinateReferenceSystem
to use in ISO geometry factories.- Since:
- 2.5
- See Also:
JTS_SRID
-
LINEARIZATION_TOLERANCE
public static final Hints.Key LINEARIZATION_TOLERANCE
The default linearization tolerance for curved geometries- Since:
- 12.0
- See Also:
CurvedGeometryFactory
-
PRIMITIVE_FACTORY
public static final Hints.Key PRIMITIVE_FACTORY
Theorg.geotools.api.geometry.primitive.PrimitiveFactory
instance to use.- Since:
- 2.5
-
GEOMETRY_VALIDATE
public static final Hints.Key GEOMETRY_VALIDATE
Iftrue
, geometry will be validated on creation. A value offalse
may speedup geometry creation at the cost of less safety.- Since:
- 2.5
-
JTS_GEOMETRY_FACTORY
public static final Hints.ClassKey JTS_GEOMETRY_FACTORY
TheGeometryFactory
instance to use.- See Also:
#GEOMETRY_FACTORY
,org.geotools.geometry.jts.FactoryFinder#getGeometryFactory
-
JTS_COORDINATE_SEQUENCE_FACTORY
public static final Hints.ClassKey JTS_COORDINATE_SEQUENCE_FACTORY
TheCoordinateSequenceFactory
instance to use.- See Also:
org.geotools.geometry.jts.FactoryFinder#getCoordinateSequenceFactory
-
JTS_PRECISION_MODEL
public static final Hints.Key JTS_PRECISION_MODEL
ThePrecisionModel
instance to use.- See Also:
org.geotools.geometry.jts.FactoryFinder#getPrecisionModel
,#PRECISION
-
JTS_SRID
public static final Hints.Key JTS_SRID
The spatial reference ID forGeometryFactory
.- See Also:
org.geotools.geometry.jts.FactoryFinder#getGeometryFactory
,CRS
-
FEATURE_FACTORY
public static Hints.ClassKey FEATURE_FACTORY
TheFeatureFactory
instance to use.- Since:
- 2.5
-
FEATURE_TYPE_FACTORY
public static Hints.ClassKey FEATURE_TYPE_FACTORY
TheFeatureTypeFactory
instance to use.- Since:
- 2.4
-
FEATURE_COLLECTIONS
public static final Hints.ClassKey FEATURE_COLLECTIONS
Theorg.geotools.feature.FeatureCollections
instance to use.- Since:
- 2.4
- See Also:
CommonFactoryFinder#getFeatureCollections
-
FEATURE_DETACHED
public static final Hints.Key FEATURE_DETACHED
Indicates the features returned by the feature collections should be considered detached from the datastore. If true the features can be udpated without altering the backing store.Examples of features that are "attached" are features are kept in memory or features managed by a transparent persistence mechanism like Hibernate.
- Since:
- 2.4
-
FEATURE_2D
public static final Hints.Key FEATURE_2D
Request that the features returned by the feature collections should be 2D only. Can be used to prevent the request of the third ordinate when only two are going to be used.- Since:
- 2.4.1
-
MAX_MEMORY_SORT
public static final Hints.Key MAX_MEMORY_SORT
Key to control the maximum number of features that will be kept in memory when performing a fallback merge-sort (used when the datastore does not have native means to handle feature sorting)- Since:
- 2.7.3
-
GEOMETRY_DISTANCE
public static final Hints.Key GEOMETRY_DISTANCE
Asks a datastore having a vector pyramid (pre-generalized geometries) to return the geometry version whose points have been generalized less than the specified distance (further generalization might be performed by the client in memory).The geometries returned are supposed to be topologically valid.
-
GEOMETRY_GENERALIZATION
public static final Hints.Key GEOMETRY_GENERALIZATION
Asks a datastore to perform a topology preserving on the fly generalization of the geometries. The datastore will return geometries generalized at the specified distance.
-
GEOMETRY_SIMPLIFICATION
public static final Hints.Key GEOMETRY_SIMPLIFICATION
Asks a datastore to perform a non topology preserving on the fly generalization of the geometries (e.g., returning self crossing polygons as a result of the geoneralization is considered valid).
-
SCREENMAP
public static final Hints.Key SCREENMAP
The rendering aid used to avoid painting tiny features over and over in the same pixel
-
COORDINATE_DIMENSION
public static final Hints.Key COORDINATE_DIMENSION
The actual coordinate dimensions of the geometry (to be used in the GeometryDescriptor user map)
-
STYLE_FACTORY
public static final Hints.ClassKey STYLE_FACTORY
TheStyleFactory
instance to use.- Since:
- 2.4
-
COLOR_DEFINITION
public static final Hints.OptionKey COLOR_DEFINITION
The color definition to use when converting from String to Color. "CSS" corresponds to the CSS Color Module 4 name set ( https://www.w3.org/TR/css-color-4/#named-colors)- Since:
- 17
-
ATTRIBUTE_TYPE_FACTORY
public static final Hints.ClassKey ATTRIBUTE_TYPE_FACTORY
Theorg.geotools.feature.AttributeTypeFactory
instance to use.- Since:
- 2.4
-
FILTER_FACTORY
public static final Hints.ClassKey FILTER_FACTORY
TheFilterFactory
instance to use.- Since:
- 2.4
-
VIRTUAL_TABLE_PARAMETERS
public static final Hints.ClassKey VIRTUAL_TABLE_PARAMETERS
Provides the parameter values to a JDBC parametrized SQL view. The value of the hint must be a Map- Since:
- 2.7
-
GEOMETRY_CLIP
public static final Hints.ClassKey GEOMETRY_CLIP
Used along with vector tile geometries, includes the clip mask to be used when rendering the geometry (geometries in vector tiles can span across tiles, in that case, they have a gutter that should be removed when rendering them)
-
MAX_ALLOWED_TILES
public static final Hints.Key MAX_ALLOWED_TILES
Key to control the maximum allowed number of tiles that we will load. If this number is exceeded, i.e. we request an area which is too large instead of getting stuck with opening thousands of files we throw an error.- Since:
- 2.5
-
MOSAIC_LOCATION_ATTRIBUTE
public static final Hints.Key MOSAIC_LOCATION_ATTRIBUTE
Key to control the name of the attribute that contains the location for the tiles in the mosaic index.- Since:
- 2.5
-
USE_JAI_IMAGEREAD
public static final Hints.Key USE_JAI_IMAGEREAD
Tells to theGridCoverageReader
instances to read the image using the JAI ImageRead operation (leveraging on Deferred Execution Model, Tile Caching,...) or the directImageReader
's read methods.- Since:
- 2.4
-
OVERVIEW_POLICY
public static final Hints.Key OVERVIEW_POLICY
Overview choosing policy. The value must be one of {link #org.geotools.coverage.grid.io.OverviewPolicy} enumeration.- Since:
- 2.5
-
DECIMATION_POLICY
public static final Hints.Key DECIMATION_POLICY
Decimation choosing policy. The value must be one of {link #org.geotools.coverage.grid.io.DecimationPolicy} enumeration.- Since:
- 2.7
-
TILE_ENCODING
public static final Hints.Key TILE_ENCODING
The tile encoder name (as aString
value) to use during serialization of image data in aGridCoverage2D
object. This encoding is given to theSerializableRenderedImage
constructor. Valid values include (but is not limited to)"raw"
,"gzip"
and"jpeg"
.Note: We recommend to avoid the
"jpeg"
codec for grid coverages.- Since:
- 2.3
- See Also:
org.geotools.coverage.FactoryFinder#getGridCoverageFactory
-
JAI_INSTANCE
public static final Hints.Key JAI_INSTANCE
TheJAI
instance to use.
-
SAMPLE_DIMENSION_TYPE
public static final Hints.Key SAMPLE_DIMENSION_TYPE
TheSampleDimensionType
to use.
-
GRID_COVERAGE_FACTORY
public static final Hints.ClassKey GRID_COVERAGE_FACTORY
The GridCoverageFactory to be used.- Since:
- 2.7
-
EXECUTOR_SERVICE
public static final Hints.ClassKey EXECUTOR_SERVICE
TheExecutorService
to use.- Since:
- 2.7
-
DEFAULT_RESAMPLE_TOLERANCE
public static double DEFAULT_RESAMPLE_TOLERANCE
Default resample tolerance value, if not specified via theRESAMPLE_TOLERANCE
hint
-
RESAMPLE_TOLERANCE
public static final Hints.Key RESAMPLE_TOLERANCE
Resample tolerance (defaults toDEFAULT_RESAMPLE_TOLERANCE
)To set on the command line:
-D"org.geotools.referencing.resampleTolerance"=0.333
- Since:
- 2.7
-
REPOSITORY
public static final Hints.ClassKey REPOSITORY
TheRepository
to use to fetch DataAccess and DataStore- Since:
- 18
-
GRANULE_REMOVAL_POLICY
public static final Hints.Key GRANULE_REMOVAL_POLICY
Granule removachoosing policy. The value must be one of {link #org.geotools.coverage.grid.io.GranuleRemovalPolicy} enumeration.- Since:
- 2.5
-
SKIP_EXTERNAL_OVERVIEWS
public static final Hints.Key SKIP_EXTERNAL_OVERVIEWS
Indicates whether to skip external overview files when loading a Coverage (on by default in most raster readers). The lookup can be costly if the files are on a remote server or network disk.
-
RESOLVE
public static final Hints.Key RESOLVE
Resolve setting for resolving resources. ("local", "none", "remote" or "all")This maps directly to the
resolve
parameter in a WFS query.
-
RESOLVE_TIMEOUT
public static final Hints.Key RESOLVE_TIMEOUT
The maximum time-out for resolving resources.This maps directly to the
resolveTimeOut
parameter in a WFS query.
-
ASSOCIATION_TRAVERSAL_DEPTH
public static final Hints.Key ASSOCIATION_TRAVERSAL_DEPTH
The maximum number of associations traversed in a datastore query.This maps directly to the
traversalXlinkDepth
parameter in a WFS query.
-
ASSOCIATION_PROPERTY
public static final Hints.Key ASSOCIATION_PROPERTY
The name of a property to traverse in a datastore query.This maps directly to a
xlinkPropertyName
in a WFS query.
-
CACHE_POLICY
public static final Hints.OptionKey CACHE_POLICY
Policy to use for caching referencing objects. Valid values are:"weak"
for holding values through weak references. This option does not actually cache the objects since the garbage collector cleans weak references aggressively, but it allows sharing the instances already created and still in use."fixed") for holding a fixed number of values specified by {@link #CACHE_LIMIT}. <li>{@code "all"} for holding values through strong references.</li> <li>{@code "none"} for disabling the cache.</li> <li>{@code "soft"} for holding the value throuhg(@linkplain java.lang.ref.SoftReference soft references
.
- Since:
- 2.5
-
CACHE_LIMIT
public static final Hints.IntegerKey CACHE_LIMIT
The recommended maximum number of referencing objects to hold in a authority factory.- Since:
- 2.5
-
AUTHORITY_MAX_ACTIVE
public static final Hints.IntegerKey AUTHORITY_MAX_ACTIVE
The maximum number of active authority factories. The default is the number of available processors plus one.This hint is treated as an absolute limit for
AbstractAuthorityMediator
instances such asorg.geotools.referencing.factory.epsg.HsqlDialectEpsgMediator
. As such this will be the absolute limit on the number of database connections the mediator will make use of.When this limit it reached, code will be forced to block while waiting for a connection to become available.
When this value is non positive their is no limit to the number of active authority factories deployed.
- Since:
- 2.5
-
AUTHORITY_MIN_IDLE
public static final Hints.IntegerKey AUTHORITY_MIN_IDLE
Minimum number of objects required before the evictor will begin removing objects. This value is also used by AUTHORITY_SOFTMIN_EVICT_IDLETIME to keep this many idle workers around.In practice this value indicates the number of database connections the application will hold open "just in case".
Recomendations:
- Desktop Application: 1
- Server Application: 2-3
- Since:
- 2.5
-
AUTHORITY_MAX_IDLE
public static final Hints.IntegerKey AUTHORITY_MAX_IDLE
The number of idle AuthorityFactories.This hint is treated as a recommendation for AbstractAuthorityMediator instances such as HsqlDialectEpsgMediator. As such this will control the number of connections the mediator is comfortable having open.
If AUTHORITY_MAX_ACTIVE is set to 20, up to twenty connections will be used during heavy load. If the AUTHORITY_MAX_IDLE is set to 10, connections will be immediately reclaimed until only 10 are open. As these 10 remain idle for AUTHORITY_
When the amount of time specified by AUTHORITY_IDLE_WAIT is non zero Max idle controls the maximum number of objects that can sit idle in the pool at any time. When negative, there is no limit to the number of objects that may be idle at one time.
- Since:
- 2.5
-
AUTHORITY_MIN_EVICT_IDLETIME
public static final Hints.IntegerKey AUTHORITY_MIN_EVICT_IDLETIME
When the evictor is run, if more time (in milliseconds) than the value inAUTHORITY_MIN_EVICT_IDLETIME
has passed, then the worker is destroyed.- Since:
- 2.5
-
AUTHORITY_SOFTMIN_EVICT_IDLETIME
public static final Hints.IntegerKey AUTHORITY_SOFTMIN_EVICT_IDLETIME
When the evictor is run, workers which have been idle for more than this value will be destroyed if and only if the number of idle workers exceeds AUTHORITY_MIN_IDLE.- Since:
- 2.5
-
AUTHORITY_TIME_BETWEEN_EVICTION_RUNS
public static final Hints.IntegerKey AUTHORITY_TIME_BETWEEN_EVICTION_RUNS
Time in milliseconds to wait between eviction runs.- Since:
- 2.5
-
COMPARISON_TOLERANCE
public static final Hints.DoubleKey COMPARISON_TOLERANCE
Tolerance used in comparisons between floating point values. Two floating points A and B are considered the same if A * (1 - tol) <= B <= A * (1 + tol). The default value is 0, meaning the two doubles have to be exactly the same (a bit to bit comparison will be performed).- Since:
- 2.6
-
LOCAL_DATE_TIME_HANDLING
public static final Hints.Key LOCAL_DATE_TIME_HANDLING
Controls date field handling. If true, allDate
fields are treated as local dates being unrelated to time zones. Otherwise they are treated as time zone related. Local dates are serialized to string using the local time zone (JVM default time zone). Time zone related dates are serialized to string using GMT. Default is false, Date treated as time zone related.To set on the command line:
-D"org.geotools.localDateTimeHandling"=true
- Since:
- 15.0
-
ENCODE_EWKT
public static final Hints.Key ENCODE_EWKT
A flag to enabled/disable EWKT geometry encoding in ECQL
-
HTTP_CLIENT_FACTORY
public static final Hints.ClassKey HTTP_CLIENT_FACTORY
Which Http client factory should be used
-
HTTP_CLIENT
public static final Hints.ClassKey HTTP_CLIENT
Which Http client should be created.
-
HTTP_LOGGING
public static final Hints.Key HTTP_LOGGING
Should we log each http request FALSE/TRUE/charset
-
DATE_TIME_FORMAT_HANDLING
public static final Hints.Key DATE_TIME_FORMAT_HANDLING
Controls date time formatting output for GML 2.To set on the command line:
-D"org.geotools.dateTimeFormatHandling"=true
- Since:
- 21.0
-
-
Constructor Detail
-
Hints
public Hints()
Constructs an initially empty set of hints.- Since:
- 2.5
-
Hints
public Hints(RenderingHints.Key key, 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 withkey
.
-
Hints
public Hints(RenderingHints.Key key1, Object value1, RenderingHints.Key key2, Object value2)
Constructs a new object with two key/value pair.- Parameters:
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.- Since:
- 2.4
-
Hints
public Hints(RenderingHints.Key key1, Object value1, RenderingHints.Key key2, Object value2, Object... pairs)
Constructs a new object from key/value pair.- Parameters:
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.- Since:
- 2.4
-
Hints
public Hints(Map<? extends RenderingHints.Key,?> 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, ornull
if the object should be empty.
-
Hints
public Hints(RenderingHints hints)
Constructs a new object with keys and values initialized from the specified hints (which may be null).- Parameters:
hints
- A map of key/value pairs to initialize the hints, ornull
if the object should be empty.- Since:
- 2.5
-
-
Method Detail
-
clone
public Hints clone()
Returns a new map of hints with the same content than this map.- Overrides:
clone
in classRenderingHints
- Since:
- 2.5
-
scanSystemProperties
public static void scanSystemProperties()
Notifies that system properties will need to be scanned for any property keys defined in theGeoTools
class. New values found (if any) will be added to the set of default hints. For example if the "org.geotools.referencing.forceXY" system property is defined, then theFORCE_LONGITUDE_FIRST_AXIS_ORDER
hint will be added to the set of default hints.This method is invoked automatically the first time it is needed. It usually don't need to be invoked explicitly, except if the system properties changed. The scan may not be performed immediately, but rather when needed at some later stage.
- Since:
- 2.4
-
getSystemDefault
public static Object getSystemDefault(RenderingHints.Key key)
Returns the hint default value for the specified key.- Parameters:
key
- The hints key.- Returns:
- The value for the specified key, or
null
if the key did not have a mapping. - Since:
- 2.4
-
putSystemDefault
public static Object putSystemDefault(RenderingHints.Key key, Object value)
Adds a hint value to the set of default hints. Default hints can be added by call to thisputDefaultHint
method, to theGeoTools.init(org.geotools.util.factory.Hints)
method or by system properties with keys defined by theString
constants in theGeoTools
class.- Parameters:
key
- The hint key.value
- The hint value.- Returns:
- The previous value of the specified key, or
null
if none. - Throws:
IllegalArgumentException
- IfHints.Key#isCompatibleValue()
returnsfalse
for the specified value.- Since:
- 2.4
-
removeSystemDefault
public static Object removeSystemDefault(RenderingHints.Key key)
Removes the specified hints from the set of default hints.- Parameters:
key
- The hints key that needs to be removed.- Returns:
- The value to which the key had previously been mapped, or
null
if the key did not have a mapping. - Since:
- 2.4
-
toString
public String toString()
Returns a string representation of the hints. This method formats the set of hints as a tree. If some system-wide default hints exist, they are formatted after those hints for completeness.- Overrides:
toString
in classRenderingHints
- Since:
- 2.4
-
-