def buffer(geom, urban_rural):
    """Create DHS cluster buffers

    Buffer size:
        - 2km for urban
        - 5km for rural (1% of rural have 10km displacement, but ignoring those)

    Metric units converted to decimal degrees by dividing by width of one decimal
    degree in km at equator. Not an ideal buffer created after reprojecting,
    but good enough for this application.
    """
    if urban_rural == "U":
        return geom.buffer(2000)
    elif urban_rural == "R":
        return geom.buffer(5000)
    else:
        raise ValueError("Invalid urban/rural identified ({})".format(urban_rural))