static public FeatureDataset wrap ( FeatureType wantFeatureType , NetcdfDataset ncd , ucar . nc2 . util . CancelTask task , Formatter errlog ) throws IOException { if ( debug ) System . out . println ( "wrap " + ncd . getLocation ( ) + " want = " + wantFeatureType ) ; // the case where we dont know what type it is if ( ( wantFeatureType == null ) || ( wantFeatureType == FeatureType . ANY ) ) { return wrapUnknown ( ncd , task , errlog ) ; } // find a Factory that claims this dataset by passing back an "analysis result" object Object analysis = null ; FeatureDatasetFactory useFactory = null ; for ( Factory fac : factoryList ) { if ( ! featureTypeOk ( wantFeatureType , fac . featureType ) ) continue ; if ( debug ) System . out . println ( " wrap try factory " + fac . factory . getClass ( ) . getName ( ) ) ; analysis = fac . factory . isMine ( wantFeatureType , ncd , errlog ) ; if ( analysis != null ) { useFactory = fac . factory ; break ; } } if ( null == useFactory ) { errlog . format ( "**Failed to find FeatureDatasetFactory for= %s datatype=%s%n" , ncd . getLocation ( ) , wantFeatureType ) ; return null ; } // this call must be thread safe - done by implementation return useFactory . open ( wantFeatureType , ncd , analysis , task , errlog ) ; }
Wrap a NetcdfDataset as a FeatureDataset .