def METHOD_NAME(result: Union[napi.ReverseResult, napi.SearchResult]) -> napi.Bbox:
    """ Compute a bounding box for the result. For ways and relations
        a given boundingbox is used. For all other object, a box is computed
        around the centroid according to dimensions dereived from the
        search rank.
    """
    if (result.osm_object and result.osm_object[0] == 'N') or result.bbox is None:
        extent = NODE_EXTENT.get(result.category, 0.00005)
        return napi.Bbox.from_point(result.centroid, extent)
    return result.bbox