private List<ICRS> getAllCoordinateSystems() { List<ICRS> crss = new ArrayList<ICRS>(); Collection<CRSStore> all = CRSManager.getAll(); for ( CRSStore crsStore : all ) { crss.addAll( crsStore.getAvailableCRSs() ); } return crss; }
/** * This method allows to get all {@link ICRS} from all stores. * * @return all configured CRSs. * @throws CRSConfigurationException * if the implementation was confronted by an exception and could not deliver the requested crs. This * exception should not be thrown if no CoordinateSystems were found, in the latter case an empty List ( * a list with size == 0 ) should be returned. */ public List<ICRS> getAvailableCRSs() throws CRSConfigurationException { List<ICRS> result = new ArrayList<ICRS>(); for ( CRSStore store : getAll() ) { result.addAll( store.getAvailableCRSs() ); } return result; }
public static void listCrs( HttpServletResponse resp ) throws IOException { resp.setContentType( "text/plain" ); List<ICRS> crss = new ArrayList<ICRS>(); Collection<CRSStore> all = CRSManager.getAll(); for ( CRSStore crsStore : all ) { crss.addAll( crsStore.getAvailableCRSs() ); } List<String> codes = new ArrayList<String>( crss.size() ); ServletOutputStream out = resp.getOutputStream(); for ( ICRS crs : crss ) { for ( CRSCodeType code : crs.getCodes() ) { String s = code.toString().toUpperCase(); if ( CODE.matcher( s ).matches() ) { if ( !codes.contains( s ) ) { codes.add( s ); } } } } Collections.sort( codes ); for ( String code : codes ) { IOUtils.write( code + "\n", out ); } }
public static void getCodes( HttpServletRequest req, HttpServletResponse resp ) throws IOException { ServletOutputStream out = resp.getOutputStream(); String s = req.getParameter( "wkt" ); s = URLDecoder.decode( s, "UTF-8" ); ICRS crs = WKTParser.parse( s ); Collection<CRSStore> all = CRSManager.getAll(); for ( CRSStore crsStore : all ) { for ( ICRS c : crsStore.getAvailableCRSs() ) { if ( c.equals( crs ) ) { for ( CRSCodeType ct : c.getCodes() ) { IOUtils.write( ct.toString(), out ); } } } } }
List<ICRS> allSystems = in.getAvailableCRSs(); StringBuilder sb = new StringBuilder( allSystems.size() * 2000 ); if ( exporter != null ) {