|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.factory.AbstractFactory org.geotools.referencing.factory.AbstractFactory org.geotools.referencing.factory.AbstractAuthorityFactory org.geotools.referencing.factory.AuthorityFactoryAdapter org.geotools.referencing.factory.OrderedAxisAuthorityFactory
An authority factory which delegates all the work to an other factory, and reorder the axis in some pre-determined order. This factory is mostly used by application expecting geographic coordinates in (longitude, latitude) order, while most geographic CRS specified in the EPSG database use the opposite axis order.
It is better to avoid this class if you can. This class exists primarily for compatibility with external data or applications that assume (longitude, latitude) axis order no matter what the EPSG database said, for example Shapefiles. Note that using this "ordered axis authority factory" may have a negative impact on performance, accuracy and range of supported CRS.
If you need to override an official factory by an ordered axis instance on a
system-wide level, the register
convenience method can performs this task
for the current Java Virtual Machine running instance. For example an application using the
EPSG authority factory with (longitude, latitude) order instead of the
official one can invoke the following methods:
OrderedAxisAuthorityFactory.register("EPSG"); // Invoke this only once (usually at startup time) CRSAuthorityFactory f = FactoryFinder.getCRSAuthorityFactory("EPSG", null);
Field Summary |
Fields inherited from class org.geotools.referencing.factory.AuthorityFactoryAdapter |
crsFactory, csFactory, datumFactory, opFactory |
Fields inherited from class org.geotools.referencing.factory.AbstractAuthorityFactory |
factories |
Fields inherited from class org.geotools.referencing.factory.AbstractFactory |
LOGGER |
Fields inherited from class org.geotools.factory.AbstractFactory |
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority |
Constructor Summary | |
OrderedAxisAuthorityFactory(AbstractAuthorityFactory factory,
boolean fixUnits)
Creates a factory which will reorder the axis of all objects created by the supplied factory. |
|
OrderedAxisAuthorityFactory(java.lang.String authority,
Hints hints,
boolean fixUnits)
Creates a factory which will reorder the axis of all objects created by the default authority factories. |
Method Summary | |
protected org.opengis.referencing.cs.CoordinateSystem |
createCS(org.opengis.referencing.cs.CoordinateSystem cs,
org.opengis.referencing.cs.CoordinateSystemAxis[] axis)
Creates a new coordinate system of the same kind than the specified CS, but different axis. |
org.opengis.metadata.citation.Citation |
getAuthority()
Returns the organization or party responsible for definition and maintenance of the database. |
static void |
register(java.lang.String authority)
Registers an ordered axis authority factory as a replacement of the specified authority. |
protected org.opengis.referencing.cs.CoordinateSystem |
replace(org.opengis.referencing.cs.CoordinateSystem cs)
Reorder (if needed) the axis in the specified coordinate system. |
static void |
unregister(java.lang.String authority)
Unregisters an ordered axis authority factory previously registered with the register method. |
Methods inherited from class org.geotools.referencing.factory.AbstractAuthorityFactory |
getImplementationHints, noSuchAuthorityCode, onRegistration, trimAuthority |
Methods inherited from class org.geotools.referencing.factory.AbstractFactory |
ensureNonNull |
Methods inherited from class org.geotools.factory.AbstractFactory |
onDeregistration |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OrderedAxisAuthorityFactory(AbstractAuthorityFactory factory, boolean fixUnits)
factory
- The factory that produces objects using arbitrary axis order.fixUnits
- if this authority factory should also force all angular units
to degrees and linear units to meters, or if the units should
be left unchanged.public OrderedAxisAuthorityFactory(java.lang.String authority, Hints hints, boolean fixUnits)
FactoryFinder
.
authority
- The authority to wraps (example: ).hints
- An optional set of hints, or if none.fixUnits
- if this authority factory should also force all angular units
to degrees and linear units to meters, or if the units should
be left unchanged.
FactoryRegistryException
- if at least one factory can not be obtained.Method Detail |
public static void register(java.lang.String authority) throws FactoryRegistryException
FactoryFinder.getFooAuthorityFactory(authority)
FactoryFinder
with a priority slightly
higher than the priority of wrapped factories. Consequently, the reordered
axis authority factory should become the default one for the specified
authority.WARNING: this method has a system-wide effect. Any user asking for the specified will get an ordered axis authority factory instance. It may be misleading for client code expecting the official factory. Avoid this method unless you really need reordered axis for all code in the current Java Virtual Machine.
authority
- The name of the authority factories to override with an ordered axis
instance.
FactoryRegistryException
- if the registration failed.public static void unregister(java.lang.String authority) throws FactoryRegistryException
register
method.
authority
- The authority name given to the register
method.
FactoryRegistryException
- if the unregistration failed.public org.opengis.metadata.citation.Citation getAuthority()
Note: the title and alternates titles are modified as described above in order to make it clear for human readers that objects to be created are not from the official authority. However, this method copies the identifiers unchanged in order to allow applications to use this factory as a replacement of the official one.
getAuthority
in interface org.opengis.referencing.AuthorityFactory
getAuthority
in class AuthorityFactoryAdapter
protected org.opengis.referencing.cs.CoordinateSystem replace(org.opengis.referencing.cs.CoordinateSystem cs) throws org.opengis.referencing.FactoryException
AbstractCS.standard(cs)
.
Implementation note: It would have been possible to reorder axis using some
algorithm more generic than standard(cs)
. But
we use the above-cited method anyway in order to get consistent "standard" axis accross the
whole Geotools implementation.
replace
in class AuthorityFactoryAdapter
cs
- The coordinate system to replace.
org.opengis.referencing.FactoryException
- If this method can't rearange the axis for the specified .protected org.opengis.referencing.cs.CoordinateSystem createCS(org.opengis.referencing.cs.CoordinateSystem cs, org.opengis.referencing.cs.CoordinateSystemAxis[] axis) throws org.opengis.referencing.FactoryException
replace(CoordinateSystem)
after
it determined that the axis order need to be changed. Subclasses can override this method
if they want to performs some extra processing on the axis order.
cs
- The coordinate system to use as a model.axis
- The axis to give to the new coordinate system. Subclasses are allowed to write
directly in this array (no need to copy it).
org.opengis.referencing.FactoryException
- if the coordinate system can't be created.
java.lang.IndexOutOfBoundsException
- if the length of is smaller than the number of
dimensions in .
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |