Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -480,146 +480,4 @@ public void verifyBBoxCorrect() throws IOException {
assertEquals(154.0, bbox.get(0).get(2).doubleValue(), "Overall bounding box coor 3");
assertEquals(-9.0, bbox.get(0).get(3).doubleValue(), "Overall bounding box coor 4");
}
/**
* Verify the function correctly sum up the values for feature id summary
* @throws IOException - Not expect to throw
*/
@Disabled("Skipping this test temporarily")
@Test
public void verifyAggregationFeatureSummaryCorrect() throws IOException {
super.insertJsonToElasticCODataIndex(
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample1.0.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample1.1.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample1.2.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample2.0.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample3.0.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample3.1.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample3.2.json"
);

// Call rest api directly and get query result
ResponseEntity<FeatureCollectionGeoJSON> collection = testRestTemplate.getForEntity(
getBasePath() + "/collections/35234913-aa3c-48ec-b9a4-77f822f66ef8/items/summary",
FeatureCollectionGeoJSON.class);

assertNotNull(collection.getBody(), "Body not null");

FeatureCollectionGeoJSON json = collection.getBody();
assertEquals(3, json.getFeatures().size(), "Features correct");

// Sort make sure compare always same order
List<FeatureGeoJSON> sf = json.getFeatures().stream()
.sorted((a,b) -> b.getGeometry().hashCode() - a.getGeometry().hashCode())
.toList();
// Sample1
FeatureGeoJSON featureGeoJSON1 = new FeatureGeoJSON();
featureGeoJSON1.setType(FeatureGeoJSON.TypeEnum.FEATURE);
featureGeoJSON1.setGeometry(new PointGeoJSON()
.type(PointGeoJSON.TypeEnum.POINT)
.coordinates(List.of(BigDecimal.valueOf(159.26), BigDecimal.valueOf(-24.72)))
);
featureGeoJSON1.setProperties(Map.of(
FeatureProperty.COUNT.getValue(), 42.0,
FeatureProperty.START_TIME.getValue(), "2023-02-01T00:00:00.000Z",
FeatureProperty.END_TIME.getValue(), "2023-02-01T00:00:00.000Z"

));
assertEquals(featureGeoJSON1, sf.get(0), "featureGeoJSON1");

// Sample3
FeatureGeoJSON featureGeoJSON2 = new FeatureGeoJSON();
featureGeoJSON2.setType(FeatureGeoJSON.TypeEnum.FEATURE);
featureGeoJSON2.setGeometry(new PointGeoJSON()
.type(PointGeoJSON.TypeEnum.POINT)
.coordinates(List.of(BigDecimal.valueOf(154.81), BigDecimal.valueOf(-26.2)))
);
featureGeoJSON2.setProperties(Map.of(
FeatureProperty.COUNT.getValue(), 48.0,
FeatureProperty.START_TIME.getValue(), "2023-02-01T00:00:00.000Z",
FeatureProperty.END_TIME.getValue(), "2024-03-01T00:00:00.000Z"

));
assertEquals(featureGeoJSON2, sf.get(1), "featureGeoJSON2");

FeatureGeoJSON featureGeoJSON3 = new FeatureGeoJSON();
featureGeoJSON3.setType(FeatureGeoJSON.TypeEnum.FEATURE);
featureGeoJSON3.setGeometry(new PointGeoJSON()
.type(PointGeoJSON.TypeEnum.POINT)
.coordinates(List.of(BigDecimal.valueOf(153.56), BigDecimal.valueOf(-26.59)))
);
featureGeoJSON3.setProperties(Map.of(
FeatureProperty.COUNT.getValue(), 14.0,
FeatureProperty.START_TIME.getValue(), "2023-02-01T00:00:00.000Z",
FeatureProperty.END_TIME.getValue(), "2023-02-01T00:00:00.000Z"

));
assertEquals(featureGeoJSON3, sf.get(2), "featureGeoJSON3");
}
/**
* We add more sample data and will trigger page load.
* @throws IOException - Not expect to throw
*/
@Disabled("Skipping this test temporarily")
@Test
public void verifyAggregationFeatureSummaryWithPageCorrect() throws IOException {
assertEquals(4, pageSize, "This test only works with small page");

super.insertJsonToElasticCODataIndex(
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample1.0.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample1.1.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample1.2.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample2.0.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample3.0.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample3.1.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample3.2.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample4.0.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample5.0.json",
"cloudoptimized/35234913-aa3c-48ec-b9a4-77f822f66ef8/sample5.1.json"
);

// Call rest api directly and get query result
ResponseEntity<FeatureCollectionGeoJSON> collection = testRestTemplate.getForEntity(
getBasePath() + "/collections/35234913-aa3c-48ec-b9a4-77f822f66ef8/items/summary",
FeatureCollectionGeoJSON.class);

assertNotNull(collection.getBody(), "Body not null");

FeatureCollectionGeoJSON json = collection.getBody();
assertEquals(5, json.getFeatures().size(), "Features correct");

// Sort make sure compare always same order
List<FeatureGeoJSON> sf = json.getFeatures().stream()
.sorted((a,b) -> b.getGeometry().hashCode() - a.getGeometry().hashCode())
.toList();

// Sample1
FeatureGeoJSON featureGeoJSON1 = new FeatureGeoJSON();
featureGeoJSON1.setType(FeatureGeoJSON.TypeEnum.FEATURE);
featureGeoJSON1.setGeometry(new PointGeoJSON()
.type(PointGeoJSON.TypeEnum.POINT)
.coordinates(List.of(BigDecimal.valueOf(163.56), BigDecimal.valueOf(-26.59)))
);
featureGeoJSON1.setProperties(Map.of(
FeatureProperty.COUNT.getValue(), 14.0,
FeatureProperty.START_TIME.getValue(), "2023-02-01T00:00:00.000Z",
FeatureProperty.END_TIME.getValue(), "2023-02-01T00:00:00.000Z"

));
assertEquals(featureGeoJSON1, sf.get(0), "featureGeoJSON1");

// Sample5
FeatureGeoJSON featureGeoJSON2 = new FeatureGeoJSON();
featureGeoJSON2.setType(FeatureGeoJSON.TypeEnum.FEATURE);
featureGeoJSON2.setGeometry(new PointGeoJSON()
.type(PointGeoJSON.TypeEnum.POINT)
.coordinates(List.of(BigDecimal.valueOf(163.56), BigDecimal.valueOf(-126.59)))
);
featureGeoJSON2.setProperties(Map.of(
FeatureProperty.COUNT.getValue(), 20.0,
FeatureProperty.START_TIME.getValue(), "2022-12-01T00:00:00.000Z",
FeatureProperty.END_TIME.getValue(), "2023-02-01T00:00:00.000Z"

));
assertEquals(featureGeoJSON2, sf.get(1), "featureGeoJSON2");
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading