diff --git a/siphon/http_util.py b/siphon/http_util.py index d0cef9c4b..46c38096e 100644 --- a/siphon/http_util.py +++ b/siphon/http_util.py @@ -163,11 +163,11 @@ def add_query_parameter(self, **kwargs): self.extra_params.update(kwargs) return self - def lonlat_box(self, north, south, east, west): + def lonlat_box(self, west, east, south, north): r'''Add a latitude/longitude bounding box to the query. - This adds a request for a spatial bounding box, bounded by (`south`, `north`) - for latitude and (`west`, `east`) for the longitude. This modifies the query + This adds a request for a spatial bounding box, bounded by ('north', 'south') + for latitude and ('east', 'west') for the longitude. This modifies the query in-place, but returns ``self`` so that multiple queries can be chained together on one line. @@ -175,14 +175,14 @@ def lonlat_box(self, north, south, east, west): Parameters ---------- - north : float - The bounding latitude to the north, in degrees north of the equator - south : float - The bounding latitude to the south, in degrees north of the equator - east : float - The bounding longitude to the east, in degrees east of the prime meridian west: float The bounding longitude to the west, in degrees east of the prime meridian + east : float + The bounding longitude to the east, in degrees east of the prime meridian + south : float + The bounding latitude to the south, in degrees north of the equator + north : float + The bounding latitude to the north, in degrees north of the equator Returns ------- @@ -190,8 +190,8 @@ def lonlat_box(self, north, south, east, west): Returns self for chaining calls ''' - self._set_query(self.spatial_query, north=north, south=south, - east=east, west=west) + self._set_query(self.spatial_query, west=west, east=east, south=south, + north=north) return self def lonlat_point(self, lon, lat): diff --git a/siphon/tests/test_http_util.py b/siphon/tests/test_http_util.py index 3008d650b..9da0d1135 100644 --- a/siphon/tests/test_http_util.py +++ b/siphon/tests/test_http_util.py @@ -81,10 +81,10 @@ def test_spatial_reset(self): def test_spatial_reset2(self): dr = DataQuery().lonlat_point(-1, -2).lonlat_box(1, 2, 3, 4) query = str(dr) - assert 'east=3' in query - assert 'west=4' in query - assert 'north=1' in query - assert 'south=2' in query + assert 'south=3' in query + assert 'north=4' in query + assert 'west=1' in query + assert 'east=2' in query eq_(query.count('='), 4) def test_iter(self):