@Test public void projToLatLonBB_everything() { ProjectionPoint lowerLeft = ProjectionPoint.create(-30000, -30000); ProjectionPoint upperRight = ProjectionPoint.create(30000, 30000); Sinusoidal proj = new Sinusoidal(); ProjectionRect projBB = new ProjectionRect(lowerLeft, upperRight); LatLonRect latLonBB = proj.projToLatLonBB(projBB); Assert.assertEquals(-180.0, latLonBB.getLonMin(), 0.1); Assert.assertEquals(180.0, latLonBB.getLonMax(), 0.1); Assert.assertEquals(-90.0, latLonBB.getLatMin(), 0.1); Assert.assertEquals(90.0, latLonBB.getLatMax(), 0.1); }
@Override public LatLonRect projToLatLonBB(ProjectionRect projBB) { List<ProjectionPoint> pointsOfInterest = new LinkedList<>(); ProjectionPoint northPole = latLonToProj(LatLonPoint.create(90, 0)); if (projBB.contains(northPole)) { pointsOfInterest.add(northPole); } ProjectionPoint southPole = latLonToProj(LatLonPoint.create(-90, 0)); if (projBB.contains(southPole)) { pointsOfInterest.add(southPole); } if (pointsOfInterest.size() == 2) { return new LatLonRect(); } List<ProjectionPoint> corners = Arrays.asList(projBB.getLowerLeftPoint(), projBB.getLowerRightPoint(), projBB.getUpperLeftPoint(), projBB.getUpperRightPoint()); for (ProjectionPoint corner : corners) { if (projToLatLon(corner) != INVALID) { pointsOfInterest.add(corner); } } pointsOfInterest.addAll(getMapEdgeIntercepts(projBB)); return makeLatLonRect(pointsOfInterest); }
Sinusoidal extends AbstractProjection { @Override public LatLonRect projToLatLonBB(ProjectionRect projBB) { List<ProjectionPoint> pointsOfInterest = new LinkedList<>(); ProjectionPoint northPole = latLonToProj(LatLonPoint.create(90, 0)); if (projBB.contains(northPole)) { pointsOfInterest.add(northPole); } ProjectionPoint southPole = latLonToProj(LatLonPoint.create(-90, 0)); if (projBB.contains(southPole)) { pointsOfInterest.add(southPole); } if (pointsOfInterest.size() == 2) { return new LatLonRect(); } List<ProjectionPoint> corners = Arrays.asList(projBB.getLowerLeftPoint(), projBB.getLowerRightPoint(), projBB.getUpperLeftPoint(), projBB.getUpperRightPoint()); for (ProjectionPoint corner : corners) { if (projToLatLon(corner) != INVALID) { pointsOfInterest.add(corner); } } pointsOfInterest.addAll(getMapEdgeIntercepts(projBB)); return makeLatLonRect(pointsOfInterest); } }
Sinusoidal extends AbstractProjection { @Override public LatLonRect projToLatLonBB(ProjectionRect projBB) { List<ProjectionPoint> pointsOfInterest = new LinkedList<>(); ProjectionPoint northPole = latLonToProj(LatLonPoint.create(90, 0)); if (projBB.contains(northPole)) { pointsOfInterest.add(northPole); } ProjectionPoint southPole = latLonToProj(LatLonPoint.create(-90, 0)); if (projBB.contains(southPole)) { pointsOfInterest.add(southPole); } if (pointsOfInterest.size() == 2) { return new LatLonRect(); } List<ProjectionPoint> corners = Arrays.asList(projBB.getLowerLeftPoint(), projBB.getLowerRightPoint(), projBB.getUpperLeftPoint(), projBB.getUpperRightPoint()); for (ProjectionPoint corner : corners) { if (projToLatLon(corner) != INVALID) { pointsOfInterest.add(corner); } } pointsOfInterest.addAll(getMapEdgeIntercepts(projBB)); return makeLatLonRect(pointsOfInterest); } Sinusoidal();  Sinusoidal(double centMeridian, double false_easting, double false_northing, double radius); }
Sinusoidal extends AbstractProjection { @Override public LatLonRect projToLatLonBB(ProjectionRect projBB) { List<ProjectionPoint> pointsOfInterest = new LinkedList<>(); ProjectionPoint northPole = latLonToProj(LatLonPoint.create(90, 0)); if (projBB.contains(northPole)) { pointsOfInterest.add(northPole); } ProjectionPoint southPole = latLonToProj(LatLonPoint.create(-90, 0)); if (projBB.contains(southPole)) { pointsOfInterest.add(southPole); } if (pointsOfInterest.size() == 2) { return new LatLonRect(); } List<ProjectionPoint> corners = Arrays.asList(projBB.getLowerLeftPoint(), projBB.getLowerRightPoint(), projBB.getUpperLeftPoint(), projBB.getUpperRightPoint()); for (ProjectionPoint corner : corners) { if (projToLatLon(corner) != INVALID) { pointsOfInterest.add(corner); } } pointsOfInterest.addAll(getMapEdgeIntercepts(projBB)); return makeLatLonRect(pointsOfInterest); } Sinusoidal();  Sinusoidal(double centMeridian, double false_easting, double false_northing, double radius); @Override Projection constructCopy(); double getCentMeridian(); double getFalseEasting(); double getFalseNorthing(); double getEarthRadius(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override String paramsToString(); @Override boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2); @Override ProjectionPoint latLonToProj(LatLonPoint latLon); @Override LatLonPoint projToLatLon(ProjectionPoint world); @Override LatLonRect projToLatLonBB(ProjectionRect projBB); List<ProjectionPoint> getMapEdgeIntercepts(ProjectionRect projBB); List<ProjectionPoint> getMapEdgeInterceptsAtX(double x0); List<ProjectionPoint> getMapEdgeInterceptsAtY(double y0); }
Sinusoidal extends AbstractProjection { @Override public LatLonRect projToLatLonBB(ProjectionRect projBB) { List<ProjectionPoint> pointsOfInterest = new LinkedList<>(); ProjectionPoint northPole = latLonToProj(LatLonPoint.create(90, 0)); if (projBB.contains(northPole)) { pointsOfInterest.add(northPole); } ProjectionPoint southPole = latLonToProj(LatLonPoint.create(-90, 0)); if (projBB.contains(southPole)) { pointsOfInterest.add(southPole); } if (pointsOfInterest.size() == 2) { return new LatLonRect(); } List<ProjectionPoint> corners = Arrays.asList(projBB.getLowerLeftPoint(), projBB.getLowerRightPoint(), projBB.getUpperLeftPoint(), projBB.getUpperRightPoint()); for (ProjectionPoint corner : corners) { if (projToLatLon(corner) != INVALID) { pointsOfInterest.add(corner); } } pointsOfInterest.addAll(getMapEdgeIntercepts(projBB)); return makeLatLonRect(pointsOfInterest); } Sinusoidal();  Sinusoidal(double centMeridian, double false_easting, double false_northing, double radius); @Override Projection constructCopy(); double getCentMeridian(); double getFalseEasting(); double getFalseNorthing(); double getEarthRadius(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override String paramsToString(); @Override boolean crossSeam(ProjectionPoint pt1, ProjectionPoint pt2); @Override ProjectionPoint latLonToProj(LatLonPoint latLon); @Override LatLonPoint projToLatLon(ProjectionPoint world); @Override LatLonRect projToLatLonBB(ProjectionRect projBB); List<ProjectionPoint> getMapEdgeIntercepts(ProjectionRect projBB); List<ProjectionPoint> getMapEdgeInterceptsAtX(double x0); List<ProjectionPoint> getMapEdgeInterceptsAtY(double y0);  }