@Override public GeoBBox expand(final double angle) { final double newTopLat = latitude + angle; final double newBottomLat = latitude - angle; final double newLeftLon = longitude - angle; final double newRightLon = longitude + angle; return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = topLat + angle; final double newBottomLat = -Math.PI * 0.5; return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, -Math.PI, Math.PI); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = Math.PI * 0.5; final double newBottomLat = bottomLat - angle; return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, -Math.PI, Math.PI); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = topLat + angle; final double newBottomLat = bottomLat - angle; return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, -Math.PI, Math.PI); }
@Override public GeoBBox expand(final double angle) { // Figuring out when we escalate to a special case requires some prefiguring double newLeftLon = longitude - angle; double newRightLon = longitude + angle; double currentLonSpan = 2.0 * angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, Math.PI * 0.5, -Math.PI * 0.5, newLeftLon, newRightLon); }
/** * Create a GeoArea of the right kind given the specified bounds. * @param planetModel is the planet model * @param topLat is the top latitude * @param bottomLat is the bottom latitude * @param leftLon is the left longitude * @param rightLon is the right longitude * @return a GeoArea corresponding to what was specified. */ public static GeoArea makeGeoArea(final PlanetModel planetModel, final double topLat, final double bottomLat, final double leftLon, final double rightLon) { return GeoBBoxFactory.makeGeoBBox(planetModel, topLat, bottomLat, leftLon, rightLon); }
@Override public GeoBBox expand(final double angle) { double newTopLat = latitude + angle; double newBottomLat = latitude - angle; // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = topLat + angle; final double newBottomLat = bottomLat - angle; // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { double newTopLat = latitude + angle; double newBottomLat = latitude - angle; return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, -Math.PI, Math.PI); }
@Override public GeoBBox expand(final double angle) { // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, Math.PI * 0.5, -Math.PI * 0.5, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, Math.PI * 0.5, -Math.PI * 0.5, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = Math.PI * 0.5; final double newBottomLat = bottomLat - angle; // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = topLat + angle; final double newBottomLat = bottomLat - angle; double newLeftLon = longitude - angle; double newRightLon = longitude + angle; double currentLonSpan = 2.0 * angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = topLat + angle; final double newBottomLat = -Math.PI * 0.5; // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = Math.PI * 0.5; final double newBottomLat = bottomLat - angle; // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = latitude + angle; final double newBottomLat = latitude - angle; // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = topLat + angle; final double newBottomLat = -Math.PI * 0.5; // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public GeoBBox expand(final double angle) { final double newTopLat = topLat + angle; final double newBottomLat = bottomLat - angle; // Figuring out when we escalate to a special case requires some prefiguring double currentLonSpan = rightLon - leftLon; if (currentLonSpan < 0.0) currentLonSpan += Math.PI * 2.0; double newLeftLon = leftLon - angle; double newRightLon = rightLon + angle; if (currentLonSpan + 2.0 * angle >= Math.PI * 2.0) { newLeftLon = -Math.PI; newRightLon = Math.PI; } return GeoBBoxFactory.makeGeoBBox(planetModel, newTopLat, newBottomLat, newLeftLon, newRightLon); }
@Override public Rectangle rect(double minX, double maxX, double minY, double maxY) { GeoBBox bBox = GeoBBoxFactory.makeGeoBBox(planetModel, maxY * DistanceUtils.DEGREES_TO_RADIANS, minY * DistanceUtils.DEGREES_TO_RADIANS, minX * DistanceUtils.DEGREES_TO_RADIANS, maxX * DistanceUtils.DEGREES_TO_RADIANS); return new Geo3dRectangleShape(bBox, context, minX, maxX, minY, maxY); }
@Override public void reset(double minX, double maxX, double minY, double maxY) { shape = GeoBBoxFactory.makeGeoBBox(shape.getPlanetModel(), maxY * DistanceUtils.DEGREES_TO_RADIANS, minY * DistanceUtils.DEGREES_TO_RADIANS, minX * DistanceUtils.DEGREES_TO_RADIANS, maxX * DistanceUtils.DEGREES_TO_RADIANS); center = null; boundingBox = null; }