Valid EDR cube queries for data with decreasing coordinates (#1402)
* resolving case when lat dimensions are decreasing CF conventions state only that a "coordinate variable must have values that are strictly monotonic (increasing or decreasing)." In the case of PRISM, the lat coordinates are decreasing. pygeoapi failed due to the lat dimension being empty with existing implementation; this update addresses the issue. * remove blank space * resolving case when lat dimensions are decreasing CF conventions state only that a "coordinate variable must have values that are strictly monotonic (increasing or decreasing)." In the case of PRISM, the lat coordinates are decreasing. pygeoapi failed due to the lat dimension being empty with existing implementation; this update addresses the issue. * remove blank space * test decreasing latitude The new test will now uncover if you can successfully serve data stored on S3 AND test if you can perform a cube query on data with monotonically decreasing latitude coordinates at the same time. * flake8 py3 fixes
This commit is contained in:
+11
-9
@@ -2002,15 +2002,6 @@ def test_get_collection_edr_query(config, api_):
|
||||
req, 'icoads-sst', None, 'position')
|
||||
assert code == HTTPStatus.NO_CONTENT
|
||||
|
||||
# S3 EDR
|
||||
req = mock_request({
|
||||
'coords': 'POINT(-100 40)',
|
||||
'parameter-name': 'GWETROOT'
|
||||
})
|
||||
rsp_headers, code, response = api_.get_collection_edr_query(
|
||||
req, 'nasa-power', None, 'position')
|
||||
assert code == HTTPStatus.OK
|
||||
|
||||
# position no coords
|
||||
req = mock_request({
|
||||
'datetime': '2000-01-17'
|
||||
@@ -2041,6 +2032,17 @@ def test_get_collection_edr_query(config, api_):
|
||||
req, 'icoads-sst', None, 'cube')
|
||||
assert code == HTTPStatus.BAD_REQUEST
|
||||
|
||||
# cube decreasing latitude coords and S3
|
||||
req = mock_request({
|
||||
'bbox': '-100,40,-99,45',
|
||||
'parameter-name': 'tmn',
|
||||
'datetime': '1994-01-01/1994-12-31',
|
||||
})
|
||||
|
||||
rsp_headers, code, response = api_.get_collection_edr_query(
|
||||
req, 'usgs-prism', None, 'cube')
|
||||
assert code == HTTPStatus.OK
|
||||
|
||||
|
||||
def test_validate_bbox():
|
||||
assert validate_bbox('1,2,3,4') == [1, 2, 3, 4]
|
||||
|
||||
Reference in New Issue
Block a user