Skip to content

Commit 84d5f4b

Browse files
committed
update cloudCoverFull to cloud_coverage (resolves #249)
1 parent e233f03 commit 84d5f4b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

landsat/search.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def search(self, paths_rows=None, lat=None, lon=None, address=None, start_date=N
118118
'path': three_digit(r['path']),
119119
'thumbnail': r['browseURL'],
120120
'date': r['acquisitionDate'],
121-
'cloud': r['cloudCoverFull']
121+
'cloud': r['cloud_coverage']
122122
},
123123
'geometry': {
124124
'type': 'Polygon',
@@ -147,7 +147,7 @@ def search(self, paths_rows=None, lat=None, lon=None, address=None, start_date=N
147147
'row': three_digit(i['row']),
148148
'thumbnail': i['browseURL'],
149149
'date': i['acquisitionDate'],
150-
'cloud': i['cloudCoverFull']}
150+
'cloud': i['cloud_coverage']}
151151
for i in r_dict['results']]
152152

153153
return result
@@ -288,7 +288,7 @@ def cloud_cover_prct_range_builder(self, min=0, max=100):
288288
:returns:
289289
String
290290
"""
291-
return 'cloudCoverFull:[%s+TO+%s]' % (min, max)
291+
return 'cloud_coverage:[%s+TO+%s]' % (min, max)
292292

293293
def address_builder(self, address):
294294
""" Builds lat and lon query from a geocoded address.

tests/test_search.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_query_builder(self):
7575
self.assertRaises(ValueError, self.s.query_builder, paths_rows='003,004,010')
7676

7777
# full example
78-
expected_string = ('acquisitionDate:[2014-01-01+TO+2014-11-12]+AND+cloudCoverFull:[10+TO+28]+AND+upperLeftCo'
78+
expected_string = ('acquisitionDate:[2014-01-01+TO+2014-11-12]+AND+cloud_coverage:[10+TO+28]+AND+upperLeftCo'
7979
'rnerLatitude:[23+TO+1000]+AND+lowerRightCornerLatitude:[-1000+TO+23]+AND+lowerLeftCorner'
8080
'Longitude:[-1000+TO+21]+AND+upperRightCornerLongitude:[21+TO+1000]+AND+((path:003+AND+ro'
8181
'w:004))')
@@ -99,19 +99,19 @@ def test_lat_lon_builder(self):
9999
def test_cloud_cover_prct_range_builder(self):
100100
# no input
101101
string = self.s.cloud_cover_prct_range_builder()
102-
self.assertEqual('cloudCoverFull:[0+TO+100]', string)
102+
self.assertEqual('cloud_coverage:[0+TO+100]', string)
103103

104104
# just min
105105
string = self.s.cloud_cover_prct_range_builder(3)
106-
self.assertEqual('cloudCoverFull:[3+TO+100]', string)
106+
self.assertEqual('cloud_coverage:[3+TO+100]', string)
107107

108108
# just max
109109
string = self.s.cloud_cover_prct_range_builder(max=30)
110-
self.assertEqual('cloudCoverFull:[0+TO+30]', string)
110+
self.assertEqual('cloud_coverage:[0+TO+30]', string)
111111

112112
# both inputs
113113
string = self.s.cloud_cover_prct_range_builder(7, 10)
114-
self.assertEqual('cloudCoverFull:[7+TO+10]', string)
114+
self.assertEqual('cloud_coverage:[7+TO+10]', string)
115115

116116
def test_date_range_builder(self):
117117
string = self.s.date_range_builder('2014-01-01', '2015-01-01')

0 commit comments

Comments
 (0)