You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 Bounding Box describes an additional min and max altitude/depth value.
A GeoJSON object MAY have a member named "bbox" to include information on the coordinate range for its Geometries, Features, or FeatureCollections. The value of the bbox member MUST be an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries.
This matcher evaluates any Geometry, GeometryCollection, Feature, or FeatureCollection object to ensure it has a valid 2D or 3D bounding box. It will not check any subsets of these objects (i.e. it will not check all "geometries" in the collection also have bounding boxes).
It takes an optional argument of a valid bounding box array, bboxEquals. If present, the feature must have a bounding box that exactly equals this value.
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 Bounding Box describes an additional min and max altitude/depth value.
This matcher evaluates any Geometry, GeometryCollection, Feature, or FeatureCollection object to ensure it has a valid 2D or 3D bounding box. It will not check any subsets of these objects (i.e. it will not check all "geometries" in the collection also have bounding boxes).
It takes an optional argument of a valid bounding box array,
bboxEquals
. If present, the feature must have a bounding box that exactly equals this value.Example Matcher Usage
Passing Tests
Valid GeoJSON Objects with a BBox
Check with and without optional
bboxEquals
Valid GeoJSON Objects with a BBox
A GeometryCollection, Feature, and FeatureCollection that has a BBox, but one or more components do not
Failing Tests
Invalid Inputs To Matcher
Rejects each of the following:
[]
,[0, 0]
,[0, 0, 0]
,[[-20], [10], [-10], [20]]
,[0, 0, 0, 0]
,[0, 0, 0, 0, 0, 0]
undefined
,null
,false
,true
,0
{ someProp: 'I am not GeoJSON', id: 4 }
{}
''
,'Random Feature',
Valid GeoJSON Objects without a BBox
Each of the seven Geometry, Feature, and FeatureCollection valid objects
Valid GeoJSON Objects with Component BBox but no Overall BBox
A GeometryCollection, Feature, and FeatureCollection that has no BBox, but the geometries do
Valid GeoJSON Objects with a BBox, bboxEquals Does Not Match
Each of the seven Geometry, Feature, and FeatureCollection valid objects
Incorrect number of array elements in bboxEquals
All items in "Invalid Inputs To Matcher" except the 4 and 6 element arrays
The text was updated successfully, but these errors were encountered: