@Test public void testReaderPoint() throws IOException { SimpleGeometryReader rdr = openReaderOverFile("avg_temp_3gage_5timesteps.nc"); Assert.assertNotNull(rdr); Point point0 = rdr.readPoint("gage_avg_temp", 0); Point point1 = rdr.readPoint("gage_avg_temp", 1); Point point2 = rdr.readPoint("gage_avg_temp", 2); Assert.assertEquals(-91.277, point0.getX(), 0.0001); Assert.assertEquals(40.75365, point0.getY(), 0.000001); Assert.assertEquals(-91.674, point1.getX(), 0.0003); Assert.assertEquals(40.9253, point1.getY(), 0.00001); Assert.assertEquals(-91.5515, point2.getX(), 0.00006); Assert.assertEquals(41, point2.getY(), 0.1); Assert.assertEquals(0.623, point0.getData().getDouble(0), 0.001); Assert.assertEquals(9.02, point1.getData().getDouble(3), 0.001); Assert.assertEquals(3.14, point2.getData().getDouble(1), 0.001); }
public Point readPoint(String name, int index) { Variable pointvar = ds.findVariable(name); if (pointvar == null) return null; Point pt = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) pt = new CFPoint(); if (pt == null) return pt; else return pt.setupPoint(ds, pointvar, index); }
SimpleGeometryReader { public Point readPoint(String name, int index) { Variable pointvar = ds.findVariable(name); if (pointvar == null) return null; Point pt = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) pt = new CFPoint(); if (pt == null) return pt; else return pt.setupPoint(ds, pointvar, index); } }
SimpleGeometryReader { public Point readPoint(String name, int index) { Variable pointvar = ds.findVariable(name); if (pointvar == null) return null; Point pt = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) pt = new CFPoint(); if (pt == null) return pt; else return pt.setupPoint(ds, pointvar, index); } SimpleGeometryReader(NetcdfDataset ds); }
SimpleGeometryReader { public Point readPoint(String name, int index) { Variable pointvar = ds.findVariable(name); if (pointvar == null) return null; Point pt = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) pt = new CFPoint(); if (pt == null) return pt; else return pt.setupPoint(ds, pointvar, 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 Point readPoint(String name, int index) { Variable pointvar = ds.findVariable(name); if (pointvar == null) return null; Point pt = null; if (ds.findGlobalAttribute(CF.CONVENTIONS) != null) if (CF1Convention.getVersion(ds.findGlobalAttribute(CF.CONVENTIONS).getStringValue()) >= 8) pt = new CFPoint(); if (pt == null) return pt; else return pt.setupPoint(ds, pointvar, 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);  }