- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Charset c =
String charsetName;Charset.forName(charsetName)
Charset.defaultCharset()
ContentType contentType;contentType.getCharset()
- Smart code suggestions by Codota
}
@Test public void testCodeInList() { Set<String> supportedCodes = CRS.getSupportedCodes("EPSG"); assertTrue(supportedCodes.contains(CODE)); }
static List<SRS> buildCodeList() { long t = System.currentTimeMillis(); Set<String> codes = CRS.getSupportedCodes("EPSG"); try { codes.addAll(customFactory.getAuthorityCodes(CoordinateReferenceSystem.class)); } catch (FactoryException e) { LOGGER.log(Level.WARNING, "Error occurred while trying to gather custom CRS codes", e); } // make a set with each code Set<SRS> idSet = new HashSet<SRS>(); for (String code : codes) { // make sure we're using just the non prefix part String id = code.substring(code.indexOf(':') + 1); // avoid WGS84DD and eventual friends, as we're still not able to handle them, // if they are chosen exceptions arises everywhere if (NUMERIC.matcher(id).matches()) { idSet.add(new SRS(id)); } } List<SRS> srsList = new ArrayList<SRS>(idSet); Collections.sort(srsList, new CodeComparator()); // sort to get them in order return srsList; }
static List<SRS> buildCodeList() { // long t = System.currentTimeMillis(); Set<String> codes = CRS.getSupportedCodes("EPSG"); try { codes.addAll(customFactory.getAuthorityCodes(CoordinateReferenceSystem.class)); } catch (FactoryException e) { LOGGER.log(Level.WARNING, "Error occurred while trying to gather custom CRS codes", e); } // make a set with each code Set<SRS> idSet = new HashSet<SRS>(); for (String code : codes) { // make sure we're using just the non prefix part String id = code.substring(code.indexOf(':') + 1); // avoid WGS84DD and eventual friends, as we're still not able to handle them, // if they are chosen exceptions arises everywhere if (NUMERIC.matcher(id).matches()) { idSet.add(new SRS(id)); } } List<SRS> srsList = new ArrayList<SRS>(idSet); Collections.sort(srsList, new CodeComparator()); // sort to get them in order return srsList; }
comment("All supported EPSG projections:"); capabilitiesCrsIdentifiers = new LinkedHashSet<String>(); for (String code : CRS.getSupportedCodes("AUTO")) { if ("WGS84(DD)".equals(code)) continue; capabilitiesCrsIdentifiers.add("AUTO:" + code); capabilitiesCrsIdentifiers.addAll(CRS.getSupportedCodes("EPSG")); } else { comment("Limited list of EPSG projections:");
if(epsgCodes.isEmpty()){ comment("All supported EPSG projections:"); capabilitiesCrsIdentifiers = CRS.getSupportedCodes("EPSG"); }else{ comment("Limited list of EPSG projections:");
comment("All supported EPSG projections:"); capabilitiesCrsIdentifiers = new LinkedHashSet<String>(); for (String code : CRS.getSupportedCodes("AUTO")) { if ("WGS84(DD)".equals(code)) continue; capabilitiesCrsIdentifiers.add("AUTO:" + code); capabilitiesCrsIdentifiers.addAll(CRS.getSupportedCodes("EPSG")); } else { comment("Limited list of EPSG projections:");
@Test public void testCRSList() throws Exception { GetCapabilitiesTransformer tr; tr = new GetCapabilitiesTransformer(wmsConfig, baseUrl, mapFormats, legendFormats, null); tr.setIndentation(2); Document dom = WMSTestSupport.transform(req, tr); final Set<String> supportedCodes = CRS.getSupportedCodes("EPSG"); supportedCodes.addAll(CRS.getSupportedCodes("AUTO")); NodeList allCrsCodes = XPATH.getMatchingNodes("/WMT_MS_Capabilities/Capability/Layer/SRS", dom); assertEquals(supportedCodes.size() - 1 /* WGS84(DD) */, allCrsCodes.getLength()); }
codes = CRS.getSupportedCodes("EPSG"); } else { codes = wcs.getSRS();