Codota Logo
CRS.getSupportedCodes
Code IndexAdd Codota to your IDE (free)

How to use
getSupportedCodes
method
in
org.geotools.referencing.CRS

Best Java code snippets using org.geotools.referencing.CRS.getSupportedCodes (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: geotools/geotools

@Test
public void testCodeInList() {
  Set<String> supportedCodes = CRS.getSupportedCodes("EPSG");
  assertTrue(supportedCodes.contains(CODE));
}
origin: org.geoserver.web/web-core

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;
}
origin: org.geoserver.web/gs-web-core

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;
}
origin: org.geoserver/gs-wms

  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:");
origin: org.geoserver/wms

if(epsgCodes.isEmpty()){
  comment("All supported EPSG projections:");
  capabilitiesCrsIdentifiers = CRS.getSupportedCodes("EPSG");
}else{
  comment("Limited list of EPSG projections:");
origin: org.geoserver/gs-wms

  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:");
origin: org.geoserver/gs-wms

@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());
}
origin: org.geoserver/gs-wcs2_0

  codes = CRS.getSupportedCodes("EPSG");
} else {
  codes = wcs.getSRS();
org.geotools.referencingCRSgetSupportedCodes

Javadoc

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);

Popular methods of CRS

  • decode
  • findMathTransform
  • equalsIgnoreMetadata
  • parseWKT
  • lookupEpsgCode
  • transform
    Implementation of #transform(MathTransform,Envelope) with the opportunity to save the projected cent
  • getAxisOrder
  • lookupIdentifier
  • toSRS
  • getHorizontalCRS
  • getEnvelope
  • getCoordinateOperationFactory
  • getEnvelope,
  • getCoordinateOperationFactory,
  • getAuthorityFactory,
  • getMapProjection,
  • getGeographicBoundingBox,
  • reset,
  • getEllipsoid,
  • getProjectedCRS,
  • getTemporalCRS

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now