diff --git a/autotest/gdrivers/s102.py b/autotest/gdrivers/s102.py index 1d41ac6dc7b2..21112d395f72 100755 --- a/autotest/gdrivers/s102.py +++ b/autotest/gdrivers/s102.py @@ -454,7 +454,10 @@ def validate( errors, warnings, checks_done = validate_s102.check(filename) if expected_errors: - assert errors == expected_errors + assert len(errors) == len(expected_errors) + for error, expected_error in zip(errors, expected_errors): + assert error[0] == expected_error[0] + assert expected_error[1] in error[1] else: if errors: print(errors) @@ -621,7 +624,7 @@ def test_s102_validator(): ), ( "Critical error", - "/BathymetryCoverage/BathymetryCoverage.01/Group_001/values type is not uint32", + "/QualityOfBathymetryCoverage/QualityOfBathymetryCoverage.01/Group_001/values type is not uint32", ), ] expected_warnings = [ diff --git a/swig/python/gdal-utils/osgeo_utils/samples/validate_s102.py b/swig/python/gdal-utils/osgeo_utils/samples/validate_s102.py index 56e2e6202cbd..978460ca6998 100755 --- a/swig/python/gdal-utils/osgeo_utils/samples/validate_s102.py +++ b/swig/python/gdal-utils/osgeo_utils/samples/validate_s102.py @@ -838,6 +838,31 @@ def _validate_BathymetryCoverage(self, f): BathymetryCoverage, "dataCodingFormat", expected_values ) + if "interpolationType" in BathymetryCoverage.attrs: + expected_values = { + 1: "nearestneighbor", + 5: "bilinear", + 6: "biquadratic", + 7: "bicubic", + 9: "barycentric", + 10: "discrete", + } + self._validate_enumeration( + BathymetryCoverage, "interpolationType", expected_values + ) + + if "dataOffsetCode" in BathymetryCoverage.attrs: + expected_values = { + 1: 'XMin, YMin ("Lower left") corner ("Cell origin")', + 2: 'XMax, YMax ("Upper right") corner', + 3: 'XMax, YMin ("Lower right") corner', + 4: 'XMin, YMax ("Upper left") corner', + 5: "Barycenter (centroid) of cell", + } + self._validate_enumeration( + BathymetryCoverage, "dataOffsetCode", expected_values + ) + horizontalPositionUncertainty = _get_float_attr_or_none( BathymetryCoverage, "horizontalPositionUncertainty" ) diff --git a/swig/python/gdal-utils/osgeo_utils/samples/validate_s104.py b/swig/python/gdal-utils/osgeo_utils/samples/validate_s104.py index 7cb4386fa9bc..0cdeb8e85c50 100755 --- a/swig/python/gdal-utils/osgeo_utils/samples/validate_s104.py +++ b/swig/python/gdal-utils/osgeo_utils/samples/validate_s104.py @@ -1152,6 +1152,27 @@ def _validate_WaterLevel(self, f): } self._validate_enumeration(WaterLevel, "dataCodingFormat", expected_values) + if "interpolationType" in WaterLevel.attrs: + expected_values = { + 1: "nearestneighbor", + 5: "bilinear", + 6: "biquadratic", + 7: "bicubic", + 9: "barycentric", + 10: "discrete", + } + self._validate_enumeration(WaterLevel, "interpolationType", expected_values) + + if "dataOffsetCode" in WaterLevel.attrs: + expected_values = { + 1: 'XMin, YMin ("Lower left") corner ("Cell origin")', + 2: 'XMax, YMax ("Upper right") corner', + 3: 'XMax, YMin ("Lower right") corner', + 4: 'XMin, YMax ("Upper left") corner', + 5: "Barycenter (centroid) of cell", + } + self._validate_enumeration(WaterLevel, "dataOffsetCode", expected_values) + self._log_check("104_Dev2005") horizontalPositionUncertainty = _get_float_attr_or_none( WaterLevel, "horizontalPositionUncertainty" diff --git a/swig/python/gdal-utils/osgeo_utils/samples/validate_s111.py b/swig/python/gdal-utils/osgeo_utils/samples/validate_s111.py index 965e4a78f05e..8adec51bbd1b 100755 --- a/swig/python/gdal-utils/osgeo_utils/samples/validate_s111.py +++ b/swig/python/gdal-utils/osgeo_utils/samples/validate_s111.py @@ -1214,6 +1214,31 @@ def _validate_SurfaceCurrent(self, f): SurfaceCurrent, "dataCodingFormat", expected_values ) + if "interpolationType" in SurfaceCurrent.attrs: + expected_values = { + 1: "nearestneighbor", + 5: "bilinear", + 6: "biquadratic", + 7: "bicubic", + 9: "barycentric", + 10: "discrete", + } + self._validate_enumeration( + SurfaceCurrent, "interpolationType", expected_values + ) + + if "dataOffsetCode" in SurfaceCurrent.attrs: + expected_values = { + 1: 'XMin, YMin ("Lower left") corner ("Cell origin")', + 2: 'XMax, YMax ("Upper right") corner', + 3: 'XMax, YMin ("Lower right") corner', + 4: 'XMin, YMax ("Upper left") corner', + 5: "Barycenter (centroid) of cell", + } + self._validate_enumeration( + SurfaceCurrent, "dataOffsetCode", expected_values + ) + self._log_check("111_Dev2005") horizontalPositionUncertainty = _get_float_attr_or_none( SurfaceCurrent, "horizontalPositionUncertainty"