use of org.n52.shetland.util.ReferencedEnvelope in project arctic-sea by 52North.
the class ReferencedEnvelopeTest method testExpandToIncludeReferencedEnvelopeWithNull.
@Test
public void testExpandToIncludeReferencedEnvelopeWithNull() throws Exception {
final ReferencedEnvelope e = null;
originEnvelope.expandToInclude(e);
assertThat(originEnvelope.isSetSrid(), is(true));
assertThat(originEnvelope.getSrid(), is(srid));
assertThat(originEnvelope.isSetEnvelope(), is(true));
final Envelope envelope = originEnvelope.getEnvelope();
assertThat(envelope.getArea(), is(1.0));
assertThat(envelope.getMinX(), is(0.0));
assertThat(envelope.getMaxX(), is(1.0));
assertThat(envelope.getMinY(), is(0.0));
assertThat(envelope.getMaxY(), is(1.0));
}
use of org.n52.shetland.util.ReferencedEnvelope in project arctic-sea by 52North.
the class ReferencedEnvelopeTest method testExpandToIncludeEnvelopeToNullEnvelope.
@Test
public void testExpandToIncludeEnvelopeToNullEnvelope() throws Exception {
final ReferencedEnvelope nullEnvelope = new ReferencedEnvelope(null, srid);
nullEnvelope.expandToInclude(extensionEnvelope);
assertThat(nullEnvelope.getSrid(), is(srid));
final Envelope envelope = nullEnvelope.getEnvelope();
assertThat(envelope.getMinX(), is(2.0));
assertThat(envelope.getMaxX(), is(3.0));
assertThat(envelope.getMinY(), is(2.0));
assertThat(envelope.getMaxY(), is(3.0));
assertThat(envelope.getArea(), is(1.0));
}
use of org.n52.shetland.util.ReferencedEnvelope in project arctic-sea by 52North.
the class ReferencedEnvelopeTest method testIsSetEnvelope.
@Test
public void testIsSetEnvelope() throws Exception {
final ReferencedEnvelope sosEnvelope = new ReferencedEnvelope();
sosEnvelope.setEnvelope(extensionEnvelope);
assertThat(new ReferencedEnvelope().isSetEnvelope(), is(false));
assertThat(sosEnvelope.isSetEnvelope(), is(true));
sosEnvelope.setEnvelope(emptyEnvelope);
assertThat(sosEnvelope.isSetEnvelope(), is(false));
}
use of org.n52.shetland.util.ReferencedEnvelope in project arctic-sea by 52North.
the class ReferencedEnvelopeTest method testHashCode.
@Test
public void testHashCode() {
final ReferencedEnvelope anEnvelope = new ReferencedEnvelope(new Envelope(1.0, 2.0, 3.0, 4.0), 52);
final ReferencedEnvelope anotherEnvelope = new ReferencedEnvelope(null, 52);
assertThat(anEnvelope.hashCode(), is(anEnvelope.hashCode()));
assertThat(anEnvelope.hashCode(), is(not(anotherEnvelope.hashCode())));
}
use of org.n52.shetland.util.ReferencedEnvelope in project arctic-sea by 52North.
the class ReferencedEnvelopeTest method testExpandToIncludeReferencedEnvelope.
@Test
public void testExpandToIncludeReferencedEnvelope() throws Exception {
originEnvelope.expandToInclude(new ReferencedEnvelope(extensionEnvelope, srid));
assertThat(originEnvelope.getSrid(), is(srid));
final Envelope envelope = originEnvelope.getEnvelope();
assertThat(envelope.getMinX(), is(0.0));
assertThat(envelope.getMaxX(), is(3.0));
assertThat(envelope.getMinY(), is(0.0));
assertThat(envelope.getMaxY(), is(3.0));
assertThat(envelope.getArea(), is(9.0));
}
Aggregations