@Test public void testReaderLine() throws IOException { SimpleGeometryReader rdr = openReaderOverFile("outflow_3seg_5timesteps.nc"); Assert.assertNotNull(rdr); Line line0 = rdr.readLine("seg_outflow", 0); Line line1 = rdr.readLine("seg_outflow", 1); Line line2 = rdr.readLine("seg_outflow", 2); Assert.assertEquals(0.462, line0.getData().getDouble(0), 0.001); Assert.assertEquals(3.61, line1.getData().getDouble(3), 0.01); Assert.assertEquals(9.49, line2.getData().getDouble(1), 0.01); Assert.assertEquals(1125, line0.getPoints().size()); Assert.assertEquals(10, line1.getPoints().size()); Assert.assertEquals(2280, line2.getPoints().size()); }
public Line readLine(String name, int index) { Variable linevar = ds.findVariable(name); if (linevar == null) return null; Line line = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) line = new CFLine(); if (line == null) return null; else return line.setupLine(ds, linevar, index); }
SimpleGeometryReader { public Line readLine(String name, int index) { Variable linevar = ds.findVariable(name); if (linevar == null) return null; Line line = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) line = new CFLine(); if (line == null) return null; else return line.setupLine(ds, linevar, index); } }
SimpleGeometryReader { public Line readLine(String name, int index) { Variable linevar = ds.findVariable(name); if (linevar == null) return null; Line line = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) line = new CFLine(); if (line == null) return null; else return line.setupLine(ds, linevar, index); } SimpleGeometryReader(NetcdfDataset ds); }
SimpleGeometryReader { public Line readLine(String name, int index) { Variable linevar = ds.findVariable(name); if (linevar == null) return null; Line line = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) line = new CFLine(); if (line == null) return null; else return line.setupLine(ds, linevar, index); } SimpleGeometryReader(NetcdfDataset ds); Polygon readPolygon(String name, int index); Line readLine(String name, int index); Point readPoint(String name, int index); GeometryType getGeometryType(String name); }
SimpleGeometryReader { public Line readLine(String name, int index) { Variable linevar = ds.findVariable(name); if (linevar == null) return null; Line line = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) line = new CFLine(); if (line == null) return null; else return line.setupLine(ds, linevar, index); } SimpleGeometryReader(NetcdfDataset ds); Polygon readPolygon(String name, int index); Line readLine(String name, int index); Point readPoint(String name, int index); GeometryType getGeometryType(String name);  }