@Test public void prismRawDimensionNameTest() { String timeRangeString = "[0:1:1417]"; String xRangeString = "[382:1:552]"; String yRangeString = "[213:1:312]"; Map<String, String> dimensionRawMapping = OPeNDAPUtils.getDimensionRawNameRangeMapping(prismGridDataSet.getNetcdfFile().getVariables(), xRangeString, yRangeString, timeRangeString); assertNotNull(dimensionRawMapping); assertThat(dimensionRawMapping.size(), is(equalTo(3))); assertTrue(dimensionRawMapping.containsKey("time")); assertTrue(dimensionRawMapping.get("time").equals(timeRangeString)); assertTrue(dimensionRawMapping.containsKey("lat")); assertTrue(dimensionRawMapping.get("lat").equals(yRangeString)); assertTrue(dimensionRawMapping.containsKey("lon")); assertTrue(dimensionRawMapping.get("lon").equals(xRangeString)); }
public static Map<String, String> getDimensionRawNameRangeMapping(List<?> gridVariableList, String xRangeString, String yRangeString, String timeRangeString) { Map<String, String> results = new HashMap<String, String>(); for (int i = 0; i < gridVariableList.size(); i++) { Object variable = gridVariableList.get(i); if (variable instanceof CoordinateAxis1D) { switch (((CoordinateAxis1D) variable).getAxisType()) { case GeoX: case Lon: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), xRangeString); } break; } case GeoY: case Lat: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), yRangeString); } break; } case Time: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), timeRangeString); } break; } default: { } } } } return results; }
OPeNDAPUtils { public static Map<String, String> getDimensionRawNameRangeMapping(List<?> gridVariableList, String xRangeString, String yRangeString, String timeRangeString) { Map<String, String> results = new HashMap<String, String>(); for (int i = 0; i < gridVariableList.size(); i++) { Object variable = gridVariableList.get(i); if (variable instanceof CoordinateAxis1D) { switch (((CoordinateAxis1D) variable).getAxisType()) { case GeoX: case Lon: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), xRangeString); } break; } case GeoY: case Lat: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), yRangeString); } break; } case Time: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), timeRangeString); } break; } default: { } } } } return results; } }
OPeNDAPUtils { public static Map<String, String> getDimensionRawNameRangeMapping(List<?> gridVariableList, String xRangeString, String yRangeString, String timeRangeString) { Map<String, String> results = new HashMap<String, String>(); for (int i = 0; i < gridVariableList.size(); i++) { Object variable = gridVariableList.get(i); if (variable instanceof CoordinateAxis1D) { switch (((CoordinateAxis1D) variable).getAxisType()) { case GeoX: case Lon: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), xRangeString); } break; } case GeoY: case Lat: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), yRangeString); } break; } case Time: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), timeRangeString); } break; } default: { } } } } return results; }  }
OPeNDAPUtils { public static Map<String, String> getDimensionRawNameRangeMapping(List<?> gridVariableList, String xRangeString, String yRangeString, String timeRangeString) { Map<String, String> results = new HashMap<String, String>(); for (int i = 0; i < gridVariableList.size(); i++) { Object variable = gridVariableList.get(i); if (variable instanceof CoordinateAxis1D) { switch (((CoordinateAxis1D) variable).getAxisType()) { case GeoX: case Lon: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), xRangeString); } break; } case GeoY: case Lat: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), yRangeString); } break; } case Time: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), timeRangeString); } break; } default: { } } } } return results; }  static String generateOpenDapURL(String datasetURI, List<String> requestedVariableList,
            List<?> gridVariableList, Range timeRange, Range yRange, Range xRange); static String generateOpenDapURL(String datasetURI, List<String> requestedVariableList,
            List<?> gridVariableList, Range timeRange, Range yRange, Range xRange,
            OPeNDAPContentType contentType); static Map<String, String> getDimensionRawNameRangeMapping(List<?> gridVariableList,
            String xRangeString, String yRangeString, String timeRangeString); static Map<String, String> getDimensionVariableNameRangeMapping(
            List<?> gridVariableList, String xRangeString, String yRangeString,
            String timeRangeString); static boolean isOPeNDAP(URI uri); }
OPeNDAPUtils { public static Map<String, String> getDimensionRawNameRangeMapping(List<?> gridVariableList, String xRangeString, String yRangeString, String timeRangeString) { Map<String, String> results = new HashMap<String, String>(); for (int i = 0; i < gridVariableList.size(); i++) { Object variable = gridVariableList.get(i); if (variable instanceof CoordinateAxis1D) { switch (((CoordinateAxis1D) variable).getAxisType()) { case GeoX: case Lon: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), xRangeString); } break; } case GeoY: case Lat: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), yRangeString); } break; } case Time: { if (((CoordinateAxis1D) variable).getDimensions().size() == 1) { Dimension dimension = ((CoordinateAxis1D) variable).getDimensions().get(0); results.put(dimension.getShortName(), timeRangeString); } break; } default: { } } } } return results; }  static String generateOpenDapURL(String datasetURI, List<String> requestedVariableList,
            List<?> gridVariableList, Range timeRange, Range yRange, Range xRange); static String generateOpenDapURL(String datasetURI, List<String> requestedVariableList,
            List<?> gridVariableList, Range timeRange, Range yRange, Range xRange,
            OPeNDAPContentType contentType); static Map<String, String> getDimensionRawNameRangeMapping(List<?> gridVariableList,
            String xRangeString, String yRangeString, String timeRangeString); static Map<String, String> getDimensionVariableNameRangeMapping(
            List<?> gridVariableList, String xRangeString, String yRangeString,
            String timeRangeString); static boolean isOPeNDAP(URI uri); static final int RANGE_STRIDE; static final String PARAMETER_DECLARATOR; static final String RANGE_DELIMETER; static final String URI_DELIMETER; static final String OPENDAP_PROTO; static final String REQUEST_PROTO; static final List<String> REQUIRED_ATTRIBUTES; static final String DESCRIPTION_HEADER; }