Package org.springframework.data.redis.connection

Examples of org.springframework.data.redis.connection.SortParameters$Range


    boolean tRangeDone = false;

    try
    {
      // Get the height range.
      Range zRange = vertSubset != null ? vertSubset.getRange() : null;
      zRangeDone = true;

      // Get the time range.
      Range tRange = null;
      if ( timeRange != null )
      {
        CoordinateAxis1DTime timeAxis = this.coordSys.getTimeAxis1D();
        int startIndex = timeAxis.findTimeIndexFromDate( timeRange.getStart().getDate() );
        int endIndex = timeAxis.findTimeIndexFromDate( timeRange.getEnd().getDate() );
        tRange = new Range( startIndex, endIndex );
        tRangeDone = true;
      }

      if ( format == WcsRequest.Format.GeoTIFF || format == WcsRequest.Format.GeoTIFF_Float )
      {
View Full Code Here


      GridDatatype grid = gds.findGridDatatype(gridName);
      GridCoordSystem gcsOrg = grid.getCoordinateSystem();
      CoordinateAxis1DTime timeAxis = gcsOrg.getTimeAxis1D();

      // make subset if needed
      Range timeRange = null;
      if ((dateRange != null) && (timeAxis != null)) {
        int startIndex = timeAxis.findTimeIndexFromDate(dateRange.getStart().getDate());
        int endIndex = timeAxis.findTimeIndexFromDate(dateRange.getEnd().getDate());
        if (startIndex < 0)
          throw new InvalidRangeException("start time=" + dateRange.getStart().getDate() + " must be >= " + timeAxis.getTimeDate(0));
        if (endIndex < 0)
          throw new InvalidRangeException("end time=" + dateRange.getEnd().getDate() + " must be >= " + timeAxis.getTimeDate(0));
        timeRange = new Range(startIndex, endIndex);
      }

      if ((null != timeRange) || (zRange != null) || (llbb != null) || (horizStride > 1)) {
        grid = grid.makeSubset(timeRange, zRange, llbb, 1, horizStride, horizStride);
      }
View Full Code Here

    GridDataset gridDataset = GridDataset.open( "D:/AStest/margolis/grib2ncdf.ncml" );
    GeoGrid grid = gridDataset.findGridByName( "Turbulence_SIGMET_AIRMET" );
    System.out.println("Grid= "+grid+" section="+ new Section(grid.getShape()));
    System.out.println(" coordSys= "+grid.getCoordinateSystem());

    GeoGrid subset = (GeoGrid) grid.makeSubset(new Range(0, 0), null, new Range(1,1), null, null, null);
    System.out.println("subset= "+subset+" section="+ new Section(subset.getShape()));
    System.out.println(" coordSys= "+subset.getCoordinateSystem());

    gridDataset.close();
  }
View Full Code Here

      log.error( "getRange(): GridCoordSystem vertical axis does not contain min/max points." );
      throw new IllegalArgumentException( "GridCoordSystem vertical axis does not contain min/max points." );
    }

    if ( this.coordAxis.getPositive().equalsIgnoreCase( ucar.nc2.constants.CF.POSITIVE_DOWN ) )
      return new Range( maxIndex, minIndex, stride );
    else
      return new Range( minIndex, maxIndex, stride );
  }
View Full Code Here

      log.error( "genRequestVertSubset(): " + message + " - " + e.getMessage() );
      throw new WcsException( WcsException.Code.InvalidParameterValue, "BBOX", message );
    }

    AxisSubset axisSubset = new AxisSubset( vertAxis, minz, maxz, 1 );
    Range range = null;
    try
    {
      range = axisSubset.getRange();
    }
    catch ( InvalidRangeException e )
    {
      String message = "BBOX results in invalid array index range [" + bboxSplit.toString() + "].";
      log.error( "genRequestVertSubset(): " + message + " - " + e.getMessage() );
      throw new WcsException( WcsException.Code.InvalidParameterValue, "BBOX", message );
    }
    if ( range.length() == 1 )
    {
      // Check whether vertical range results in a single level.
      this.isSingleVerticalRequest = true;
      return null;
    }
View Full Code Here

    sb.append(v.isMemberOfStructure() ? NetcdfFile.escapeNameSectionSpec(v.getShortName()) : NetcdfFile.makeFullNameEscapedSectionSpec(v));

    if (!v.isVariableLength() && !v.isScalar()) { // sequences cant be sectioned
      sb.append('(');
      for (int count=0; count<v.getRank(); count++) {
        Range r = ranges.get(count);
        if (r == null)
          r = new Range( 0, v.getDimension(count).getLength());
        if (count>0) sb.append(", ");
        sb.append(r.first());
        sb.append(':');
        sb.append(r.last());
        sb.append(':');
        sb.append(r.stride());
      }
      sb.append(')');
    }

    return (orgRanges == null) ? null : ranges.subList(v.getRank(), ranges.size());
View Full Code Here

    long startDate, endDate;
    // Read all data in variable oriented manner.
    TrajectoryObsDatatype trajDt = me.getTrajectory( "1Hz data" );

    Range range = trajDt.getFullRange();
    startDate = System.currentTimeMillis();
    for ( Iterator it = trajDt.getDataVariables().iterator(); it.hasNext(); )
    {
      VariableSimpleIF var = (VariableSimpleIF) it.next();
      Array a = trajDt.getData( range, var.getShortName() );
View Full Code Here

      if ( minIndex == -1 || maxIndex == -1 )
        return null;

      try
      {
        return new Range( minIndex, maxIndex);
      }
      catch ( InvalidRangeException e )
      {
        return null;
      }
View Full Code Here

  public File writeCoverageDataToFile( Request.Format format, LatLonRect bboxLatLonRect, VerticalRange verticalRange, DateRange timeRange)
          throws WcsException
  {
    // Get the height range.
    Range zRange = null;
    try
    {
      zRange = verticalRange != null ? verticalRange.getRange( this.coordSys ) : null;
    }
    catch ( InvalidRangeException e )
    {
      log.error( "writeCoverageDataToFile(): Failed to subset coverage <" + this.coverage.getFullName() + "> along vertical range <" + verticalRange + ">: " + e.getMessage() );
      throw new WcsException( WcsException.Code.CoverageNotDefined, "Vertical", "Failed to subset coverage [" + this.coverage.getFullName() + "] along vertical range." );
    }

    // Get the time range.
    Range tRange = null;
    if ( timeRange != null )
    {
      CoordinateAxis1DTime timeAxis = this.coordSys.getTimeAxis1D();
      DateType requestStartTime = timeRange.getStart();
      DateType requestEndTime = timeRange.getEnd();
      int startIndex = timeAxis.findTimeIndexFromDate( requestStartTime.getDate() );
      int endIndex = timeAxis.findTimeIndexFromDate( requestEndTime.getDate() );
      if ( startIndex < 0 || startIndex > timeAxis.getSize() -1
           || endIndex < 0 || endIndex > timeAxis.getSize() - 1 )
      {
        String availStart = timeAxis.getDateRange().getStart().toDateTimeStringISO();
        String availEnd = timeAxis.getDateRange().getEnd().toDateTimeStringISO();
        String msg = "Requested temporal range [" + requestStartTime.toDateTimeStringISO()
                     + " - " + requestEndTime.toDateTimeStringISO()
                     + "] not in available range [" + availStart + " - " + availEnd + "].";
        log.debug( "writeCoverageDataToFile(): " + msg );
        throw new WcsException( WcsException.Code.CoverageNotDefined, "Time", msg );
      }
      try
      {
        tRange = new Range( startIndex, endIndex );
      }
      catch ( InvalidRangeException e )
      {
        log.error( "writeCoverageDataToFile(): Failed to subset coverage [" + this.coverage.getFullName() + "] along time axis [" + timeRange + "]: " + e.getMessage() );
        throw new WcsException( WcsException.Code.CoverageNotDefined, "Time", "Failed to subset coverage [" + this.coverage.getFullName() + "] along time axis [" + timeRange + "]." );
View Full Code Here

        log.error( "getRange(): GridCoordSystem vertical axis does not contain min/max points." );
        throw new IllegalArgumentException( "GridCoordSystem vertical axis does not contain min/max points." );
      }

      if ( vertAxis.getPositive().equalsIgnoreCase( ucar.nc2.constants.CF.POSITIVE_DOWN ) )
        return new Range( maxIndex, minIndex, stride );
      else
        return new Range( minIndex, maxIndex, stride );
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.redis.connection.SortParameters$Range

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.