Skip to content

Commit 9e2926d

Browse files
Edwin Shinocefpaf
authored andcommitted
#382: TopoJson.get_bounds() returns [lon,lat] instead of [lat,lon]
Fixes #382
1 parent 3e39044 commit 9e2926d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

folium/features.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,12 +507,12 @@ def _get_self_bounds(self):
507507
ymax = none_max(y, ymax)
508508
return [
509509
[
510-
self.data['transform']['translate'][0] + self.data['transform']['scale'][0] * xmin, # noqa
511510
self.data['transform']['translate'][1] + self.data['transform']['scale'][1] * ymin, # noqa
511+
self.data['transform']['translate'][0] + self.data['transform']['scale'][0] * xmin # noqa
512512
],
513513
[
514-
self.data['transform']['translate'][0] + self.data['transform']['scale'][0] * xmax, # noqa
515514
self.data['transform']['translate'][1] + self.data['transform']['scale'][1] * ymax, # noqa
515+
self.data['transform']['translate'][0] + self.data['transform']['scale'][0] * xmax # noqa
516516
]
517517

518518
]

tests/test_folium.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def test_geo_json_data_binding(self):
450450
[71.285909, -66.979601]], bounds
451451

452452
def test_topo_json(self):
453-
"""Test geojson method."""
453+
"""Test topojson method."""
454454

455455
self.map = folium.Map([43, -100], zoom_start=4)
456456

@@ -467,8 +467,8 @@ def test_topo_json(self):
467467
assert ''.join(topojson_str.split())[:-1] in ''.join(out.split())
468468

469469
bounds = self.map.get_bounds()
470-
assert bounds == [[-124.56617536999985, 41.99187135900012],
471-
[-116.46422312599977, 46.28768217800006]], bounds
470+
assert bounds == [[41.99187135900012, -124.56617536999985],
471+
[46.28768217800006, -116.46422312599977]], bounds
472472

473473
def test_map_build(self):
474474
"""Test map build."""

0 commit comments

Comments
 (0)