diff --git a/examples/GeoJSON and choropleth.ipynb b/examples/GeoJSON and choropleth.ipynb index 8b6642281c..c11d0d89f9 100644 --- a/examples/GeoJSON and choropleth.ipynb +++ b/examples/GeoJSON and choropleth.ipynb @@ -20,8 +20,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "../folium/__init__.py\n", - "0.2.0.dev\n" + "../folium/__init__.pyc\n", + "0.3.0.dev\n" ] } ], @@ -109,15 +109,10 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, "execution_count": 3, @@ -150,15 +145,10 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, "execution_count": 4, @@ -191,15 +181,10 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -239,15 +224,10 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, "execution_count": 6, @@ -288,15 +268,10 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, "execution_count": 7, @@ -427,7 +402,7 @@ "3.210.3" ], "text/plain": [ - "" + "" ] }, "execution_count": 9, @@ -506,15 +481,10 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, "execution_count": 12, @@ -567,15 +537,10 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, "execution_count": 14, @@ -617,15 +582,10 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, "execution_count": 15, @@ -640,6 +600,130 @@ "m" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Popups\n", + "\n", + "If your GeoJson object has an attribute you want to use in popups, you can, by supplying that attribute name to the `popup_function` argument: " + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m = folium.Map([43,-100], zoom_start=4)\n", + "\n", + "folium.GeoJson(\n", + " geo_json_data,\n", + " style_function=lambda feature: {\n", + " 'fillColor': color_dict[feature['id']],\n", + " 'color' : 'black',\n", + " 'weight' : 1,\n", + " 'dashArray' : '5, 5',\n", + " 'fillOpacity' : .9,\n", + " },\n", + " popup_function='name'\n", + " ).add_to(m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can then click on the attribute to see the value in the popup. The value in the popup field can be any valid string or HTML string." + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also set the `popup_attribute` if you change your mind later before adding the geojson to the map." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false, + "scrolled": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m = folium.Map([43,-100], zoom_start=4)\n", + "\n", + "gj = folium.GeoJson(\n", + " geo_json_data,\n", + " style_function=lambda feature: {\n", + " 'fillColor': color_dict[feature['id']],\n", + " 'color' : 'black',\n", + " 'weight' : 1,\n", + " 'dashArray' : '5, 5',\n", + " 'fillOpacity' : .9,\n", + " },\n", + " )\n", + "gj.popup_attribute = 'name'\n", + "gj.add_to(m)\n", + "\n", + "m" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -662,7 +746,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 19, "metadata": { "collapsed": false }, @@ -670,18 +754,13 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, - "execution_count": 16, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -707,7 +786,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 20, "metadata": { "collapsed": false }, @@ -715,18 +794,13 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, - "execution_count": 17, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -747,7 +821,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 21, "metadata": { "collapsed": false }, @@ -756,24 +830,19 @@ "name": "stderr", "output_type": "stream", "text": [ - "/home/journois/anaconda3/lib/python3.4/site-packages/ipykernel/__main__.py:8: FutureWarning: 'threshold_scale' default behavior has changed. Now you get a linear scale between the 'min' and the 'max' of your data. To get former behavior, use folium.utilities.split_six.\n" + "/Library/Python/2.7/site-packages/ipykernel/__main__.py:8: FutureWarning: 'threshold_scale' default behavior has changed. Now you get a linear scale between the 'min' and the 'max' of your data. To get former behavior, use folium.utilities.split_six.\n" ] }, { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, - "execution_count": 18, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -800,7 +869,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 22, "metadata": { "collapsed": false }, @@ -808,18 +877,13 @@ { "data": { "text/html": [ - "\n", - "
\n", - "
\n", - " \n", - "
" + "
" ], "text/plain": [ - "" + "" ] }, - "execution_count": 19, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -838,6 +902,49 @@ "m" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also pass through the a popup function to the chloropleth shortcut." + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m = folium.Map([43,-100], zoom_start=4)\n", + "\n", + "m.choropleth(\n", + " geo_str=open('us-states.json').read(),\n", + " data=unemployment,\n", + " columns=['State', 'Unemployment'],\n", + " key_on='feature.id',\n", + " fill_color='YlGn',\n", + " threshold_scale = [3,4,9,10],\n", + " popup_function=lambda feature: \"{}\".format(feature['properties']['name'])\n", + " )\n", + "m" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -857,21 +964,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 2", "language": "python", - "name": "python3" + "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 3 + "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.5.1" + "pygments_lexer": "ipython2", + "version": "2.7.10" } }, "nbformat": 4, diff --git a/examples/GeoPandas.ipynb b/examples/GeoPandas.ipynb index 07d0b4ca69..37c7a01295 100644 --- a/examples/GeoPandas.ipynb +++ b/examples/GeoPandas.ipynb @@ -15,7 +15,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": { "collapsed": false }, @@ -23,10 +23,10 @@ { "data": { "text/plain": [ - "'../folium/__init__.py'" + "'../folium/__init__.pyc'" ] }, - "execution_count": 2, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } @@ -51,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": { "collapsed": false }, @@ -132,7 +132,7 @@ "4 (POLYGON ((1012821.805786133 229228.2645874023... " ] }, - "execution_count": 3, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -151,7 +151,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": { "collapsed": false }, @@ -159,13 +159,13 @@ { "data": { "text/html": [ - "
" + "
" ], "text/plain": [ - "" + "" ] }, - "execution_count": 4, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -189,7 +189,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": { "collapsed": true }, @@ -206,7 +206,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": { "collapsed": false }, @@ -235,7 +235,7 @@ " 1.623847e+09\n", " 330454.175933\n", " (POLYGON ((970217.0223999023 145643.3322143555...\n", - " {'weight': 2, 'fillColor': '#ff0000', 'color':...\n", + " {u'color': u'black', u'fillColor': u'#ff0000',...\n", " \n", " \n", " 1\n", @@ -244,7 +244,7 @@ " 1.937810e+09\n", " 741227.337073\n", " (POLYGON ((1021176.479003906 151374.7969970703...\n", - " {'weight': 2, 'fillColor': '#00ff00', 'color':...\n", + " {u'color': u'black', u'fillColor': u'#00ff00',...\n", " \n", " \n", " 2\n", @@ -253,7 +253,7 @@ " 3.045079e+09\n", " 896875.396449\n", " (POLYGON ((1029606.076599121 156073.8142089844...\n", - " {'weight': 2, 'fillColor': '#0000ff', 'color':...\n", + " {u'color': u'black', u'fillColor': u'#0000ff',...\n", " \n", " \n", " 3\n", @@ -262,7 +262,7 @@ " 6.364308e+08\n", " 358400.912836\n", " (POLYGON ((981219.0557861328 188655.3157958984...\n", - " {'weight': 2, 'fillColor': '#ffff00', 'color':...\n", + " {u'color': u'black', u'fillColor': u'#ffff00',...\n", " \n", " \n", " 4\n", @@ -271,7 +271,7 @@ " 1.186822e+09\n", " 464475.145651\n", " (POLYGON ((1012821.805786133 229228.2645874023...\n", - " {'weight': 2, 'fillColor': '#00ffff', 'color':...\n", + " {u'color': u'black', u'fillColor': u'#00ffff',...\n", " \n", " \n", "\n", @@ -293,14 +293,14 @@ "4 (POLYGON ((1012821.805786133 229228.2645874023... \n", "\n", " style \n", - "0 {'weight': 2, 'fillColor': '#ff0000', 'color':... \n", - "1 {'weight': 2, 'fillColor': '#00ff00', 'color':... \n", - "2 {'weight': 2, 'fillColor': '#0000ff', 'color':... \n", - "3 {'weight': 2, 'fillColor': '#ffff00', 'color':... \n", - "4 {'weight': 2, 'fillColor': '#00ffff', 'color':... " + "0 {u'color': u'black', u'fillColor': u'#ff0000',... \n", + "1 {u'color': u'black', u'fillColor': u'#00ff00',... \n", + "2 {u'color': u'black', u'fillColor': u'#0000ff',... \n", + "3 {u'color': u'black', u'fillColor': u'#ffff00',... \n", + "4 {u'color': u'black', u'fillColor': u'#00ffff',... " ] }, - "execution_count": 6, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -311,7 +311,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": { "collapsed": false }, @@ -319,13 +319,13 @@ { "data": { "text/html": [ - "
" + "
" ], "text/plain": [ - "" + "" ] }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -338,6 +338,92 @@ "m" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can also use the `popup_function` to set the popup for each feature in the GeoDataFrame. First, we'll create the function to return a HTML string from a GeoJson Feature:" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def make_popupcontent(feature):\n", + " return \"{}\".format(feature[\"properties\"][\"BoroName\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m = folium.Map([40.7,-74], zoom_start=10, tiles='cartodbpositron')\n", + "\n", + "folium.GeoJson(boros, popup_function=make_popupcontent).add_to(m)\n", + "\n", + "m" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can also change your mind and set the popup function after the fact, adding it to the geojson object before it's added to the map." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/html": [ + "
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m = folium.Map([40.7,-74], zoom_start=10, tiles='cartodbpositron')\n", + "\n", + "gj = folium.GeoJson(boros)\n", + "gj.popup_function = make_popupcontent\n", + "gj.add_to(m)\n", + "\n", + "m" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -357,21 +443,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 2", "language": "python", - "name": "python3" + "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 3 + "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.5.1" + "pygments_lexer": "ipython2", + "version": "2.7.10" } }, "nbformat": 4, diff --git a/folium/features.py b/folium/features.py index 011e4605e2..41614d6b22 100644 --- a/folium/features.py +++ b/folium/features.py @@ -5,6 +5,8 @@ Extra features Elements. """ +from types import FunctionType + from jinja2 import Template import json @@ -267,6 +269,11 @@ class GeoJson(Layer): * If str, then data will be passed to the JavaScript as-is. style_function: function, default None A function mapping a GeoJson Feature to a style dict. + popup_function: string or function, default None + The popup value for the feature + * If string, then an attribute to use as a popup value for the feature + * If function, a function taking a GeoJson Feature and returning a + html string to be used as the popup name : string, default None The name of the Layer, as it will appear in LayerControls overlay : bool, default False @@ -290,9 +297,17 @@ class GeoJson(Layer): ... x['properties']['name']=='Alabama' else ... '#00ff00'} >>> GeoJson(geojson, style_function=style_function) + + >>> # Provide a popup using the name attribute of each feature. + >>> GeoJson(geojson, popup_function='name') + + >>> # Provide a popup based on the output of a function on each feature + >>> GeoJson( + ... geojson, + ... popup_function=lambda feautre: feautre['properties']['name']) """ - def __init__(self, data, style_function=None, name=None, - overlay=True, control=True): + def __init__(self, data, style_function=None, popup_function=None, + name=None, overlay=True, control=True): super(GeoJson, self).__init__(name=name, overlay=overlay, control=control) self._name = 'GeoJson' @@ -328,15 +343,58 @@ def style_function(x): return {} self.style_function = style_function + self._popup_function = None + self.popup_attribute = None + self.popup_function = popup_function # Set the popup function + self._template = Template(u""" {% macro script(this, kwargs) %} + {% if this.popup_attribute or this.popup_function %} + function {{this.get_name()}}_EachFeature(feature, layer) { + if (feature.properties && feature.properties.{{this.popup_attribute}}) { + layer.bindPopup(feature.properties.{{this.popup_attribute}}); + } + } + {% endif %} var {{this.get_name()}} = L.geoJson( - {% if this.embed %}{{this.style_data()}}{% else %}"{{this.data}}"{% endif %}) + {% if this.embed %}{{this.style_data()}}{% else %}"{{this.data}}"{% endif %}, + {{'{'}} + {% if this.popup_attribute or this.popup_function %} + onEachFeature: {{this.get_name()}}_EachFeature + {% endif %} + {{'}'}} + ) .addTo({{this._parent.get_name()}}); {{this.get_name()}}.setStyle(function(feature) {return feature.properties.style;}); {% endmacro %} """) # noqa + @property + def popup_function(self): + return self._popup_function + + @popup_function.setter + def popup_function(self, func): + """ + Use a setter so that if the dev sets the property function after the + fact the `popup_attribute` is set correctly. + + Parameters + ---------- + func : srting, function or None + The popup value for the feature + * If string, then an attribute to use as a popup value for the feature + * If function, a function taking a GeoJson Feature and returning a + html string to be used as the popup + """ + if isinstance(func, FunctionType): + self.popup_attribute = "_popupContent" + elif isinstance(func, text_type): + self.popup_attribute = func + elif isinstance(func, binary_type): + self.popup_attribute = text_type(func, 'utf8') + self._popup_function = func + def style_data(self): """ Applies `self.style_function` to each feature of `self.data` and @@ -352,6 +410,13 @@ def style_data(self): for feature in self.data['features']: feature.setdefault('properties', {}).setdefault('style', {}).update(self.style_function(feature)) # noqa + + try: + for feature in self.data["features"]: + feature["properties"]["_popupContent"] = self.popup_function(feature) # noqa + except TypeError: + pass + return json.dumps(self.data, sort_keys=True) def _get_self_bounds(self): diff --git a/folium/folium.py b/folium/folium.py index b0394a9c34..c46a75875e 100644 --- a/folium/folium.py +++ b/folium/folium.py @@ -510,7 +510,7 @@ def choropleth(self, geo_path=None, geo_str=None, data_out='data.json', data=None, columns=None, key_on=None, threshold_scale=None, fill_color='blue', fill_opacity=0.6, line_color='black', line_weight=1, line_opacity=1, legend_name="", - topojson=None, reset=False): + topojson=None, popup_function=None, reset=False): """ Apply a GeoJSON overlay to the map. @@ -576,6 +576,10 @@ def choropleth(self, geo_path=None, geo_str=None, data_out='data.json', topojson: string, default None If using a TopoJSON, passing "objects.yourfeature" to the topojson keyword argument will enable conversion to GeoJSON. + popup_function: string or function, default None + If using GeoJson a string or function to pass through to the + map to create popups based on feature attributes. Ignored for + topojson. reset: boolean, default False Remove all current geoJSON layers, start with new layer @@ -677,7 +681,8 @@ def style_function(x): if topojson: geo_json = TopoJson(geo_data, topojson, style_function=style_function) # noqa else: - geo_json = GeoJson(geo_data, style_function=style_function) + geo_json = GeoJson(geo_data, style_function=style_function, + popup_function=popup_function) self.add_children(geo_json) diff --git a/tests/test_folium.py b/tests/test_folium.py index 27f66186e0..2b746c6f98 100644 --- a/tests/test_folium.py +++ b/tests/test_folium.py @@ -370,12 +370,16 @@ def test_geo_json_str(self): # Verify the geo_json object obj_temp = jinja2.Template(""" - var {{ this.get_name() }} = L.geoJson({{ this.style_data() }}) + var {{ this.get_name() }} = L.geoJson( + {{ this.style_data() }}, + {{'{'}} + {{'}'}} + ) .addTo({{ this._parent.get_name() }}); {{ this.get_name() }}.setStyle(function(feature) {return feature.properties.style;}); """) # noqa obj = obj_temp.render(this=geo_json, json=json) - assert ''.join(obj.split())[:-1] in out + assert ''.join(obj.split())[:-1] in out, out bounds = self.map.get_bounds() assert bounds == [[18.948267, -171.742517], @@ -452,6 +456,89 @@ def test_geo_json_data_binding(self): assert bounds == [[18.948267, -171.742517], [71.285909, -66.979601]], bounds + def test_geo_json_popup(self): + """Test geojson popup as attribute name.""" + + path = os.path.join(rootpath, 'us-counties.json') + data = json.load(open(path)) + gj = folium.GeoJson(data, popup_function='name') + + self.map = folium.Map([43, -100], zoom_start=4) + gj.add_to(self.map) + self.map._parent.render() + + assert gj.popup_attribute == 'name', gj.popup_attribute + + bounds = self.map.get_bounds() + assert bounds == [[18.948267, -171.742517], + [71.285909, -66.979601]], bounds + + def test_geo_json_popup_function(self): + """Test geojson popup as function.""" + + path = os.path.join(rootpath, 'us-counties.json') + data = json.load(open(path)) + gj = folium.GeoJson( + data, + popup_function=lambda feature: feature['properties']['name'] + ) + + self.map = folium.Map([43, -100], zoom_start=4) + gj.add_to(self.map) + self.map._parent.render() + + assert gj.popup_attribute == '_popupContent', gj.popup_attribute + + # Test each feature to guarantee popupContent set correctly + for feature in gj.data['features']: + assert feature['properties']['_popupContent'] == \ + feature['properties']['name'] + + bounds = self.map.get_bounds() + assert bounds == [[18.948267, -171.742517], + [71.285909, -66.979601]], bounds + + def test_geo_json_popup_afterwards(self): + """Test geojson popup as attribute name that is set after the fact""" + + path = os.path.join(rootpath, 'us-counties.json') + data = json.load(open(path)) + gj = folium.GeoJson(data) + gj.popup_attribute = 'name' + + self.map = folium.Map([43, -100], zoom_start=4) + gj.add_to(self.map) + self.map._parent.render() + + assert gj.popup_attribute == 'name', gj.popup_attribute + + bounds = self.map.get_bounds() + assert bounds == [[18.948267, -171.742517], + [71.285909, -66.979601]], bounds + + def test_geo_json_popup_function_afterwards(self): + """Test geojson popup as function set after the fact.""" + + path = os.path.join(rootpath, 'us-counties.json') + data = json.load(open(path)) + gj = folium.GeoJson(data) + gj.popup_function = lambda feature: feature['properties']['name'] + + self.map = folium.Map([43, -100], zoom_start=4) + gj.add_to(self.map) + self.map._parent.render() + + assert gj.popup_attribute == '_popupContent', gj.popup_attribute + + # Test each feature to guarantee popupContent set correctly + for feature in gj.data['features']: + assert feature['properties']['_popupContent'] == \ + feature['properties']['name'] + + bounds = self.map.get_bounds() + assert bounds == [[18.948267, -171.742517], + [71.285909, -66.979601]], bounds + def test_topo_json(self): """Test geojson method."""