@Test public void getLatitude() { double delta = 1e-6; double latitude1 = -125.00; double latitude2 = 158.00; double latitude3 = 50.00; double latitude4 = -50.00; assertEquals(-90.00, BoundingBox.getLatitude(latitude1), delta); assertEquals(90.00, BoundingBox.getLatitude(latitude2), delta); assertEquals(50.00, BoundingBox.getLatitude(latitude3), delta); assertEquals(-50.00, BoundingBox.getLatitude(latitude4), delta); }
public static double getLatitude(double latitude) { if (latitude > 90) { return 90; } if (latitude < -90) { return -90; } return latitude; }
BoundingBox { public static double getLatitude(double latitude) { if (latitude > 90) { return 90; } if (latitude < -90) { return -90; } return latitude; } }
BoundingBox { public static double getLatitude(double latitude) { if (latitude > 90) { return 90; } if (latitude < -90) { return -90; } return latitude; } protected  BoundingBox(double north, double east, double south, double west); }
BoundingBox { public static double getLatitude(double latitude) { if (latitude > 90) { return 90; } if (latitude < -90) { return -90; } return latitude; } protected  BoundingBox(double north, double east, double south, double west); static BoundingBox fromWestSouthEastNorthArray(String[] bbox); static BoundingBox fromWSEN(double west, double south, double east, double north); static BoundingBox fromNominatim(JSONArray json); static BoundingBox fromPositionAndRadius(IPosition position, double distanceInMeters); static double getLongitude(double longitude); static double getLatitude(double latitude); String asSqlQueryString(String columnLongitude, String columnLatitude); List<PlantsCache.Marker> selectPositionsInsideAfterSQLQuery(List<PlantsCache.Marker> positions); static double distanceInMetersBetween(IPosition p1, IPosition p2); static BoundingBox fromNESW(double north, double east, double south, double west); boolean contains(Position position); Position middle(); static BoundingBox ofTileAt(TilePosition position); double southBorderLatitude(); double northBorderLatitude(); Position southWestCorner(); Position southEastCorner(); Position northWestCorner(); Position northEastCorner(); @Override boolean equals(Object obj); @Override int hashCode(); JSONObject toJSON(); static BoundingBox fromJSON(JSONObject json); double deltaLongitude(); boolean crosses180(); String toExtentString(); }
BoundingBox { public static double getLatitude(double latitude) { if (latitude > 90) { return 90; } if (latitude < -90) { return -90; } return latitude; } protected  BoundingBox(double north, double east, double south, double west); static BoundingBox fromWestSouthEastNorthArray(String[] bbox); static BoundingBox fromWSEN(double west, double south, double east, double north); static BoundingBox fromNominatim(JSONArray json); static BoundingBox fromPositionAndRadius(IPosition position, double distanceInMeters); static double getLongitude(double longitude); static double getLatitude(double latitude); String asSqlQueryString(String columnLongitude, String columnLatitude); List<PlantsCache.Marker> selectPositionsInsideAfterSQLQuery(List<PlantsCache.Marker> positions); static double distanceInMetersBetween(IPosition p1, IPosition p2); static BoundingBox fromNESW(double north, double east, double south, double west); boolean contains(Position position); Position middle(); static BoundingBox ofTileAt(TilePosition position); double southBorderLatitude(); double northBorderLatitude(); Position southWestCorner(); Position southEastCorner(); Position northWestCorner(); Position northEastCorner(); @Override boolean equals(Object obj); @Override int hashCode(); JSONObject toJSON(); static BoundingBox fromJSON(JSONObject json); double deltaLongitude(); boolean crosses180(); String toExtentString();  }