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; }
private List<CRSCodeType[]> getAllCRSCodeTypes() { List<CRSCodeType[]> crss = new ArrayList<CRSCodeType[]>(); Collection<CRSStore> all = CRSManager.getAll(); for ( CRSStore crsStore : all ) { crss.addAll( crsStore.getAvailableCRSCodes() ); } return crss; }
/** * The default coordinate transformation factory. Will be constructed only when first needed. * * @param provider * used to do lookups of transformations */ public TransformationFactory( CRSStore provider ) { this.provider = provider; this.preferredDSTransform = provider.getPreferedTransformationType(); }
/** * Get a {@link Transformation} with given id, or <code>null</code> if it does not exist. * * @param crsStore * {@link CRSStore} instance, looking for the {@link Transformation}, may not be <code>null</code> * @param id * of the {@link Transformation} * @return the identified {@link Transformation} or <code>null<code> if no transformation is found. * @throws IllegalArgumentException * if crsStore is null */ private synchronized static Transformation getTransformation( CRSStore crsStore, String id ) { if ( crsStore == null ) { throw new IllegalArgumentException( Messages.get( "CRSManager.STORE_NULL" ) ); } CRSResource t = null; try { t = crsStore.getDirectTransformation( id ); } catch ( Throwable e ) { LOG.debug( "Could not retrieve a transformation for id: " + id ); } if ( t != null ) { return (Transformation) t; } LOG.debug( "The given id: " + id + " is not of type transformation return null." ); return null; }
try { sT = currentTimeMillis(); realCRS = crsStore.getCRSByCode( CRSCodeType.valueOf( name ), forceXY ); if ( realCRS == null ) { realCRS = crsStore.getCRSByCode( CRSCodeType.valueOf( name.toLowerCase() ), forceXY );
private static void registerAndInit( CRSStore crss, String id, boolean prefer ) throws CRSStoreException { if ( id != null ) { if ( idToCRSStore.containsKey( id ) ) { throw new CRSStoreException( Messages.getMessage( "CRSManager.DUPLICATE_ID", id ) ); } LOG.info( "Registering global crs store with id '" + id + "', type: '" + crss.getClass().getName() + "'" ); idToTransF.put( id, new TransformationFactory( crss ) ); idToCRSStore.put( id, crss ); if ( prefer ) { storeIds.add( 0, id ); } else { storeIds.add( id ); } crss.init(); } }
Transformation result = provider.getDirectTransformation( sourceCRS, targetCRS ); if ( result != null ) { String implName = result.getImplementationName();
realCRS = crsStore.getCRSByCode( crsCodeType ); } catch ( CRSConfigurationException e ) { LOG.error( e.getMessage(), e );
/** * 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; }
/** * This methods allows to get all available identifiers and not in the coordinatesystems themselves from all stores. * * @return the identifiers of 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<CRSCodeType[]> getAvailableCRSCodes() throws CRSConfigurationException { List<CRSCodeType[]> result = new ArrayList<CRSCodeType[]>(); for ( CRSStore store : getAll() ) { result.addAll( store.getAvailableCRSCodes() ); } 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 ) {