public static ucar.nc2.dataset.CoordinateSystem getCoordinateSystem(VariableDS variableDS) { final List<ucar.nc2.dataset.CoordinateSystem> systems = variableDS.getCoordinateSystems(); if (systems.isEmpty()) { throw new RuntimeException( "Coordinate system for Variable " + variableDS.getFullName() + " haven't been found"); } return systems.get(0); }
CoordinateSystem getCoordinateSystem(Variable variable) { CoordinateSystem cs = null; if (variable != null) { final List<CoordinateSystem> systems = ((VariableDS) variable) .getCoordinateSystems(); if (!systems.isEmpty()) cs = systems.get(0); } return cs; }
colorModel, raster, colorModel.isAlphaPremultiplied(), properties); CoordinateSystem cs = wrapper.variableDS.getCoordinateSystems().get(0); CoordinateAxis axis = georeferencing.isLonLat() ? cs.getLatAxis() : cs.getYaxis(); boolean flipYAxis = needFlipYAxis(axis);
public static ucar.nc2.dataset.CoordinateSystem getCoordinateSystem(VariableDS variableDS) { final List<ucar.nc2.dataset.CoordinateSystem> systems = variableDS.getCoordinateSystems(); if (systems.isEmpty()) { throw new RuntimeException( "Coordinate system for Variable " + variableDS.getFullName() + " haven't been found"); } return systems.get(0); }
public static ucar.nc2.dataset.CoordinateSystem getCoordinateSystem(VariableDS variableDS) { final List<ucar.nc2.dataset.CoordinateSystem> systems = variableDS.getCoordinateSystems(); if (systems.isEmpty()) { throw new RuntimeException("Coordinate system for Variable " + variableDS.getFullName() + " haven't been found"); } return systems.get(0); }
List csys = var.getCoordinateSystems(); if (csys.size() > 0) { buff.setLength(0);
List csys = var.getCoordinateSystems(); if (csys.size() > 0) { buff.setLength(0);
List csys = var.getCoordinateSystems(); if (csys.size() > 0) { buff.setLength(0);
@Test public void testWrfNoTimeVar() throws IOException { String tstFile = TestDir.cdmLocalTestDataDir +"wrf/WrfNoTimeVar.nc"; logger.info("Open '{}'", tstFile); Set<NetcdfDataset.Enhance> defaultEnhanceMode = NetcdfDataset.getDefaultEnhanceMode(); EnumSet<NetcdfDataset.Enhance> enhanceMode = EnumSet.copyOf(defaultEnhanceMode); enhanceMode.add(NetcdfDataset.Enhance.IncompleteCoordSystems); DatasetUrl durl = DatasetUrl.findDatasetUrl (tstFile); NetcdfDataset ncd = NetcdfDataset.acquireDataset(durl, enhanceMode, null); List<CoordinateSystem> cs = ncd.getCoordinateSystems(); Assert.assertEquals(1, cs.size()); CoordinateSystem dsCs = cs.get(0); Assert.assertEquals(2, dsCs.getCoordinateAxes().size()); VariableDS var = (VariableDS) ncd.findVariable("T2"); List<CoordinateSystem> varCs = var.getCoordinateSystems(); Assert.assertEquals(1, varCs.size()); Assert.assertEquals(dsCs, varCs.get(0)); } }
assert v != null; List<CoordinateSystem> cList = v.getCoordinateSystems(); assert cList != null; assert cList.size() == 1;
colorModel, raster, colorModel.isAlphaPremultiplied(), properties); CoordinateSystem cs = wrapper.variableDS.getCoordinateSystems().get(0); CoordinateAxis axis = georeferencing.isLonLat() ? cs.getLatAxis() : cs.getYaxis(); boolean flipYAxis = needFlipYAxis(axis);
@Test public void testCoordinateSystemDomain() throws Exception { System.err.printf("%nOpen %s grid='%s'%n", filename, gridName); Grib.setDebugFlags(new DebugFlagsImpl("Grib/indexOnly")); try (NetcdfDataset ncd = NetcdfDataset.openDataset(filename)) { Assert.assertNotNull( filename, ncd); VariableDS vds = (VariableDS) ncd.findVariable(gridName); Assert.assertNotNull( gridName, vds); for (CoordinateSystem cs : vds.getCoordinateSystems()) { System.err.printf(" CoordinateSystem= '%s'%n", cs); testDomain("CoordinateSystem ", vds.getDimensions(), cs.getCoordinateAxes()); } } finally { Grib.setDebugFlags(new DebugFlagsImpl("")); } }
final BufferedImage image = new BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), null); CoordinateAxis axis = wrapper.variableDS.getCoordinateSystems().get(0).getLatAxis(); boolean flipYAxis = false; try {
Section varSection = new Section(v.getShapeAsSection()); List cList = v.getCoordinateSystems(); assert cList != null; assert cList.size() == 1;