/** * Get the bounding box in lat/lon. * * @return the LatLonRectangle for the bounding box */ public LatLonRect getDefaultMapAreaLL() { return projToLatLonBB(defaultMapArea); }
/** * Get the bounding box in lat/lon. * * @return the LatLonRectangle for the bounding box */ public LatLonRect getDefaultMapAreaLL() { return projToLatLonBB(defaultMapArea); }
/** * Get the bounding box in lat/lon. * * @return the LatLonRectangle for the bounding box */ public LatLonRect getDefaultMapAreaLL() { return projToLatLonBB(defaultMapArea); }
/** * Get the bounding box in lat/lon. * * @return the LatLonRectangle for the bounding box */ public LatLonRect getDefaultMapAreaLL() { return projToLatLonBB(defaultMapArea); }
public LatLonRect getLatLonBB() { if (isLatLon()) { return new LatLonRect(new LatLonPointImpl(getStartY(), getStartX()), dy * (ny-1), dx * (nx-1)); } else { return proj.projToLatLonBB(getProjectionBB()); } }
ProjectionImpl dataProjection = getProjection(); ProjectionRect bb = getBoundingBox(); llbb = dataProjection.projToLatLonBB(bb);
ProjectionImpl dataProjection = getProjection(); ProjectionRect bb = getBoundingBox(); llbb = dataProjection.projToLatLonBB(bb);
ProjectionRect bb = getBoundingBox(); if (bb != null) llbb = dataProjection.projToLatLonBB(bb);
@Test @Category(NeedsCdmUnitTest.class) public void testMSG() throws Exception { String filename = TestDir.cdmUnitTestDir + "transforms/Eumetsat.VerticalPerspective.grb"; try(GridDataset dataset = GridDataset.open(filename)) { logger.debug("open {}", filename); GeoGrid grid = dataset.findGridDatatypeByAttribute(Grib.VARIABLE_ID_ATTNAME, "VAR_3-0-8"); // "Pixel_scene_type"); assert null != grid : dataset.getLocation(); GridCoordSystem gcs = grid.getCoordinateSystem(); assert null != gcs; assert grid.getRank() == 3; // bbox = ll: 16.79S 20.5W+ ur: 14.1N 20.09E LatLonRect bbox = new LatLonRect(new LatLonPointImpl(-16.79, -20.5), new LatLonPointImpl(14.1, 20.9)); ProjectionImpl p = gcs.getProjection(); ProjectionRect prect = p.latLonToProjBB(bbox); // must override default implementation logger.debug("{} -> {}", bbox, prect); ProjectionRect expected = new ProjectionRect( new ProjectionPointImpl(-2129.5688, -1793.0041), 4297.8453, 3308.3885); assert prect.nearlyEquals(expected); LatLonRect bb2 = p.projToLatLonBB(prect); logger.debug("{} -> {}", prect, bb2); GeoGrid grid_section = grid.subset(null, null, bbox, 1, 1, 1); Array data = grid_section.readDataSlice(-1, -1, -1, -1); assert data.getRank() == 3; int[] shape = data.getShape(); assert shape[0] == 1 : shape[0] + " should be 1"; assert shape[1] == 363 : shape[1] + " should be 363"; assert shape[2] == 479 : shape[2] + " should be 479"; } }
assert prect.nearlyEquals(expected); LatLonRect bb2 = p.projToLatLonBB(prect); System.out.printf("%s -> %s %n", prect, bb2);