Skip to content

Commit

Permalink
Merge pull request #49 from jclark754/master
Browse files Browse the repository at this point in the history
changed lonlat_box() param order
  • Loading branch information
lesserwhirls committed Jul 23, 2015
2 parents 0df1f1b + a47c052 commit 6f05e79
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions siphon/http_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,35 +163,35 @@ 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.
This replaces any existing spatial queries that have been set.
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
-------
self : ``DataQuery`` instance
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):
Expand Down
8 changes: 4 additions & 4 deletions siphon/tests/test_http_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 6f05e79

Please sign in to comment.