47
47
*/
48
48
public class DGIWGValidate {
49
49
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
+
50
56
/**
51
57
* Is the GeoPackage valid according to the DGIWG GeoPackage Profile
52
58
*
@@ -373,8 +379,8 @@ public static DGIWGValidationErrors validateTileTable(
373
379
String crsBounds = "CRS " + crs .getAuthorityAndCode ()
374
380
+ " Bounds: " + boundingBox ;
375
381
376
- if (tileMatrixSet .getMinX () < boundingBox
377
- . getMinLongitude () ) {
382
+ if (tileMatrixSet .getMinX () < boundingBox . getMinLongitude ()
383
+ - TILE_MATRIX_SET_BOUNDS_TOLERANCE ) {
378
384
errors .add (new DGIWGValidationError (
379
385
TileMatrixSet .TABLE_NAME ,
380
386
TileMatrixSet .COLUMN_MIN_X ,
@@ -383,8 +389,8 @@ public static DGIWGValidationErrors validateTileTable(
383
389
primaryKey (tileMatrixSet )));
384
390
}
385
391
386
- if (tileMatrixSet .getMinY () < boundingBox
387
- . getMinLatitude () ) {
392
+ if (tileMatrixSet .getMinY () < boundingBox . getMinLatitude ()
393
+ - TILE_MATRIX_SET_BOUNDS_TOLERANCE ) {
388
394
errors .add (new DGIWGValidationError (
389
395
TileMatrixSet .TABLE_NAME ,
390
396
TileMatrixSet .COLUMN_MIN_Y ,
@@ -393,8 +399,8 @@ public static DGIWGValidationErrors validateTileTable(
393
399
primaryKey (tileMatrixSet )));
394
400
}
395
401
396
- if (tileMatrixSet .getMaxX () > boundingBox
397
- . getMaxLongitude () ) {
402
+ if (tileMatrixSet .getMaxX () > boundingBox . getMaxLongitude ()
403
+ + TILE_MATRIX_SET_BOUNDS_TOLERANCE ) {
398
404
errors .add (new DGIWGValidationError (
399
405
TileMatrixSet .TABLE_NAME ,
400
406
TileMatrixSet .COLUMN_MAX_X ,
@@ -403,8 +409,8 @@ public static DGIWGValidationErrors validateTileTable(
403
409
primaryKey (tileMatrixSet )));
404
410
}
405
411
406
- if (tileMatrixSet .getMaxY () > boundingBox
407
- . getMaxLatitude () ) {
412
+ if (tileMatrixSet .getMaxY () > boundingBox . getMaxLatitude ()
413
+ + TILE_MATRIX_SET_BOUNDS_TOLERANCE ) {
408
414
errors .add (new DGIWGValidationError (
409
415
TileMatrixSet .TABLE_NAME ,
410
416
TileMatrixSet .COLUMN_MAX_Y ,
0 commit comments