Package thredds.catalog

Examples of thredds.catalog.InvDataset


   * @param access open Invdataset from this access.
   * @throws IOException
   */
  public AddeStationObsDataset(InvAccess access, ucar.nc2.util.CancelTask cancelTask) throws IOException {
    super();
    InvDataset invDs = access.getDataset();
    this.location = (invDs.getID() != null) ? "thredds:"+access.getDataset().getCatalogUrl() :
                                              access.getStandardUrlName();

    addeURL = access.getStandardUrlName();

    // see if we have a stationDB file
    InvDataset invds = access.getDataset();
    String pv = invds.findProperty( "_StationDBlocation");
    if (pv != null) {
      stationDBlocation = InvDatasetImpl.resolve( invds, pv);
    }

    init();

    // Get the bounding box if possible
    ThreddsMetadata.GeospatialCoverage geoCoverage = invds.getGeospatialCoverage();
    if (null != geoCoverage)
      boundingBox = geoCoverage.getBoundingBox();
    else // otherwise, stationHelper constructs from the station locations
      boundingBox = stationHelper.getBoundingBox();

    // get the date range if possible
    DateRange timeCoverage = invds.getTimeCoverage();
    if (timeCoverage != null) {
      startDate = timeCoverage.getStart().getDate();
      endDate = timeCoverage.getEnd().getDate();
    } else {
      startDate = new Date(0); // fake
View Full Code Here


//    }
//    catch ( IOException e )
//    {
//      throw new IllegalArgumentException( "Given directory is not a collection dataset <" + directory.getAbsolutePath() + ">: " + e.getMessage() );
//    }
    InvDataset topDs = catalog.getDataset();
    if ( collectionCrDs.getPath().equals( catalogCrDs.getPath() ) && this.serviceTitle != null )
    //if ( topDs.getName().equals( "" ) && this.serviceTitle != null )
    {
      logger.warn( "getDirCatalog(): top dataset name is null, setting to serviceTitle <" + this.serviceTitle + ">");
      ( (InvDatasetImpl) topDs ).setName( this.serviceTitle );
View Full Code Here

      this.baseId = baseId;
    }

    public boolean addMetadata( InvDataset dataset )
    {
      InvDataset parentDs = dataset.getParent();
      String curId = ( parentDs == null) ? this.baseId : parentDs.getID();
      if ( curId == null) curId = this.baseId;
      if ( dataset.getName() != null && ! dataset.getName().equals( "") )
        curId += "/" + dataset.getName();

      ( (InvDatasetImpl) dataset).setID( curId );
View Full Code Here

        leaves.add(dds);
    }

    if (leaves.size() > 0) {
      if (type == USE_FIRST_DIRECT) {
        InvDataset dds = (InvDataset) leaves.get(0);
        listen.getDataset(dds, context);

      } else if (type == USE_RANDOM_DIRECT) {
        listen.getDataset(chooseRandom(leaves), context);

      } else if (type == USE_RANDOM_DIRECT_NOT_FIRST_OR_LAST) {
        listen.getDataset(chooseRandomNotFirstOrLast(leaves), context);

      } else { // do all of them
        for (InvDataset dds : leaves) {
          listen.getDataset(dds, context);
          if ((task != null) && task.isCancel()) break;
        }
      }
    }

    // recurse
    if (!skipScanChildren) {
      for (InvDataset dds : dlist) {
        if (dds.hasNestedDatasets())
          crawlDirectDatasets(dds, task, out, context, release);
        if ((task != null) && task.isCancel())
          break;
      }
    }
View Full Code Here

    this.increasingOrder = increasingOrder;
    this.invDatasetComparator = new java.util.Comparator()
    {
      public int compare( Object obj1, Object obj2 )
      {
        InvDataset ds1 = (InvDataset) obj1;
        InvDataset ds2 = (InvDataset) obj2;

        int compareVal = ds1.getName().compareTo( ds2.getName() );

        return ( DatasetSorter.this.increasingOrder ? compareVal : -compareVal );
      }
    };
  }
View Full Code Here

  }

  public void sortNestedDatasets( InvDataset collectionDs )
  {
    // Sort grand children datasets.
    InvDataset curDs = null;
    for ( java.util.Iterator dsIter = collectionDs.getDatasets().iterator(); dsIter.hasNext(); )
    {
      curDs = (InvDataset) dsIter.next();
      // Do not dereference catalogRef or datasetScan.
      if ( ! curDs.getClass().equals( InvCatalogRef.class )
           && ! curDs.getClass().equals( InvDatasetScan.class))
      // @todo Move this test into abstract InvDataset.remoteDataset()??
      {
        this.sortDatasets( curDs);
      }
    }
View Full Code Here

TOP

Related Classes of thredds.catalog.InvDataset

Copyright © 2018 www.massapicom. 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.