diff --git a/src/GeoTools-Tests/GeoToolsBoundingBoxTest.class.st b/src/GeoTools-Tests/GeoToolsBoundingBoxTest.class.st index 02d09ab..9cb6476 100644 --- a/src/GeoTools-Tests/GeoToolsBoundingBoxTest.class.st +++ b/src/GeoTools-Tests/GeoToolsBoundingBoxTest.class.st @@ -153,6 +153,21 @@ GeoToolsBoundingBoxTest >> testCenterAbsoluteCoordinates [ self assert: boundingBox centerAbsoluteCoordinates longitudeInDegrees equals: 0. ] +{ #category : #tests } +GeoToolsBoundingBoxTest >> testIsValid [ + + self deny: boundingBox isValid. + + self setUpZeroBox. + self assert: boundingBox isValid. + + self setUpSmallBox. + self assert: boundingBox isValid. + + self setUpTopRightSmallBox. + self assert: boundingBox isValid +] + { #category : #tests } GeoToolsBoundingBoxTest >> testLeftLongitudeInDegrees [ diff --git a/src/GeoTools/TGeoToolsBoundingBox.trait.st b/src/GeoTools/TGeoToolsBoundingBox.trait.st index 39156e0..a9e3dc0 100644 --- a/src/GeoTools/TGeoToolsBoundingBox.trait.st +++ b/src/GeoTools/TGeoToolsBoundingBox.trait.st @@ -90,6 +90,15 @@ TGeoToolsBoundingBox >> centerAbsoluteCoordinates [ longitudeInDegrees: longitude ] +{ #category : #testing } +TGeoToolsBoundingBox >> isValid [ + + ^ (self topLeftAbsoluteCoordinates notNil and: [ + self topLeftAbsoluteCoordinates isValid ]) and: [ + self bottomRightAbsoluteCoordinates notNil and: [ + self bottomRightAbsoluteCoordinates isValid ] ] +] + { #category : #accessing } TGeoToolsBoundingBox >> leftLongitudeInDegrees [