use of org.n52.io.crs.BoundingBox in project series-rest-api by 52North.
the class VicinityTest method shouldHaveCommonLatitudeCircleWhenCenterIsNorthPole.
@Test
public void shouldHaveCommonLatitudeCircleWhenCenterIsNorthPole() {
Vicinity vicinity = createRadiusAtNorthPole(circleAroundNorthPole);
BoundingBox bounds = vicinity.calculateBounds();
double llLatitudeOfSmallCircle = bounds.getLowerLeft().getY();
double urLatitudeOfSmallCircle = bounds.getUpperRight().getY();
assertThat(llLatitudeOfSmallCircle, closeTo(urLatitudeOfSmallCircle, ERROR_DELTA));
}
use of org.n52.io.crs.BoundingBox in project series-rest-api by 52North.
the class VicinityTest method shouldHaveInversedLatitudesWhenCenterIsOnEquator.
@Test
public void shouldHaveInversedLatitudesWhenCenterIsOnEquator() {
Vicinity vicinity = createRadiusAtNorthPole(circleCenterAtGreenwhichAndEquator);
BoundingBox bounds = vicinity.calculateBounds();
double llLatitudeOfSmallCircle = bounds.getLowerLeft().getY();
double urLatitudeOfSmallCircle = bounds.getUpperRight().getY();
assertThat(llLatitudeOfSmallCircle, closeTo(-urLatitudeOfSmallCircle, ERROR_DELTA));
}
use of org.n52.io.crs.BoundingBox in project series-rest-api by 52North.
the class VicinityTest method shouldHaveInversedLongitudesWhenCenterIsOnGreenwhich.
@Test
public void shouldHaveInversedLongitudesWhenCenterIsOnGreenwhich() {
Vicinity vicinity = createRadiusAtNorthPole(circleCenterAtGreenwhichAndEquator);
BoundingBox bounds = vicinity.calculateBounds();
double llLongitudeOfGreatCircle = bounds.getLowerLeft().getX();
double urLongitudeOnGreatCircle = bounds.getUpperRight().getX();
assertThat(llLongitudeOfGreatCircle, closeTo(-urLongitudeOnGreatCircle, ERROR_DELTA));
}
use of org.n52.io.crs.BoundingBox in project series-rest-api by 52North.
the class VicinityTest method shouldHaveCommonLatitudeCircleWhenCenterIsSouthPole.
@Test
public void shouldHaveCommonLatitudeCircleWhenCenterIsSouthPole() {
Vicinity vicinity = createRadiusAtNorthPole(circleAroundSouthPole);
BoundingBox bounds = vicinity.calculateBounds();
double llLatitudeOfSmallCircle = bounds.getLowerLeft().getY();
double urLatitudeOfSmallCircle = bounds.getUpperRight().getY();
assertThat(llLatitudeOfSmallCircle, closeTo(urLatitudeOfSmallCircle, ERROR_DELTA));
}
use of org.n52.io.crs.BoundingBox in project series-rest-api by 52North.
the class IoParameters method parseBoundsFromVicinity.
private BoundingBox parseBoundsFromVicinity() {
if (!containsParameter(NEAR)) {
return null;
}
String vicinityValue = getAsString(NEAR);
Vicinity vicinity = parseJson(vicinityValue, Vicinity.class);
if (containsParameter(CRS)) {
vicinity.setCenter(convertToCrs84(vicinity.getCenter()));
}
BoundingBox bounds = vicinity.calculateBounds();
LOGGER.debug("Parsed vicinity bounds: {}", bounds.toString());
return bounds;
}
Aggregations