def test_new_data_request_single_byod(self): request = SentinelHub.new_data_request( 'CUSTOM', ['RED'], (512, 305), crs="http://www.opengis.net/def/crs/EPSG/0/3857", bbox=(1545577, 5761986, 1705367, 5857046), band_sample_types="UINT8", collection_id='1a3ab057-3c51-447c-9f85-27d4b633b3f5') # with open(os.path.join(REQUEST_SINGLE_JSON, 'w') as fp: # json.dump(request, fp, indent=2) with open(REQUEST_SINGLE_BYOD_JSON, 'r') as fp: expected_request = json.load(fp) self.assertEqual(expected_request, request)
def test_new_data_request_multi_byod(self): request = SentinelHub.new_data_request( 'CUSTOM', ['RED', 'GREEN', 'BLUE'], (512, 305), bbox=(1545577, 5761986, 1705367, 5857046), crs='http://www.opengis.net/def/crs/EPSG/0/3857', band_sample_types='UINT8', collection_id='1a3ab057-3c51-447c-9f85-27d4b633b3f5') # with open(REQUEST_MULTI_JSON), 'w') as fp: # json.dump(request, fp, indent=2) with open(REQUEST_MULTI_BYOD_JSON, 'r') as fp: expected_request = json.load(fp) self.assertEqual(expected_request, request)
def test_new_data_request_multi(self): request = SentinelHub.new_data_request( 'S2L1C', ['B02', 'B03', 'B04', 'B08'], (512, 512), time_range=("2018-10-01T00:00:00.000Z", "2018-10-10T00:00:00.000Z"), bbox=( 13.822, 45.850, 14.559, 46.291, ), band_sample_types="FLOAT32", band_units="reflectance") # with open(REQUEST_MULTI_JSON), 'w') as fp: # json.dump(request, fp, indent=2) with open(REQUEST_MULTI_JSON, 'r') as fp: expected_request = json.load(fp) self.assertEqual(expected_request, request)