static List<CrsInfo> generateCRSList() {
Hints hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, true);
Set<CRSAuthorityFactory> factories = ReferencingFactoryFinder.getCRSAuthorityFactories(hints);
final List<CRSAuthorityFactory> filtered = new ArrayList<CRSAuthorityFactory>();
for (final CRSAuthorityFactory factory : factories) {
if (Citations.identifierMatches(factory.getAuthority(), AUTHORITY)) {
filtered.add(factory);
}
}
CRSAuthorityFactory crsAuthorityFactory = FallbackAuthorityFactory.create(CRSAuthorityFactory.class, filtered);
Set<String> codes = new HashSet<String>();
List<CrsInfo> crsList = new ArrayList<CrsInfo>(1024);
retrieveCodes(codes, GeodeticCRS.class, crsAuthorityFactory);
retrieveCodes(codes, ProjectedCRS.class, crsAuthorityFactory);
for (String code : codes) {
final String authCode = String.format("%s:%s", AUTHORITY, code);
crsList.add(new CrsInfo(authCode, crsAuthorityFactory));
}
codes.clear();
AutoCRSFactory autoCRSFactory = new AutoCRSFactory();
retrieveCodes(codes, ProjectedCRS.class, autoCRSFactory);
for (String code : codes) {
final String authCode = String.format("AUTO:%s", code);
crsList.add(new AutoCrsInfo(authCode, autoCRSFactory));
}
Collections.sort(crsList);
return crsList;
}