use of org.locationtech.jts.geom.Envelope 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.locationtech.jts.geom.Envelope in project arctic-sea by 52North.
the class ReferencedEnvelopeTest method testExpandToIncludeEnvelope.
@Test
public void testExpandToIncludeEnvelope() throws Exception {
originEnvelope.expandToInclude(extensionEnvelope);
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));
}
use of org.locationtech.jts.geom.Envelope 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.locationtech.jts.geom.Envelope in project arctic-sea by 52North.
the class ReferencedEnvelopeTest method testExpandToIncludeEmptyEnvelope.
@Test
public void testExpandToIncludeEmptyEnvelope() throws Exception {
originEnvelope.expandToInclude(emptyEnvelope);
assertThat(originEnvelope.getSrid(), is(4326));
final Envelope envelope = originEnvelope.getEnvelope();
assertThat(envelope.getMinX(), is(0.0));
assertThat(envelope.getMaxX(), is(1.0));
assertThat(envelope.getMinY(), is(0.0));
assertThat(envelope.getMaxY(), is(1.0));
assertThat(envelope.getArea(), is(1.0));
}
use of org.locationtech.jts.geom.Envelope 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