From 0f4439950919e3c9875f10085504e849a8f5da1c Mon Sep 17 00:00:00 2001 From: Brian Osborn Date: Thu, 14 Mar 2024 15:25:11 -0600 Subject: [PATCH] allow for a 1 meter bounds tolerance as specified in the DGIWG spec conformance test --- .../nga/geopackage/dgiwg/DGIWGValidate.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/mil/nga/geopackage/dgiwg/DGIWGValidate.java b/src/main/java/mil/nga/geopackage/dgiwg/DGIWGValidate.java index c6d8ead9..bc479823 100644 --- a/src/main/java/mil/nga/geopackage/dgiwg/DGIWGValidate.java +++ b/src/main/java/mil/nga/geopackage/dgiwg/DGIWGValidate.java @@ -47,6 +47,12 @@ */ public class DGIWGValidate { + /** + * Tile Matrix Set bounds tolerance in meters. 1 meter as defined in + * "Conformance Class Bounding Box (bbox)". + */ + public static final double TILE_MATRIX_SET_BOUNDS_TOLERANCE = 1.0; + /** * Is the GeoPackage valid according to the DGIWG GeoPackage Profile * @@ -373,8 +379,8 @@ public static DGIWGValidationErrors validateTileTable( String crsBounds = "CRS " + crs.getAuthorityAndCode() + " Bounds: " + boundingBox; - if (tileMatrixSet.getMinX() < boundingBox - .getMinLongitude()) { + if (tileMatrixSet.getMinX() < boundingBox.getMinLongitude() + - TILE_MATRIX_SET_BOUNDS_TOLERANCE) { errors.add(new DGIWGValidationError( TileMatrixSet.TABLE_NAME, TileMatrixSet.COLUMN_MIN_X, @@ -383,8 +389,8 @@ public static DGIWGValidationErrors validateTileTable( primaryKey(tileMatrixSet))); } - if (tileMatrixSet.getMinY() < boundingBox - .getMinLatitude()) { + if (tileMatrixSet.getMinY() < boundingBox.getMinLatitude() + - TILE_MATRIX_SET_BOUNDS_TOLERANCE) { errors.add(new DGIWGValidationError( TileMatrixSet.TABLE_NAME, TileMatrixSet.COLUMN_MIN_Y, @@ -393,8 +399,8 @@ public static DGIWGValidationErrors validateTileTable( primaryKey(tileMatrixSet))); } - if (tileMatrixSet.getMaxX() > boundingBox - .getMaxLongitude()) { + if (tileMatrixSet.getMaxX() > boundingBox.getMaxLongitude() + + TILE_MATRIX_SET_BOUNDS_TOLERANCE) { errors.add(new DGIWGValidationError( TileMatrixSet.TABLE_NAME, TileMatrixSet.COLUMN_MAX_X, @@ -403,8 +409,8 @@ public static DGIWGValidationErrors validateTileTable( primaryKey(tileMatrixSet))); } - if (tileMatrixSet.getMaxY() > boundingBox - .getMaxLatitude()) { + if (tileMatrixSet.getMaxY() > boundingBox.getMaxLatitude() + + TILE_MATRIX_SET_BOUNDS_TOLERANCE) { errors.add(new DGIWGValidationError( TileMatrixSet.TABLE_NAME, TileMatrixSet.COLUMN_MAX_Y,