diff --git a/schemas/2020-12/iso/coordinate/2022/altitude.json b/schemas/2020-12/iso/coordinate/2022/altitude.json new file mode 100644 index 00000000..8b560a46 --- /dev/null +++ b/schemas/2020-12/iso/coordinate/2022/altitude.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 6709:2022 Altitude", + "description": "An altitude or height in meters relative to the reference ellipsoid, with positive values above and negative values below", + "examples": [ 0, 100, -50, 8848.86, -10994 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.iso.org/standard/75147.html" ], + "type": "number" +} diff --git a/schemas/2020-12/iso/coordinate/2022/latitude.json b/schemas/2020-12/iso/coordinate/2022/latitude.json new file mode 100644 index 00000000..833202d6 --- /dev/null +++ b/schemas/2020-12/iso/coordinate/2022/latitude.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 6709:2022 Latitude", + "description": "A latitude coordinate in decimal degrees, ranging from -90 (south pole) to +90 (north pole)", + "examples": [ 0, 37.7749, -33.8688, 90, -90 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.iso.org/standard/75147.html" ], + "$ref": "../../../bipm/si/2019/non-si/unit/degree.json", + "maximum": 90, + "minimum": -90 +} diff --git a/schemas/2020-12/iso/coordinate/2022/longitude.json b/schemas/2020-12/iso/coordinate/2022/longitude.json new file mode 100644 index 00000000..7b77aff5 --- /dev/null +++ b/schemas/2020-12/iso/coordinate/2022/longitude.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "ISO 6709:2022 Longitude", + "description": "A longitude coordinate in decimal degrees, ranging from -180 (west) to +180 (east)", + "examples": [ 0, -122.419, 151.209, 180, -180 ], + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "x-links": [ "https://www.iso.org/standard/75147.html" ], + "$ref": "../../../bipm/si/2019/non-si/unit/degree.json", + "maximum": 180, + "minimum": -180 +} diff --git a/test/iso/coordinate/2022/altitude.test.json b/test/iso/coordinate/2022/altitude.test.json new file mode 100644 index 00000000..2f8e6b31 --- /dev/null +++ b/test/iso/coordinate/2022/altitude.test.json @@ -0,0 +1,66 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/2020-12/iso/coordinate/2022/altitude.json", + "tests": [ + { + "description": "Valid - sea level", + "data": 0, + "valid": true + }, + { + "description": "Valid - Mount Everest summit", + "data": 8848.86, + "valid": true + }, + { + "description": "Valid - Mariana Trench", + "data": -10994, + "valid": true + }, + { + "description": "Valid - positive integer", + "data": 100, + "valid": true + }, + { + "description": "Valid - negative decimal", + "data": -50.5, + "valid": true + }, + { + "description": "Valid - very high altitude", + "data": 100000, + "valid": true + }, + { + "description": "Valid - very deep", + "data": -100000, + "valid": true + }, + { + "description": "Invalid type - string", + "data": "100", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/iso/coordinate/2022/latitude.test.json b/test/iso/coordinate/2022/latitude.test.json new file mode 100644 index 00000000..20e39d35 --- /dev/null +++ b/test/iso/coordinate/2022/latitude.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/2020-12/iso/coordinate/2022/latitude.json", + "tests": [ + { + "description": "Valid - equator", + "data": 0, + "valid": true + }, + { + "description": "Valid - north pole", + "data": 90, + "valid": true + }, + { + "description": "Valid - south pole", + "data": -90, + "valid": true + }, + { + "description": "Valid - positive decimal", + "data": 37.7749, + "valid": true + }, + { + "description": "Valid - negative decimal", + "data": -33.8688, + "valid": true + }, + { + "description": "Invalid - above north pole", + "data": 90.1, + "valid": false + }, + { + "description": "Invalid - below south pole", + "data": -90.1, + "valid": false + }, + { + "description": "Invalid - way above range", + "data": 180, + "valid": false + }, + { + "description": "Invalid - way below range", + "data": -180, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "37.7749", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +} diff --git a/test/iso/coordinate/2022/longitude.test.json b/test/iso/coordinate/2022/longitude.test.json new file mode 100644 index 00000000..8e8eb73a --- /dev/null +++ b/test/iso/coordinate/2022/longitude.test.json @@ -0,0 +1,76 @@ +{ + "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", + "target": "../../../../schemas/2020-12/iso/coordinate/2022/longitude.json", + "tests": [ + { + "description": "Valid - prime meridian", + "data": 0, + "valid": true + }, + { + "description": "Valid - antimeridian east", + "data": 180, + "valid": true + }, + { + "description": "Valid - antimeridian west", + "data": -180, + "valid": true + }, + { + "description": "Valid - positive decimal", + "data": 151.209, + "valid": true + }, + { + "description": "Valid - negative decimal", + "data": -122.419, + "valid": true + }, + { + "description": "Invalid - above east limit", + "data": 180.1, + "valid": false + }, + { + "description": "Invalid - below west limit", + "data": -180.1, + "valid": false + }, + { + "description": "Invalid - way above range", + "data": 360, + "valid": false + }, + { + "description": "Invalid - way below range", + "data": -360, + "valid": false + }, + { + "description": "Invalid type - string", + "data": "-122.419", + "valid": false + }, + { + "description": "Invalid type - boolean", + "data": true, + "valid": false + }, + { + "description": "Invalid type - null", + "data": null, + "valid": false + }, + { + "description": "Invalid type - array", + "data": [], + "valid": false + }, + { + "description": "Invalid type - object", + "data": {}, + "valid": false + } + ] +}