Search in sources :

Example 1 with FeatureQueryRequest

use of com.github.sebastianfrey.joa.resources.request.FeatureQueryRequest in project joa by sebastianfrey.

the class GeoPackageServiceTest method should_return_items_from_collection.

@Test
public void should_return_items_from_collection() throws Exception {
    FeatureQueryRequest query = new FeatureQueryRequest().offset(Long.valueOf(0)).limit(10).datetime(new Datetime("2021-03-04T17:44:25.873Z")).bbox(new Bbox().minX(-180.0).minY(-90.0).maxX(80.0).maxY(90.0));
    GeoPackageItems items = geoPackageService.getItems(TEST_SERVICE, TEST_COLLECTION_POINT, query);
    assertThat(items).isNotNull();
    assertThat(items.getServiceId()).isEqualTo("example");
    assertThat(items.getCollectionId()).isEqualTo("point1");
    assertThat(items.getFeatures()).isNotEmpty();
    assertThat(items.getNumberMatched()).isGreaterThan(Long.valueOf(0));
    assertThat(items.getNumberReturned()).isGreaterThan(0);
    assertThatCode(() -> Instant.parse(items.getTimeStamp())).doesNotThrowAnyException();
}
Also used : FeatureQueryRequest(com.github.sebastianfrey.joa.resources.request.FeatureQueryRequest) Bbox(com.github.sebastianfrey.joa.models.Bbox) Datetime(com.github.sebastianfrey.joa.models.Datetime) Test(org.junit.jupiter.api.Test)

Aggregations

Bbox (com.github.sebastianfrey.joa.models.Bbox)1 Datetime (com.github.sebastianfrey.joa.models.Datetime)1 FeatureQueryRequest (com.github.sebastianfrey.joa.resources.request.FeatureQueryRequest)1 Test (org.junit.jupiter.api.Test)1