public InternationalString getDescriptionText(String code) throws FactoryException { return crsAuthority.getDescriptionText(code); }
/** * Constructor. Populates the model with available reference systems for the specified * authority. If {@code authority} is {@code null} or empty, it defaults to {@link * JCRSChooser#DEFAULT_AUTHORITY}. * * @param authority the authority name * @param showDefaults show GeoTools default reference systems */ public CRSListModel(String authority) { try { CRSAuthorityFactory fac = ReferencingFactoryFinder.getCRSAuthorityFactory(authority, null); Set<String> codes = fac.getAuthorityCodes(CoordinateReferenceSystem.class); if (authority == null || authority.trim().length() == 0) { authority = JCRSChooser.DEFAULT_AUTHORITY; } for (String code : codes) { code = code.trim(); String desc = fac.getDescriptionText(authority + ":" + code).toString(); allItems.add(new Item(code, desc)); } filterItems.addAll(allItems); } catch (Exception ex) { throw new RuntimeException(ex); } }
@Override public String toString() { String crsDescription = crsCode + " - "; try { crsDescription += factory.getDescriptionText(crsCode).toString(); } catch (Exception e) { crsDescription += e.getLocalizedMessage(); } return crsDescription; }
@Override public String toString() { String crsDescription = super.crsCode + " - "; try { String code = super.crsCode + ",0,0"; crsDescription += super.factory.getDescriptionText(code).toString(); } catch (Exception e) { crsDescription += e.getLocalizedMessage(); } return crsDescription; }
@Override public String toString() { String crsDescription = crsCode + " - "; try { crsDescription += factory.getDescriptionText(crsCode).toString(); } catch (Exception e) { crsDescription += e.getLocalizedMessage(); } return crsDescription; }
@Override public String toString() { String crsDescription = super.crsCode + " - "; try { String code = super.crsCode + ",0,0"; crsDescription += super.factory.getDescriptionText(code).toString(); } catch (Exception e) { crsDescription += e.getLocalizedMessage(); } return crsDescription; }
@Override public InternationalString getDescriptionText(String code) throws FactoryException { return factory().getDescriptionText(code); }
@Override public InternationalString getDescriptionText(String code) throws FactoryException { return factory().getDescriptionText(code); }
public String getDescription() { // lazy loading of description if (description == null) { // grab the description String desc = "-"; try { // REVISIT: as far as I know the EPSG names are not localized? anyway, if // they're revisit to use the page locale // description = CRS.getAuthorityFactory(true).getDescriptionText("EPSG:" + // code) // .toString(getLocale()).toUpperCase(); desc = CRS.getAuthorityFactory(true).getDescriptionText("EPSG:" + code) .toString(); } catch (Exception e) { // no problem } description = desc; } return description; }
/** * Constructor. Populates the model with available reference systems * for the specified authority. If {@code authority} is {@code null} * or empty, it defaults to {@link JCRSChooser#DEFAULT_AUTHORITY}. * * @param authority the authority name * @param showDefaults show GeoTools default reference systems */ public CRSListModel(String authority) { try { CRSAuthorityFactory fac = ReferencingFactoryFinder.getCRSAuthorityFactory(authority, null); Set<String> codes = fac.getAuthorityCodes(CoordinateReferenceSystem.class); if (authority == null || authority.trim().length() == 0) { authority = JCRSChooser.DEFAULT_AUTHORITY; } for (String code : codes) { code = code.trim(); String desc = fac.getDescriptionText(authority + ":" + code).toString(); allItems.add(new Item(code, desc)); } filterItems.addAll(allItems); } catch (Exception ex) { throw new RuntimeException(ex); } }
public String getDescription() { // lazy loading of description if (description == null) { // grab the description String desc = "-"; try { // REVISIT: as far as I know the EPSG names are not localized? anyway, if // they're revisit to use the page locale // description = CRS.getAuthorityFactory(true).getDescriptionText("EPSG:" + // code) // .toString(getLocale()).toUpperCase(); desc = CRS.getAuthorityFactory(true) .getDescriptionText("EPSG:" + code) .toString(); } catch (Exception e) { // no problem } description = desc; } return description; }
String description; try { description = factory.getDescriptionText(code).toString(); } catch (Exception e1) { description = "Unnamed";
/** * Tests {@link CRSAuthorityFactory#getDescriptionText(String)}. * * @throws FactoryException if the EPSG:4326 name can not be obtained. * * @since 0.8 */ @Test public void testGetDescriptionText() throws FactoryException { final CRSAuthorityFactory factory = AuthorityFactories.ALL; assertEquals("WGS 84", factory.getDescriptionText("EPSG:4326").toString()); assertEquals("WGS 84", factory.getDescriptionText("urn:ogc:def:crs:epsg::4326").toString()); }
String name = ""; try { name = CRS.getAuthorityFactory(true).getDescriptionText(code).toString(getLocale()); } catch (Exception e) {