Closed M-Scott-Lassiter closed 2 years ago
:tada: This issue has been resolved in version 1.0.0-beta.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
:tada: This issue has been resolved in version 1.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Description
Bounding boxes are an optional GeoJSON property that describe a box of longitude boundaries that run along meridians and latitude boundaries that are parallel to the equator. A 2D Bounding Box only describes longitude and latitude boundaries, whereas a 3D BBox describes an additional min and max altitude/depth value.
Format
The 3D BBox spec is not explicit, but can be inferred as:
[west, south, depth, east, north, altitude]
.The Antimeridian
In the case of objects spanning the antimeridian, a bounding box becomes required.
The Poles
An area that encompasses either the north or south pole will also require a bounding box that meets special use cases.
Boundaries
Any values outside of the WGS-84 standards should fail.
Although not explicitly stated, it can be inferred that altitude must be greater than or equal to depth.
Units
The GeoJSON standard does not mandate any particular units for the depth and height, but meters is a common reference and matches well with typical geodesy tools.
Valid GeoJSON Examples
Example of a 3D bbox member with a depth of 100 meters:
Example of a 3D bbox member with an altitude between 100 and 950 meters:
Example of a 3D bbox on features with a FeatureCollection that also has a bounding box:
Example of a 3D bbox that crosses the antimeridian:
Example Matcher Usage
Passing Tests
Values in Range
[-20, 10, 0, -10, 20, 0]
[10, 10, 0, 20, 20, 0]
[-20, -20, 0, -10, -10, 0]
[10, -20, 0, 20, -10, 0]
[-10, -20, 0, 20, 10, 0]
[170, -20, 0, 20, -170, 0]
[-10, -20, -100, 20, 10, 0]
,[-10, -20, -500, 20, 10, -50]
[170, -20, 0, -170, 20, 100]
,[-10, -20, 50, 20, 10, 500]
[-10, -20, -22.5, 20, 10, 12345.678]
Values at Edge Cases
[-180, 10, 0, 20, 20, 0]
[10, 10, 0, 180, 20, 0]
[-180.0, 80, 0, 180.0, 90.0, 0]
[-180.0, -90, 0, 180.0, -80.0, 0]
[10, 80, 0, 20, 90.0, 0]
[-45, -90, 0, -80, -80.0, 0]
[-180, 10, 0, 180, 20, 0]
[-10, -90, 0, 10, 90, 0]
[-180, -90, 0, 180, 90, 0]
[-180, -90, -100000, 180, 90, 100000]
[-10, -20, 0, 10, -20, 0]
[-10, 20, 0, 10, 20, 0]
[-10, -20, 0, -10, 20, 0]
[10, -20, 0, 10, 20, 0]
[-10, -20, -220, -10, 20, -220]
[-10, -20, 330, -10, 20, 330]
[0, 0, 0, 0, 0, 0]
Failing Tests
Bbox input not an array
undefined
null
true
,false
200
,-200
,Infinity
,-Infinity
,NaN
{ bbox: [10, 10, 0, 20, 20, 0] }
''
,'Random Coordinate'
,'[10, 10, 0, 20, 20, 0]'
Incorrect number of array elements
[ ]
,[20]
,[20, 10]
,[20, 30, 0]
,[-10, 30, -5, 40]
,[20, 30, 0, 20, 30]
,[20, 30, 0, 20, 30, 0, 2]
,[20, 30, 0, 20, 30, 0, 20, 30, 0]
Coordinates out of range
[-10, -90.0000001, 0, 10, 0, 0]
,[-10, 0, 0, 10, 90.0000001, 0]
,[-10, -90000, 0, 10, 0, 0]
,[-10, 0, 0, 10, 90000, 0]
[-180.0000001, -10, 0, -160, 10, 0]
,[160, -10, 0, 180.0000001, 10, 0]
,[-1800000, -10, 0, -160, 10, 0]
,[160, -10, 0, 1800000, 10, 0]
[-181, -10, 0, 181, 10, 0]
[-10, -91, 0, 10, 91, 0]
[-181, -91, 0, 10, 10, 0]
[-10, -10, 0, 181, 91, 0]
[-181, -91, 0, 181, 91, 0]
Illogical BBox
[-10, 20, 0, 10, -20, 0]
[-10, -20, 200, 20, 10, 150]
BBox has non-numeric values
[<value>, -10, 0, 10, 10, 0]
[-10, <value>, 0, 10, 10, 0]
[-10, -10, <value>, 10, 10, 0]
[-10, -10, 0, <value>, 10, 0]
[-10, -10, 0, 10, <value>, 0]
[-10, -10, 0, 10, 10, <value>]
[<value>, <value>, <value>, <value>, <value>, <value>]
BBox values are arrays of numbers
[[-20], [10], [0], [-10], [20], [0]]