private List<LatLonPoint> calcLatLonBoundaryPointsFromProjection(int maxPointsInYEdge, int maxPointsInXEdge) { List<ProjectionPoint> projPoints = calcProjectionBoundaryPoints(maxPointsInYEdge, maxPointsInXEdge); List<LatLonPoint> latLonPoints = new LinkedList<>(); for (ProjectionPoint projPoint : projPoints) { latLonPoints.add(transform.getProjection().projToLatLon(projPoint)); } return latLonPoints; }
public ProjectionImpl getProjection() { for (String ctName : getTransformNames()) { CoverageTransform ct = dataset.findCoordTransform(ctName); if (ct != null && ct.isHoriz()) return ct.getProjection(); } return new LatLonProjection(); }
public LatLonPoint getLatLon(int yindex, int xindex) { if (isProjection) { double x = xAxis.getCoordMidpoint(xindex); double y = yAxis.getCoordMidpoint(xindex); ProjectionImpl proj = transform.getProjection(); return proj.projToLatLon(x, y); } else { double lat = latAxis.getCoordMidpoint(yindex); double lon = lonAxis.getCoordMidpoint(xindex); return new LatLonPointImpl(lat, lon); } }
Projection proj = horizCoordSys.getTransform().getProjection(); if (proj instanceof LatLonProjection) { // Projection is a "fake"; we already have lat/lon. return false;
@Test public void testLatLonCoordTransformAddedToCollection() throws IOException { String filename = TestDir.cdmUnitTestDir + "gribCollections/gfs_2p5deg/GFS_Global_2p5deg_20150301_0000.grib2.ncx4"; try (FeatureDatasetCoverage featDsetCov = CoverageDatasetFactory.open(filename)) { Assert.assertEquals(1, featDsetCov.getCoverageCollections().size()); CoverageCollection covColl = featDsetCov.getCoverageCollections().get(0); Assert.assertEquals(1, covColl.getCoordTransforms().size()); CoverageTransform covTransform = covColl.getCoordTransforms().get(0); Assert.assertTrue(covTransform.getProjection() instanceof LatLonProjection); Attribute gridMappingNameAttrib = covTransform.findAttribute("grid_mapping_name"); Assert.assertNotNull("CoverageTransform didn't contain 'grid_mapping_name' attribute.", gridMappingNameAttrib); Assert.assertEquals("latitude_longitude", gridMappingNameAttrib.getStringValue()); } } }
ProjectionImpl proj = transform.getProjection(); ProjectionPoint pp = proj.latLonToProj(latlon); optb = xhelper.subsetContaining(pp.getX()); ProjectionImpl proj = transform.getProjection();
CoverageCoordAxis1D yAxis = horizCoordSys.getYAxis(); Projection proj = horizCoordSys.getTransform().getProjection(); ProjectionPointImpl projPoint = new ProjectionPointImpl(); LatLonPointImpl latlonPoint = new LatLonPointImpl();
ProjectionImpl p = hcs.getTransform().getProjection();