Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions schemas/2020-12/iso/coordinate/2022/altitude.json
Original file line number Diff line number Diff line change
@@ -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"
}
11 changes: 11 additions & 0 deletions schemas/2020-12/iso/coordinate/2022/latitude.json
Original file line number Diff line number Diff line change
@@ -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
}
11 changes: 11 additions & 0 deletions schemas/2020-12/iso/coordinate/2022/longitude.json
Original file line number Diff line number Diff line change
@@ -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
}
66 changes: 66 additions & 0 deletions test/iso/coordinate/2022/altitude.test.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
76 changes: 76 additions & 0 deletions test/iso/coordinate/2022/latitude.test.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
76 changes: 76 additions & 0 deletions test/iso/coordinate/2022/longitude.test.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}