public class FactoryUsingWKT extends DeferredAuthorityFactory implements CRSAuthorityFactory
org.geotools.referencing.factory.epsg
package, and whose name should be "epsg.properties". If no property file is found, the factory won't be activated. The property file can
also be located in a custom directory; See getDefinitionsURL()
for more details.
This factory can also be used to provide custom extensions or overrides to a main EPSG
factory. In order to provide a custom extension file, override the getDefinitionsURL()
method. In order to make the factory be an override, change the default priority by using the two
arguments constructor (this factory defaults to ThreadedEpsgFactory.PRIORITY
- 10, so
it's used as an extension).
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_PRIORITY
Deprecated.
We will try to replace the priority mechanism by a better one in a future
Geotools version.
|
static String |
FILENAME
The default filename to read.
|
LOGGER
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
Constructor and Description |
---|
FactoryUsingWKT()
Constructs an authority factory using the default set of factories.
|
FactoryUsingWKT(Hints userHints)
Constructs an authority factory using a set of factories created from the specified hints.
|
FactoryUsingWKT(Hints userHints,
int priority)
Constructs an authority factory using the specified hints and priority.
|
Modifier and Type | Method and Description |
---|---|
protected AbstractAuthorityFactory |
createBackingStore()
Creates the backing store authority factory.
|
protected Citation[] |
getAuthorities()
Returns the set of authorities to use as identifiers for the CRS to be created.
|
Citation |
getAuthority()
Returns the authority.
|
protected URL |
getDefinitionsURL()
Returns the URL to the property file that contains CRS definitions.
|
static void |
main(String[] args)
Prints a list of codes that duplicate the ones provided in the
ThreadedEpsgFactory . |
protected static void |
main(String[] args,
Class<? extends FactoryUsingWKT> type)
Implementation of the
main(java.lang.String[]) method, shared by subclasses. |
Set |
reportDuplicatedCodes(PrintWriter out)
Prints a list of codes that duplicate the ones provided by
ThreadedEpsgFactory . |
Set |
reportInstantiationFailures(PrintWriter out)
Prints a list of CRS that can't be instantiated.
|
canDisposeBackingStore, dispose, disposeBackingStore, exit, getBackingStore, isAvailable, isConnected, setTimeout
createCartesianCS, createCompoundCRS, createCoordinateOperation, createCoordinateReferenceSystem, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createDatum, createDerivedCRS, createEllipsoid, createEllipsoidalCS, createEngineeringCRS, createEngineeringDatum, createExtent, createFromCoordinateReferenceSystemCodes, createGeocentricCRS, createGeodeticDatum, createGeographicCRS, createImageCRS, createImageDatum, createObject, createOperationMethod, createParameterDescriptor, createPolarCS, createPrimeMeridian, createProjectedCRS, createSphericalCS, createTemporalCRS, createTemporalDatum, createTimeCS, createUnit, createVerticalCRS, createVerticalCS, createVerticalDatum, getAuthorityCodes, getBackingStoreDescription, getDescriptionText, getIdentifiedObjectFinder, getVendor
noSuchAuthorityCode, trimAuthority
ensureNonNull
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
createCompoundCRS, createCoordinateReferenceSystem, createDerivedCRS, createEngineeringCRS, createGeocentricCRS, createGeographicCRS, createImageCRS, createProjectedCRS, createTemporalCRS, createVerticalCRS
createObject, getAuthorityCodes, getDescriptionText
getImplementationHints
public static final String FILENAME
FactoryUsingWKT
implementation will search
for the first occurence of this file in the following places:
org/geotools/referencing/factory/espg
directories found on the
classpath.
The filename part before the extension ("epsg"
) denotes the authority namespace
where to register the content of this file. The user-directory given by the system property
may contains other property files for other authorities, like "esri.properties"
, but
those additional authorities are not handled by the default FactoryUsingWKT
class.
getDefinitionsURL()
,
Constant Field Valuesprotected static final int DEFAULT_PRIORITY
public FactoryUsingWKT()
public FactoryUsingWKT(Hints userHints)
CRS
, CS
,
DATUM
and MATH_TRANSFORM
FACTORY
hints.public FactoryUsingWKT(Hints userHints, int priority)
public Citation getAuthority()
getAuthorities()
, with the addition of identifiers from all additional authorities
returned by the above method.getAuthority
in interface AuthorityFactory
getAuthority
in class BufferedAuthorityFactory
getAuthorities()
protected Citation[] getAuthorities()
The default implementation returns a singleton containing only EPSG. Subclasses should override this method in order to enumerate all relevant authorities,
with EPSG in last position. For example EsriExtension
returns {ESRI, EPSG}.
protected URL getDefinitionsURL()
org/geotools/referencing/factory/epsg
directory on the classpath will be used.
null
if none.protected AbstractAuthorityFactory createBackingStore() throws FactoryException
createBackingStore
in class DeferredAuthorityFactory
createXXX(...)
methods.FactoryNotFoundException
- if the no epsg.properties
file has been found.FactoryException
- if the constructor failed to find or read the file. This exception
usually has an IOException
as its cause.public Set reportDuplicatedCodes(PrintWriter out) throws FactoryException
ThreadedEpsgFactory
. This
is used for implementation of main method in order to check the content of
the "epsg.properties" file (or whatever property file used as backing store for this
factory) from the command line.out
- The writer where to print the report.FactoryException
- if an error occured.public Set reportInstantiationFailures(PrintWriter out) throws FactoryException
out
- The writer where to print the report.FactoryException
- if an error occured while fetching
authority codes.public static void main(String[] args) throws FactoryException
ThreadedEpsgFactory
.
The factory tested is the one registered in ReferencingFactoryFinder
. By default,
this is this FactoryUsingWKT
class backed by the "epsg.properties" property file.
This method can be invoked from the command line in order to check the content of the
property file. Valid arguments are:
-test | Try to instantiate all CRS and reports any failure to do so. |
-duplicated | List all codes from the WKT factory that are duplicating a code from the SQL factory. |
args
- Command line arguments.FactoryException
- if an error occured.protected static void main(String[] args, Class<? extends FactoryUsingWKT> type) throws FactoryException
main(java.lang.String[])
method, shared by subclasses.FactoryException
Copyright © 1996–2019 Geotools. All rights reserved.