Get the list of the codes that are supported by the given authority. For example
getSupportedCodes("EPSG") may returns
"EPSG:2000",
"EPSG:2001",
"EPSG:2002", etc. It may also returns
"2000",
"2001",
"2002", etc. without the
"EPSG:" prefix. Whatever the authority name is
prefixed or not is factory implementation dependent.
If there is more than one factory for the given authority, then this method merges the
code set of all of them. If a factory fails to provide a set of supported code, then this
particular factory is ignored. Please be aware of the following potential issues:
- If there is more than one EPSG databases (for example an
org.geotools.referencing.factory.epsg.AccessDataSource and a
org.geotools.referencing.factory.epsg.PostgreDataSource ones), then this
method will connect to all of them even if their content are identical.
- If two factories format their codes differently (e.g.
"4326" and
"EPSG:4326"), then the returned set will contain a lot of synonymous codes.
- For any code c in the returned set, there is no warranty that
#decode(c)
will use the same authority factory than the one
that formatted c.
- This method doesn't report connection problems since it doesn't throw any exception.
FactoryExceptions are logged as warnings and otherwise ignored.
If a more determinist behavior is wanted, consider the code below instead. The following
code exploit only one factory, the "preferred" one.
CRSAuthorityFactory factory = FactoryFinder.
ReferencingFactoryFinder#getCRSAuthorityFactory(authority, null);
Set<String> codes = factory.
CRSAuthorityFactory#getAuthorityCodes(CoordinateReferenceSystem.class);
String code = ...choose a code here...
CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem(code);