|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.commons.config.AbstractBasicResourceManager org.deegree.cs.persistence.CRSManager
public class CRSManager
Entry point for creating and retrieving CRSStore
and CRSStoreProvider
instances.
Field Summary |
---|
Fields inherited from class org.deegree.commons.config.AbstractBasicResourceManager |
---|
dir, idToState |
Constructor Summary | |
---|---|
CRSManager()
|
Method Summary | |
---|---|
ResourceState |
activate(String id)
Activates the resource with the given identifier. |
CRSStore |
create(URL configURL)
Returns an uninitialized CRSStore instance that's created from the specified CRSStore configuration
document. |
ResourceState |
deactivate(String id)
Deactivates the resource with the given identifier. |
static void |
destroy()
cleares the stored configuration |
static CRSStore |
get(String id)
Returns the CRSStore instance with the specified identifier or null if an assigned
CRSStore is missing |
static Collection<CRSStore> |
getAll()
Returns all active CRSStore s. |
List<CRSCodeType[]> |
getAvailableCRSCodes()
This methods allows to get all available identifiers and not in the coordinatesystems themselves from all stores. |
List<ICRS> |
getAvailableCRSs()
This method allows to get all ICRS from all stores. |
static CRSRef |
getCRSRef(ICRS crs)
Returns a CRSRef wrapping the given CRS. |
static CRSRef |
getCRSRef(String uri)
Returns a CRSRef instance which is not resolved. |
static CRSRef |
getCRSRef(String uri,
boolean forceXY)
Return a CRSRef instance which is not resolved. |
static Collection<String> |
getCrsStoreIds()
|
Class<? extends ResourceManager>[] |
getDependencies()
|
ResourceManagerMetadata |
getMetadata()
|
protected ResourceProvider |
getProvider(File file)
|
static Transformation |
getTransformation(String storeId,
ICRS sourceCRS,
ICRS targetCRS)
Retrieve a Transformation (chain) which transforms coordinates from the given source into the given
target crs. |
static Transformation |
getTransformation(String storeId,
ICRS sourceCRS,
ICRS targetCRS,
List<Transformation> transformationsToBeUsed)
Retrieve a Transformation (chain) which transforms coordinates from the given source into the given
target crs. |
static Transformation |
getTransformation(String storeId,
String id)
Get a Transformation with given id, or null if it does not exist. |
static TransformationFactory |
getTransformationFactory(String storeId)
|
void |
init(File crsDir)
Initializes the CRSManager by loading all crs store configurations from the given directory. |
static ICRS |
lookup(CRSCodeType codeType)
Creates a direct ICRS instance from the given CRSCodeType not just a CRSRef , if no
ICRS was found an UnknownCRSException will be thrown. |
static ICRS |
lookup(String name)
Creates a direct ICRS instance from the given name not just a CRSRef , if no ICRS was
found an UnknownCRSException will be thrown. |
static ICRS |
lookup(String name,
boolean forceXY)
Creates a direct ICRS instance from the given name not just a CRSRef , if no ICRS was
found an UnknownCRSException will be thrown. |
static ICRS |
lookup(String storeId,
CRSCodeType crsCodeType)
Creates a direct ICRS instance from the given CRSCodeType notjustjust a CRSRef using the
given storeId, if no ICRS was found an UnknownCRSException will be thrown. |
static ICRS |
lookup(String storeId,
String name)
Creates a direct ICRS instance from the given name using not just a CRSRef the given storeID, if
no ICRS was found in the given store an UnknownCRSException will be thrown. |
static ICRS |
lookup(String storeIdName,
String name,
boolean forceXY)
Creates a direct ICRS instance with the given name not just a CRSRef using the given storeId, if
no ICRS was found an UnknownCRSException will be thrown. |
protected void |
remove(String id)
|
void |
shutdown()
Is called upon workspace shutdown. |
void |
startup(DeegreeWorkspace workspace)
Is called upon workspace startup. |
Methods inherited from class org.deegree.commons.config.AbstractBasicResourceManager |
---|
createResource, deleteResource, getState, getStates, init |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.deegree.commons.config.ResourceManager |
---|
createResource, deleteResource, getState, getStates |
Constructor Detail |
---|
public CRSManager()
Method Detail |
---|
public void startup(DeegreeWorkspace workspace) throws ResourceInitException
ResourceManager
startup
in interface ResourceManager
ResourceInitException
public void shutdown()
ResourceManager
shutdown
in interface ResourceManager
public static void destroy()
public Class<? extends ResourceManager>[] getDependencies()
getDependencies
in interface ResourceManager
public void init(File crsDir)
CRSManager
by loading all crs store configurations from the given directory. If null, or
directory does not exist the default will be used.
crsDir
- public CRSStore create(URL configURL) throws CRSStoreException
CRSStore
instance that's created from the specified CRSStore configuration
document.
configURL
- URL of the configuration document, must not be null
CRSStore
instance, not yet initialized, never null
CRSStoreException
- if the creation fails, e.g. due to a configuration errorpublic static Collection<CRSStore> getAll()
CRSStore
s.
CRSStore
s instance, may be empty but never null
public static CRSStore get(String id)
CRSStore
instance with the specified identifier or null
if an assigned
CRSStore
is missing
id
- identifier of the CRSStore
instance
CRSStore
instance or the default CRSStore
instance if no such instance
has been created or null
if the default one could also not be created.public static Collection<String> getCrsStoreIds()
public ResourceManagerMetadata getMetadata()
getMetadata
in interface ResourceManager
public List<ICRS> getAvailableCRSs() throws CRSConfigurationException
ICRS
from all stores.
CRSConfigurationException
- if the implementation was confronted by an exception and could not deliver the requested crs. This
exception should not be thrown if no CoordinateSystems were found, in the latter case an empty List (
a list with size == 0 ) should be returned.public List<CRSCodeType[]> getAvailableCRSCodes() throws CRSConfigurationException
CRSConfigurationException
- if the implementation was confronted by an exception and could not deliver the requested crs. This
exception should not be thrown if no CoordinateSystems were found, in the latter case an empty List (
a list with size == 0 ) should be returned.public static CRSRef getCRSRef(String uri)
CRSRef
instance which is not resolved.
uri
- the uri of the resource which is used to resolve the reference
CRSRef
instancepublic static CRSRef getCRSRef(String uri, boolean forceXY)
CRSRef
instance which is not resolved.
uri
- the uri of the resource which is used to resolve the referenceforceXY
- flag indicating if the axis order should be as configured or xy
CRSRef
instancepublic static CRSRef getCRSRef(ICRS crs)
CRSRef
wrapping the given CRS. The uri of the reference is set to the id of the given
ICRS
crs
- the ICRS
to wrap
public static ICRS lookup(String name) throws UnknownCRSException
ICRS
instance from the given name not just a CRSRef
, if no ICRS
was
found an UnknownCRSException
will be thrown. All configured CRSStore
s will be considered and the
first match returned.
name
- of the crs, e.g. EPSG:4326
ICRS
instance corresponding to the given name not just a CRSRef
, using all
configured CRSStore
s.
UnknownCRSException
- if a ICRS
with the name is not knownpublic static ICRS lookup(String name, boolean forceXY) throws UnknownCRSException
ICRS
instance from the given name not just a CRSRef
, if no ICRS
was
found an UnknownCRSException
will be thrown. All configured CRSStore
s will be considered and the
first match returned.
name
- of the crs, e.g. EPSG:4326forceXY
- true if the axis order of the coordinate system should be x/y (EAST/NORTH; WEST/SOUTH); false id the
defined axis order should be used
ICRS
instance corresponding to the given name not just a CRSRef
, using all
configured CRSStore
s.
UnknownCRSException
- if a ICRS
with the name is not knownpublic static ICRS lookup(CRSCodeType codeType) throws UnknownCRSException
ICRS
instance from the given CRSCodeType
not just a CRSRef
, if no
ICRS
was found an UnknownCRSException
will be thrown. All configured CRSStore
s will be
considered and the first match returned.
codeType
- the CodeType
of the CRS to return
ICRS
instance with the given CodeType
not just a CRSRef
UnknownCRSException
- if a ICRS
with the name is not knownpublic static ICRS lookup(String storeId, String name) throws UnknownCRSException
ICRS
instance from the given name using not just a CRSRef
the given storeID, if
no ICRS
was found in the given store an UnknownCRSException
will be thrown.
storeId
- identifier of the CRSStore
looking for the ICRS
with the given name, may be
null
if in all CRSStore
s should be searchedname
- of the crs, e.g. EPSG:31466
ICRS
instance not just a CRSRef
corresponding to the given name from the
CRSStore
with the given id
UnknownCRSException
- if a ICRS
with the name is not knownpublic static ICRS lookup(String storeIdName, String name, boolean forceXY) throws UnknownCRSException
ICRS
instance with the given name not just a CRSRef
using the given storeId, if
no ICRS
was found an UnknownCRSException
will be thrown.
storeId
- identifier of the store, looking for the ICRS
instance, may be null
if in all
CRSStore
s should be searchedname
- of the crs, e.g. EPSG:31466forceXY
- true if the axis order of the coordinate system should be x/y (EAST/NORTH; WEST/SOUTH); false id the
defined axis order should be used
ICRS
instance not just a CRSRef
corresponding to the given name from the
CRSStore
with the given id
UnknownCRSException
- if a ICRS
with the name is not knownpublic static ICRS lookup(String storeId, CRSCodeType crsCodeType) throws UnknownCRSException
ICRS
instance from the given CRSCodeType
notjustjust a CRSRef
using the
given storeId, if no ICRS
was found an UnknownCRSException
will be thrown.
storeId
- identifier of the store, looking for the ICRS
instance, may be null
if in all
CRSStore
s should be searchedcrsCodeType
- the CRSCodeType
of the ICRS to return
ICRS
not just a reference.
UnknownCRSException
- if a ICRS
with the name is not knownpublic static final TransformationFactory getTransformationFactory(String storeId)
storeId
- identifier of the CRSStore
instance, may be null
, then the first transformation
factory will be returned
TransformationFactory
instance assigned to the store with the given id or the first one in
the list of TransformationFactory
s if no such instance has been created or null
if
no TransformationFactory
instance could be found.public static Transformation getTransformation(String storeId, String id)
Transformation
with given id, or null
if it does not exist.
storeId
- identifier of the store, looking for the Transformation
, may be null
if in all
CRSStore
s should be searchedid
- of the Transformation
Transformation
or null if no such transformation is found.
public static Transformation getTransformation(String storeId, ICRS sourceCRS, ICRS targetCRS) throws IllegalArgumentException, TransformationException
Transformation
(chain) which transforms coordinates from the given source into the given
target crs. If no such Transformation
could be found or the implementation does not support inverse
lookup of transformations null will be returned.
- Parameters:
storeId
- identifier of the store, looking for the Transformation
, may be null
if in all
CRSStore
s should be searchedsourceCRS
- start ICRS
of the transformation (chain)targetCRS
- end ICRS
of the transformation (chain).
- Returns:
- the given
Transformation
or null if no such transformation was found.
- Throws:
TransformationException
IllegalArgumentException
public static Transformation getTransformation(String storeId, ICRS sourceCRS, ICRS targetCRS, List<Transformation> transformationsToBeUsed) throws IllegalArgumentException, TransformationException
Transformation
(chain) which transforms coordinates from the given source into the given
target crs. If no such Transformation
could be found or the implementation does not support inverse
lookup of transformations null will be returned.
- Parameters:
storeId
- identifier of the store, looking for the Transformation
, may be null
if in all
CRSStore
s should be searchedsourceCRS
- start ICRS
of the transformation (chain)targetCRS
- end ICRS
of the transformation (chain).transformationsToBeUsed
- a list of transformations which must be used on the resulting transformation chain, may be
null
or empty
- Returns:
- the given
Transformation
or null if no such transformation was found.
- Throws:
TransformationException
IllegalArgumentException
public ResourceState activate(String id)
ResourceManager
activate
in interface ResourceManager
id
- resource identifier, must not be null
null
public ResourceState deactivate(String id)
ResourceManager
deactivate
in interface ResourceManager
id
- resource identifier, must not be null
null
protected ResourceProvider getProvider(File file)
getProvider
in class AbstractBasicResourceManager
protected void remove(String id)
remove
in class AbstractBasicResourceManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |