text_html_output_1.png
from geopandas.tools import geocode

import folium

import numpy as np
import pandas as pd
import geopandas as gpd
from geopandas.tools import geocode
import folium
agent = 'my_colls_app'

def geo_short(location):
    """
    Take address, cross-street, etc. and return geocoded point at which
    lat/long can conveniently accessed.  Uses Nominatim.
    """
    pt = geocode(location, provider='nominatim', user_agent=agent)
    return pt.geometry.iloc[0]

def basemap_with_buffer(location, buffer_radius_miles):
    centerpoint = geo_short(location)
    basemap = folium.Map(location=[centerpoint.y, centerpoint.x], tiles='openstreetmap', zoom_start=15)
    buffer_radius_meters = buffer_radius_miles * 5280 / 3.28084
    basemap_buffer = folium.Circle(location=[centerpoint.y, centerpoint.x], radius=buffer_radius_meters).add_to(basemap)
    return basemap

patco_address = '100 Lees Ave, Collingswood, NJ 08108'
patco_base = basemap_with_buffer(patco_address, 0.5)
patco_base