Skip to content

Commit 0f44399

Browse files
committed
allow for a 1 meter bounds tolerance as specified in the DGIWG spec conformance test
1 parent 1b509f0 commit 0f44399

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/main/java/mil/nga/geopackage/dgiwg/DGIWGValidate.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@
4747
*/
4848
public class DGIWGValidate {
4949

50+
/**
51+
* Tile Matrix Set bounds tolerance in meters. 1 meter as defined in
52+
* "Conformance Class Bounding Box (bbox)".
53+
*/
54+
public static final double TILE_MATRIX_SET_BOUNDS_TOLERANCE = 1.0;
55+
5056
/**
5157
* Is the GeoPackage valid according to the DGIWG GeoPackage Profile
5258
*
@@ -373,8 +379,8 @@ public static DGIWGValidationErrors validateTileTable(
373379
String crsBounds = "CRS " + crs.getAuthorityAndCode()
374380
+ " Bounds: " + boundingBox;
375381

376-
if (tileMatrixSet.getMinX() < boundingBox
377-
.getMinLongitude()) {
382+
if (tileMatrixSet.getMinX() < boundingBox.getMinLongitude()
383+
- TILE_MATRIX_SET_BOUNDS_TOLERANCE) {
378384
errors.add(new DGIWGValidationError(
379385
TileMatrixSet.TABLE_NAME,
380386
TileMatrixSet.COLUMN_MIN_X,
@@ -383,8 +389,8 @@ public static DGIWGValidationErrors validateTileTable(
383389
primaryKey(tileMatrixSet)));
384390
}
385391

386-
if (tileMatrixSet.getMinY() < boundingBox
387-
.getMinLatitude()) {
392+
if (tileMatrixSet.getMinY() < boundingBox.getMinLatitude()
393+
- TILE_MATRIX_SET_BOUNDS_TOLERANCE) {
388394
errors.add(new DGIWGValidationError(
389395
TileMatrixSet.TABLE_NAME,
390396
TileMatrixSet.COLUMN_MIN_Y,
@@ -393,8 +399,8 @@ public static DGIWGValidationErrors validateTileTable(
393399
primaryKey(tileMatrixSet)));
394400
}
395401

396-
if (tileMatrixSet.getMaxX() > boundingBox
397-
.getMaxLongitude()) {
402+
if (tileMatrixSet.getMaxX() > boundingBox.getMaxLongitude()
403+
+ TILE_MATRIX_SET_BOUNDS_TOLERANCE) {
398404
errors.add(new DGIWGValidationError(
399405
TileMatrixSet.TABLE_NAME,
400406
TileMatrixSet.COLUMN_MAX_X,
@@ -403,8 +409,8 @@ public static DGIWGValidationErrors validateTileTable(
403409
primaryKey(tileMatrixSet)));
404410
}
405411

406-
if (tileMatrixSet.getMaxY() > boundingBox
407-
.getMaxLatitude()) {
412+
if (tileMatrixSet.getMaxY() > boundingBox.getMaxLatitude()
413+
+ TILE_MATRIX_SET_BOUNDS_TOLERANCE) {
408414
errors.add(new DGIWGValidationError(
409415
TileMatrixSet.TABLE_NAME,
410416
TileMatrixSet.COLUMN_MAX_Y,

0 commit comments

Comments
 (0)