Examples of ThreddsDataFactory


Examples of ucar.nc2.thredds.ThreddsDataFactory

      return acquireRemote(cache, factory, hashKey, location, buffer_size, cancelTask, spiObject)// open through ncstream

      // thredds:
    } else if (location.startsWith(ThreddsDataFactory.SCHEME)) {
      Formatter log = new Formatter();
      ThreddsDataFactory tdf = new ThreddsDataFactory();
      NetcdfFile ncfile = tdf.openDataset(location, false, cancelTask, log); // LOOK acquire ??
      if (ncfile == null)
        throw new IOException(log.toString());
      return ncfile;

    } else if (location.endsWith(".xml") || location.endsWith(".ncml")) { //open as a NetcdfDataset through NcML
View Full Code Here

Examples of ucar.nc2.thredds.ThreddsDataFactory

  @Override
  public void getDataset(InvDataset ds, Object context) {

    if (ds.hasAccess()) {
      ThreddsDataFactory tdataFactory = new ThreddsDataFactory();
      InvAccess access = tdataFactory.chooseDatasetAccess(ds.getAccess());
      MFileRemote mfile = new MFileRemote(access);
      if (mfile.getPath().endsWith(".xml")) return; // eliminate latest.xml  LOOK kludge-o-rama
      java.util.Map<String, MFile> map = (java.util.Map<String, MFile>) context;
      map.put(mfile.getPath(), mfile);
      if (debug) System.out.format("add %s %n", mfile.getPath());
View Full Code Here

Examples of ucar.nc2.thredds.ThreddsDataFactory

   * @throws java.io.IOException on io error
   */
  static public FeatureDataset open(FeatureType wantFeatureType, String location, ucar.nc2.util.CancelTask task, Formatter errlog) throws IOException {
    // special processing for thredds: datasets
    if (location.startsWith(ThreddsDataFactory.SCHEME)) {
      ThreddsDataFactory.Result result = new ThreddsDataFactory().openFeatureDataset(wantFeatureType, location, task);
      errlog.format("%s", result.errLog);
      if (!featureTypeOk(wantFeatureType, result.featureType)) {
        errlog.format("wanted %s but dataset is of type %s%n", wantFeatureType, result.featureType);
        return null;
      }
View Full Code Here

Examples of ucar.nc2.thredds.ThreddsDataFactory

  }

  public void utestMetarDataset() throws IOException {
    long start = System.currentTimeMillis();

    ThreddsDataFactory fac = new ThreddsDataFactory();
    ThreddsDataFactory.Result result = fac.openFeatureDataset( "thredds:resolve:http://motherlode.ucar.edu:9080/thredds/idd/metar?returns=DQC", null);
    if ( result.fatalError )
    {
      System.out.println( "TestStationDataset.testMetarDataset():\n" + result.errLog.toString() );
      assert false;
    }
View Full Code Here

Examples of ucar.nc2.thredds.ThreddsDataFactory

  }

  public void testDODS() throws Exception {
    String ds = "http://motherlode.ucar.edu:8080/thredds/catalog/fmrc/NCEP/DGEX/CONUS_12km/files/latest.xml";
    //String dsid = "#NCEP/DGEX/CONUS_12km/latest.xml";
    ThreddsDataFactory.Result result = new ThreddsDataFactory().openFeatureDataset("thredds:resolve:" + ds, null);
    System.out.println("result errlog= " + result.errLog);
    assert !result.fatalError;
    assert result.featureType == FeatureType.GRID;
    assert result.featureDataset != null;
View Full Code Here

Examples of ucar.nc2.thredds.ThreddsDataFactory

    dataset.close();
  }

  public void utestDODS2() throws Exception {
    String threddsURL = "http://lead.unidata.ucar.edu:8080/thredds/dqcServlet/latestOUADAS?adas";
    ThreddsDataFactory.Result result = new ThreddsDataFactory().openFeatureDataset(threddsURL, null);
    assert result.featureDataset != null;
    GridDataset dataset = (GridDataset) result.featureDataset;

    GeoGrid grid = dataset.findGridByName("PT");
    assert null != grid;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.