コード例 #1
0
ファイル: WebCRSFactory.java プロジェクト: ravila/TCC_Library
 /**
  * Provides a complete set of the known codes provided by this authority. The returned set
  * contains only numeric identifiers like {@code "84"}, {@code "27"}, <cite>etc</cite>. The
  * authority name ({@code "CRS"}) is not included. This is consistent with the {@linkplain
  * org.geotools.referencing.factory.epsg.DirectEpsgFactory#getAuthorityCodes codes returned by the
  * EPSG factory} and avoid duplication, since the authority is the same for every codes returned
  * by this factory. It also make it easier for clients to prepend whatever authority name they
  * wish, as for example in the {@linkplain
  * org.geotools.referencing.factory.AllAuthoritiesFactory#getAuthorityCodes all authorities
  * factory}.
  */
 public Set getAuthorityCodes(final Class type) throws FactoryException {
   ensureInitialized();
   final Set set = new LinkedHashSet();
   for (final Iterator it = crsMap.entrySet().iterator(); it.hasNext(); ) {
     final Map.Entry entry = (Map.Entry) it.next();
     final CoordinateReferenceSystem crs = (CoordinateReferenceSystem) entry.getValue();
     if (type.isAssignableFrom(crs.getClass())) {
       final Integer code = (Integer) entry.getKey();
       set.add(String.valueOf(code));
     }
   }
   return set;
 }