From a34f003707d844f2db65795a607d9fab2e6a19bc Mon Sep 17 00:00:00 2001 From: rng Date: Tue, 5 May 2026 16:02:57 +1000 Subject: [PATCH] Shorten name to save space in URL --- .../ogcapi/server/core/parser/elastic/IBoundaryFunction.java | 4 ++-- .../java/au/org/aodn/ogcapi/server/common/RestApiTest.java | 4 ++-- .../server/core/parser/elastic/IBoundaryFunctionTest.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/parser/elastic/IBoundaryFunction.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/parser/elastic/IBoundaryFunction.java index fefc3caf..9631ad6b 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/parser/elastic/IBoundaryFunction.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/parser/elastic/IBoundaryFunction.java @@ -58,8 +58,8 @@ private static Map loadStaticMap(String path, String keyField) static Geometry getGeoJsonFromMap(String mapName, String key) { return switch (mapName) { - case "CORAL_ATLAS" -> CORAL_ATLAS.get(key); - case "AUSTRALIAN_MARINE_PARKS" -> AUZ_MARINE_PARK.get(key); + case "ACA" -> CORAL_ATLAS.get(key); + case "AMP" -> AUZ_MARINE_PARK.get(key); case "MEOW" -> MEOW.get(key); default -> null; }; diff --git a/server/src/test/java/au/org/aodn/ogcapi/server/common/RestApiTest.java b/server/src/test/java/au/org/aodn/ogcapi/server/common/RestApiTest.java index 20b0ead4..ade0fa54 100644 --- a/server/src/test/java/au/org/aodn/ogcapi/server/common/RestApiTest.java +++ b/server/src/test/java/au/org/aodn/ogcapi/server/common/RestApiTest.java @@ -787,7 +787,7 @@ public void verifyIBoundaryFunctionWorks() throws IOException { "ae86e2f5-eaaf-459e-a405-e654d85adb9c.json" ); ResponseEntity collections = testRestTemplate.exchange( - getBasePath() + "/collections?filter=INTERSECTS(geometry,IBOUNDARY('AUSTRALIAN_MARINE_PARKS','12'))", + getBasePath() + "/collections?filter=INTERSECTS(geometry,IBOUNDARY('AMP','12'))", HttpMethod.GET, null, new ParameterizedTypeReference<>() {}); @@ -796,7 +796,7 @@ public void verifyIBoundaryFunctionWorks() throws IOException { assertEquals("ae86e2f5-eaaf-459e-a405-e654d85adb9c", Objects.requireNonNull(collections.getBody()).getCollections().get(0).getId(), "id correct"); collections = testRestTemplate.exchange( - getBasePath() + "/collections?filter=INTERSECTS(geometry,IBOUNDARY('AUSTRALIAN_MARINE_PARKS','15'))", + getBasePath() + "/collections?filter=INTERSECTS(geometry,IBOUNDARY('AMP','15'))", HttpMethod.GET, null, new ParameterizedTypeReference<>() {}); diff --git a/server/src/test/java/au/org/aodn/ogcapi/server/core/parser/elastic/IBoundaryFunctionTest.java b/server/src/test/java/au/org/aodn/ogcapi/server/core/parser/elastic/IBoundaryFunctionTest.java index 1c477d4b..8291daff 100644 --- a/server/src/test/java/au/org/aodn/ogcapi/server/core/parser/elastic/IBoundaryFunctionTest.java +++ b/server/src/test/java/au/org/aodn/ogcapi/server/core/parser/elastic/IBoundaryFunctionTest.java @@ -23,7 +23,7 @@ public void testIBoundaryFunction() { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); Expression func = ff.function("IBOUNDARY", - ff.literal("CORAL_ATLAS"), + ff.literal("ACA"), ff.literal("1")); Object geom = func.evaluate(null); @@ -34,7 +34,7 @@ public void testIBoundaryFunction() { @Test public void testIBoundaryWithCQL() throws Exception { // Parse full CQL2 string - String cql = "INTERSECTS(geometry, IBOUNDARY('CORAL_ATLAS', '1'))"; + String cql = "INTERSECTS(geometry, IBOUNDARY('ACA', '1'))"; CQLToElasticFilterFactory factory = new CQLToElasticFilterFactory<>(CQLCrsType.EPSG4326, CQLFields.class); Filter filter = CompilerUtil.parseFilter(Language.ECQL, cql, factory);